diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..cd9eb4b --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + mini + diff --git a/profanity-0.15.0-Fix-tests-with-gcc15-uintptr_t.patch b/profanity-0.15.0-Fix-tests-with-gcc15-uintptr_t.patch new file mode 100644 index 0000000..9dca79a --- /dev/null +++ b/profanity-0.15.0-Fix-tests-with-gcc15-uintptr_t.patch @@ -0,0 +1,128 @@ +From 9f2abc75ad27d3dcc951b8fc5aa922bdbe76f287 Mon Sep 17 00:00:00 2001 +From: Andreas Stieger +Date: Mon, 28 Jul 2025 18:38:26 +0200 +Subject: [PATCH] Fix tests with gcc15 (uintptr_t) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +fixes: error: ‘uintptr_t’ undeclared, defined in header ‘ +--- + tests/unittests/config/stub_accounts.c | 1 + + tests/unittests/log/stub_log.c | 1 + + tests/unittests/test_autocomplete.c | 1 + + tests/unittests/test_chat_session.c | 1 + + tests/unittests/test_common.c | 1 + + tests/unittests/test_jid.c | 1 + + tests/unittests/test_parser.c | 1 + + tests/unittests/test_preferences.c | 1 + + tests/unittests/test_roster_list.c | 1 + + 9 files changed, 9 insertions(+) + +diff --git a/tests/unittests/config/stub_accounts.c b/tests/unittests/config/stub_accounts.c +index 360e5643..981d0180 100644 +--- a/tests/unittests/config/stub_accounts.c ++++ b/tests/unittests/config/stub_accounts.c +@@ -1,5 +1,6 @@ + #include + #include ++#include + #include + #include + +diff --git a/tests/unittests/log/stub_log.c b/tests/unittests/log/stub_log.c +index 23ab5cdc..f0f67e47 100644 +--- a/tests/unittests/log/stub_log.c ++++ b/tests/unittests/log/stub_log.c +@@ -20,6 +20,7 @@ + * + */ + ++#include + #include + #include + #include +diff --git a/tests/unittests/test_autocomplete.c b/tests/unittests/test_autocomplete.c +index 599cf390..0e307351 100644 +--- a/tests/unittests/test_autocomplete.c ++++ b/tests/unittests/test_autocomplete.c +@@ -1,6 +1,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff --git a/tests/unittests/test_chat_session.c b/tests/unittests/test_chat_session.c +index 26845dbc..2de18c08 100644 +--- a/tests/unittests/test_chat_session.c ++++ b/tests/unittests/test_chat_session.c +@@ -4,6 +4,7 @@ + #include + #include + #include ++#include + + #include "xmpp/chat_session.h" + +diff --git a/tests/unittests/test_common.c b/tests/unittests/test_common.c +index f381947b..e340fcf3 100644 +--- a/tests/unittests/test_common.c ++++ b/tests/unittests/test_common.c +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + + void + replace_one_substr(void** state) +diff --git a/tests/unittests/test_jid.c b/tests/unittests/test_jid.c +index 645a7b0a..77886e4a 100644 +--- a/tests/unittests/test_jid.c ++++ b/tests/unittests/test_jid.c +@@ -1,5 +1,6 @@ + #include + #include ++#include + #include + #include + #include +diff --git a/tests/unittests/test_parser.c b/tests/unittests/test_parser.c +index 3d0d3fc6..8019097d 100644 +--- a/tests/unittests/test_parser.c ++++ b/tests/unittests/test_parser.c +@@ -1,5 +1,6 @@ + #include + #include ++#include + #include + #include + #include +diff --git a/tests/unittests/test_preferences.c b/tests/unittests/test_preferences.c +index 7868791d..1eb2ba36 100644 +--- a/tests/unittests/test_preferences.c ++++ b/tests/unittests/test_preferences.c +@@ -1,5 +1,6 @@ + #include + #include ++#include + #include + #include + #include +diff --git a/tests/unittests/test_roster_list.c b/tests/unittests/test_roster_list.c +index fc10d1a7..185a9c72 100644 +--- a/tests/unittests/test_roster_list.c ++++ b/tests/unittests/test_roster_list.c +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + + #include "xmpp/contact.h" + #include "xmpp/roster_list.h" +-- +2.50.1 + diff --git a/profanity-rpmlintrc b/profanity-rpmlintrc deleted file mode 100644 index d52ff13..0000000 --- a/profanity-rpmlintrc +++ /dev/null @@ -1,6 +0,0 @@ -# We created the-mini and -standard packages. -addFilter("W: no-manual-page-for-binary profanity-*") -# Not worth splitting out in seperate packages so far -addFilter("E: shlib-policy-name-error .* libprofanity") -addFilter("E: devel-file-in-non-devel-package .* /usr/include/profapi.h") -addFilter("E: devel-file-in-non-devel-package .* /usr/lib64/libprofanity.so") diff --git a/profanity.changes b/profanity.changes index 4501fda..6a32323 100644 --- a/profanity.changes +++ b/profanity.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Sat Aug 16 10:38:25 UTC 2025 - Andreas Stieger + +- rework spec file to wrap bcond around optional dependencies. This + allows a clean generation of the -mini headless build boo#1246851 +- split the library and -devel packages +- enable xscreensaver awareness, use gtk3 +- run some tests +- add profanity-0.15.0-Fix-tests-with-gcc15-uintptr_t.patch + to fix tests with gcc15 +- package the license files + ------------------------------------------------------------------- Wed Jul 23 07:04:12 UTC 2025 - Michael Vetter diff --git a/profanity.spec b/profanity.spec index 0806c88..78041c8 100644 --- a/profanity.spec +++ b/profanity.spec @@ -2,6 +2,7 @@ # spec file for package profanity # # Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 Andreas Stieger # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +17,37 @@ # -Name: profanity +%global flavor @BUILD_FLAVOR@%{nil} +%global sname profanity +%if "%{flavor}" == "" +%global pname %{sname} +%else +%global pname %{sname}-%{flavor} +%endif +%define sover 0 +# standard flavor +%if "%{flavor}" == "" +%bcond_without notifications +%bcond_without xscreensaver +%bcond_without icons +%bcond_without scaled_avatars +%bcond_without tests +%else +# -mini +%bcond_with notifications +%bcond_with xscreensaver +%bcond_with icons +%bcond_with scaled_avatars +%bcond_with tests +%endif +# common to both +%bcond_without python +%bcond_without otr +%bcond_without gpg +%bcond_without omemo +%bcond_without omemo_qrcode +# +Name: %{pname} Version: 0.15.0 Release: 0 Summary: Console-based XMPP client @@ -24,129 +55,166 @@ License: SUSE-GPL-3.0+-with-openssl-exception Group: Productivity/Networking/Instant Messenger URL: https://profanity-im.github.io Source: https://github.com/profanity-im/profanity/releases/download/%{version}/profanity-%{version}.tar.gz -Source1: profanity-rpmlintrc # bsc#1246850: Fix build with gpgme >= 2.0.0. See gh/profanity#2048 Patch0: https://github.com/profanity-im/profanity/commit/606eaac31dfb97df16b0d2ba9466a3a67bec122a.patch#/profanity-0.15.0-gpgme.patch -BuildRequires: glib2-devel >= 2.62 -BuildRequires: gtk2-devel -BuildRequires: libcurl-devel -BuildRequires: libexpat-devel -BuildRequires: libgcrypt-devel >= 1.7.0 -BuildRequires: libgpgme-devel -BuildRequires: libnotify-devel -BuildRequires: libotr-devel -BuildRequires: libsignal-protocol-c-devel >= 2.3.2 -BuildRequires: libstrophe-devel >= 0.12.2 -BuildRequires: libuuid-devel -BuildRequires: ncurses-devel +# fixes tests build with ggc15. See gh/profanity#2055 +Patch1: https://github.com/profanity-im/profanity/commit/bda6dabbd972584b585620c66a31375ec0d6245d.patch#/profanity-0.15.0-Fix-tests-with-gcc15-uintptr_t.patch +BuildRequires: pkgconfig +# mandatory requirements +BuildRequires: pkgconfig(glib-2.0) >= 2.62 +BuildRequires: pkgconfig(libcurl) >= 7.62.0 +BuildRequires: pkgconfig(libstrophe) >= 0.12.3 +BuildRequires: pkgconfig(ncursesw) +BuildRequires: pkgconfig(sqlite3) >= 3.22.0 +%if 0%{?suse_version} >= 1600 +BuildRequires: pkgconfig(readline) +%endif +Conflicts: profanity-binary +Provides: profanity-binary = %{version} +# optional requirements +%if %{with notifications} +BuildRequires: pkgconfig(libnotify) +%endif +%if %{with python} BuildRequires: python3-devel -BuildRequires: readline-devel -BuildRequires: sqlite3-devel >= 3.22.0 -Requires: libstrophe0 >= 0.12.3 -Requires: profanity-binary = %{version} -Suggests: profanity-standard +%endif +%if %{with otr} +BuildRequires: pkgconfig(libotr) >= 4.0 +%endif +%if %{with gpg} +BuildRequires: pkgconfig(gpgme) +%endif +%if %{with omemo} +BuildRequires: pkgconfig(libgcrypt) >= 1.7.0 +BuildRequires: pkgconfig(libsignal-protocol-c) >= 2.3.2 +%endif +%if %{with xscreensaver} +BuildRequires: pkgconfig(xscrnsaver) +%endif +%if %{with icons} +BuildRequires: pkgconfig(gtk+-3.0) >= 3.24.0 +%endif +%if %{with scaled_avatars} +BuildRequires: pkgconfig(gdk-pixbuf-2.0) +%endif +%if %{with omemo_qrcode} +BuildRequires: pkgconfig(libqrencode) +%endif +# tests requirements +%if %{with tests} +BuildRequires: expect +BuildRequires: pkgconfig(cmocka) +%endif +%if "%{flavor}" == "" +Obsoletes: profanity-standard +%endif %description -Profanity is a console-based XMPP client written in C using ncurses, -and inspired by Irssi. - -%package mini -Summary: Console-based XMPP client -Group: Productivity/Networking/Instant Messenger -Requires: profanity = %{version} -Provides: profanity-binary = %{version}-%{release} -Conflicts: profanity-binary -Removepathpostfixes: .mini - -%description mini -Profanity is a console-based XMPP client written in C using ncurses, -and inspired by Irssi. +Profanity is a console-based XMPP client written in C using ncurses, and +inspired by Irssi. +%if "%{flavor}" == "mini" This package holds a minimal version, with most options not compiled in to have fewer dependencies. It is thus well suited for headless servers. +%endif -%package standard -Summary: Console-based XMPP client -Group: Productivity/Networking/Instant Messenger -Requires: profanity = %{version} -Provides: profanity-binary = %{version}-%{release} -Conflicts: profanity-binary -Removepathpostfixes: .standard +# only standard flavor builds the plugin library +%if "%{flavor}" == "" +%package -n libprofanity%{sover} +Summary: Shared library for the %{name} console-based XMPP client -%description standard -Profanity is a-console based XMPP client written in C using ncurses, -and inspired by Irssi. +%description -n libprofanity%{sover} +Profanity is a console-based XMPP client written in C using ncurses, and +inspired by Irssi. -This package holds the standard version. -Including: - * Desktop notifications (OSD) - * Tray icon +This package contains the shared library used by the profanity client and +plug-ins. + +%package devel +Summary: Development files for the libprofanity XMPP client library +Requires: libprofanity%{sover} = %{version} + +%description devel +Profanity is a console-based XMPP client written in C using ncurses, and +inspired by Irssi. + +This package contains the files needed to build with libprofanity. +%endif %prep -%autosetup -p1 +%autosetup -p1 -n %{sname}-%{version} sed -i -e "s/python-config/python3-config/g" configure %build -%configure PYTHON_VERSION=3 \ +%configure \ +%if %{with notifications} --enable-notifications \ - --with-themes \ - --enable-otr \ - --enable-pgp \ - --enable-omemo \ +%endif +%if %{with python} + PYTHON_VERSION=3 \ --enable-python-plugins \ +%endif --enable-c-plugins \ --enable-plugins \ - --enable-icons-and-clipboard - -export CFLAGS="%{optflags} -fcommon" +%if %{with otr} + --enable-otr \ +%endif +%if %{with gpg} + --enable-pgp \ +%endif +%if %{with omemo} + --enable-omemo \ +%endif +%if %{with xscreensaver} + --with-xscreensaver \ +%endif + --with-themes \ +%if %{with icons} + --enable-icons-and-clipboard \ +%endif +%if %{with scaled_avatars} + --enable-gdk-pixbuf \ +%endif +%if %{with omemo_qrcode} + --enable-omemo-qrcode \ +%endif + %{nil} %make_build %install %make_install -rm %{buildroot}%{_libdir}/libprofanity.la +find %{buildroot} -type f -name "*.la" -delete -print +%if "%{flavor}" == "mini" +rm %{buildroot}%{_includedir}/profapi.h +rm %{buildroot}%{_libdir}/libprofanity.so* +%endif -mv %{buildroot}%{_bindir}/profanity %{buildroot}%{_bindir}/profanity.standard +%check +%if %{with tests} +%make_build check +%endif -make clean - -%configure PYTHON_VERSION=3 \ - --disable-notifications \ - --with-themes \ - --enable-otr \ - --enable-pgp \ - --enable-omemo \ - --enable-python-plugins \ - --enable-c-plugins \ - --enable-plugins \ - --disable-icons-and-clipboard - -export CFLAGS="%{optflags} -fcommon" -make %{?_smp_mflags} -%make_install -rm %{buildroot}%{_libdir}/libprofanity.la - -mv %{buildroot}%{_bindir}/profanity %{buildroot}%{_bindir}/profanity.mini +# only standard flavor builds the plugin library +%if "%{flavor}" == "" +%ldconfig_scriptlets -n libprofanity%{sover} +%endif %files -%{_mandir}/man1/profanity.1%{?ext_man} -%{_mandir}/man1/profanity-*.1%{?ext_man} -%dir %{_datadir}/profanity/ -%dir %{_datadir}/profanity/themes/ -%dir %{_datadir}/profanity/icons/ -%{_datadir}/profanity/themes/* -%{_datadir}/profanity/icons/* -# for now we will have them here -%{_libdir}/libprofanity.so* +%license COPYING LICENSE.txt +%{_bindir}/profanity +%{_mandir}/man1/*1%{?ext_man} +%{_datadir}/profanity/ +# only standard flavor builds the plugin library +%if "%{flavor}" == "" +%files -n libprofanity%{sover} +%license COPYING LICENSE.txt +%{_libdir}/libprofanity.so.%{sover}{,.*} + +%files devel +%license COPYING LICENSE.txt %{_includedir}/profapi.h - -%files mini -%{_bindir}/profanity.mini - -%files standard -%{_bindir}/profanity.standard - -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig +%{_libdir}/libprofanity.so +%endif %changelog