SHA256
4
0
forked from pool/profanity

WIP: general spec file rework #1

Closed
AndreasStieger wants to merge 2 commits from (deleted):gpgme into main
4 changed files with 258 additions and 100 deletions

View File

@@ -0,0 +1,128 @@
From 9f2abc75ad27d3dcc951b8fc5aa922bdbe76f287 Mon Sep 17 00:00:00 2001
From: Andreas Stieger <Andreas.Stieger@gmx.de>
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 <stdint.h>
---
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 <stdarg.h>
#include <stddef.h>
+#include <stdint.h>
#include <setjmp.h>
#include <cmocka.h>
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 <stdint.h>
#include <glib.h>
#include <setjmp.h>
#include <cmocka.h>
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 <glib.h>
#include <stdarg.h>
#include <stddef.h>
+#include <stdint.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
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 <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
+#include <stdint.h>
#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 <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
+#include <stdint.h>
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 <stdarg.h>
#include <stddef.h>
+#include <stdint.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
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 <stdarg.h>
#include <stddef.h>
+#include <stdint.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
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 <stdarg.h>
#include <stddef.h>
+#include <stdint.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
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 <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
+#include <stdint.h>
#include "xmpp/contact.h"
#include "xmpp/roster_list.h"
--
2.50.1

View File

@@ -1,6 +0,0 @@
# We created the-mini and -standard packages.

I'm not really sure we need to split this out in a own lib if its only used by profanity.

I'm not really sure we need to split this out in a own lib if its only used by profanity.

Yes this will address boo#1246851 when done.

I understand that the library is for the plug-ins. So if we split the lib then the plugins can be built with a reduced dependency set, and specifically without also having the client installed.

Yes this will address boo#1246851 when done. I understand that the library is for the plug-ins. So if we split the lib then the plugins can be built with a reduced dependency set, and specifically without also having the client installed.
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")

View File

@@ -1,3 +1,15 @@
-------------------------------------------------------------------
Mon Jul 28 16:55:11 UTC 2025 - Andreas Stieger <andreas.stieger@gmx.de>
- reworked spec file to wrap bcond around optional dependencies
- split the library and -devel packages
- enable xscreensaver awareness, use gtk3
- run some tests
- package the license files
- disable gpg support boo#1246850
- add profanity-0.15.0-Fix-tests-with-gcc15-uintptr_t.patch
to fix tests with gcc15
-------------------------------------------------------------------
Wed Jul 23 07:04:12 UTC 2025 - Michael Vetter <mvetter@suse.com>

View File

@@ -2,6 +2,7 @@
# spec file for package profanity
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 Andreas Stieger <Andreas.Stieger@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +17,17 @@
#
%define sover 0
%bcond_without notifications
%bcond_without python
%bcond_without otr
%bcond_without gpg
%bcond_without omemo
AndreasStieger marked this conversation as resolved Outdated

disable gpg support boo#1246850 isn't necessary anymore.

`disable gpg support boo#1246850` isn't necessary anymore.

yes I saw the parallel change

yes I saw the parallel change
%bcond_without xscreensaver
%bcond_without icons
%bcond_without scaled_avatars
%bcond_without omemo_qrcode
%bcond_without tests
Name: profanity
Version: 0.15.0
Release: 0
@@ -24,129 +36,141 @@ 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
# https://github.com/profanity-im/profanity/pull/2055
Patch1: 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(readline)
BuildRequires: pkgconfig(sqlite3) >= 3.22.0
# 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
%description
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.
%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
%package -n libprofanity%{sover}
Summary: Shared library for the %{name} console-based XMPP client
%description mini
Profanity is a console-based XMPP client written in C using ncurses,
and inspired by Irssi.
This package holds a minimal version, with most options not compiled
in to have fewer dependencies. It is thus well suited for headless
servers.
%description -n libprofanity%{sover}
Profanity is a console-based XMPP client written in C using ncurses, and
inspired by Irssi.
%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
This package contains the shared library used by the profanity client and
plug-ins.
%description standard
Profanity is a-console based XMPP client written in C using ncurses,
and inspired by Irssi.
%package devel
Summary: Development files for the libprofanity XMPP client library
Requires: libprofanity%{sover} = %{version}
This package holds the standard version.
Including:
* Desktop notifications (OSD)
* Tray icon
%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.
%prep
%autosetup -p1
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
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
%ldconfig_scriptlets -n libprofanity%{sover}
%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/
%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
%changelog