Skip to content

Commit ad96dfc

Browse files
committed
feat(ci): Build Fedora RPMs with Packit
Signed-off-by: Benson Muite <benson_muite@emailplus.org>
1 parent 7049136 commit ad96dfc

2 files changed

Lines changed: 190 additions & 0 deletions

File tree

.packit.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
specfile_path: packaging/fedora/profanity.spec
2+
3+
notifications:
4+
pull_request:
5+
successful_build: true
6+
7+
jobs:
8+
- job: copr_build
9+
trigger: pull_request
10+
targets:
11+
- fedora-all

packaging/fedora/profanity.spec

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
Name: profanity
2+
Version: 0.18.1
3+
Release: %{autorelease}
4+
Summary: A console based XMPP client
5+
6+
License: GPL-3.0-or-later WITH cryptsetup-OpenSSL-exception
7+
URL: https://profanity-im.github.io/
8+
Source0: %{url}/tarballs/%{name}-%{version}.tar.xz
9+
10+
BuildRequires: gcc
11+
BuildRequires: meson
12+
# Base:
13+
BuildRequires: libstrophe-devel
14+
BuildRequires: ncurses-devel
15+
BuildRequires: glib2-devel
16+
BuildRequires: libcurl-devel
17+
BuildRequires: readline-devel
18+
BuildRequires: sqlite-devel
19+
BuildRequires: python-unversioned-command
20+
# Optional dependancies for support:
21+
# Desktop notification support
22+
BuildRequires: libnotify-devel
23+
# OTR support
24+
BuildRequires: libotr-devel
25+
# PGP support
26+
BuildRequires: gpgme-devel
27+
# OMEMO support
28+
BuildRequires: libsignal-protocol-c-devel
29+
# OMEMO support (>= 1.7)
30+
BuildRequires: libgcrypt-devel
31+
# Python plugin support
32+
BuildRequires: python3-devel
33+
# Support for display OMEMO QR code
34+
BuildRequires: qrencode-devel
35+
# Spell check support
36+
BuildRequires: enchant2-devel
37+
# Image loading
38+
BuildRequires: gdk-pixbuf2-devel
39+
# Icons
40+
BuildRequires: gtk3-devel
41+
# Screensaver, does not provide pkgconfig file
42+
BuildRequires: libXScrnSaver-devel
43+
# For tests:
44+
BuildRequires: libcmocka-devel
45+
# For docs:
46+
BuildRequires: doxygen
47+
BuildRequires: python3dist(docutils)
48+
BuildRequires: python3dist(sphinx)
49+
BuildRequires: texinfo
50+
51+
%description
52+
Profanity is a console based XMPP client written in C using ncurses
53+
and libstrophe, inspired by Irssi.
54+
55+
56+
57+
%package libs
58+
Summary: The shared libraries required for plugins of Profanity
59+
Requires: %{name}%{?_isa} = %{version}-%{release}
60+
61+
%description libs
62+
The %{name}-libs package provides the essential shared libraries for any
63+
plugin of Profanity written in C.
64+
65+
See: https://profanity-im.github.io/plugins.html
66+
67+
68+
69+
%package devel
70+
Summary: Development files for libraries used by plugins of Profanity
71+
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
72+
73+
%description devel
74+
The %{name}-devel package contains libraries and header files for
75+
developing plugins written in C for Profanity.
76+
77+
78+
79+
%package doc
80+
Summary: Documentation for %{name}
81+
BuildArch: noarch
82+
Requires: %{name} = %{version}-%{release}
83+
84+
%description doc
85+
The %{name}-doc package contains docbook documentation for developing
86+
applications that use %{name}.
87+
88+
89+
90+
%prep
91+
%autosetup
92+
# Output docbook instead of HTML
93+
sed -i "s/GENERATE_HTML = YES/GENERATE_HTML = NO/g" apidocs/c/c-prof.conf
94+
sed -i "s/GENERATE_DOCBOOK = NO/GENERATE_DOCBOOK = YES/g" apidocs/c/c-prof.conf
95+
sed -i "s/DOCBOOK_PROGRAMLISTING = NO/DOCBOOK_PROGRAMLISTING = YES/g" apidocs/c/c-prof.conf
96+
97+
%build
98+
%meson -Dnotifications=enabled \
99+
-Dpython-plugins=enabled \
100+
-Dc-plugins=enabled \
101+
-Dotr=enabled \
102+
-Dpgp=enabled \
103+
-Domemo=enabled \
104+
-Domemo-backend=libsignal \
105+
-Domemo-qrcode=enabled \
106+
-Dspellcheck=enabled \
107+
-Dicons-and-clipboard=enabled \
108+
-Dgdk-pixbuf=enabled \
109+
-Dxscreensaver=enabled \
110+
-Dtests=true
111+
%meson_build
112+
113+
# Build HTML documentation
114+
pushd apidocs/c/
115+
doxygen c-prof.conf # results are in apidocs/c/docbook/
116+
popd
117+
pushd apidocs/python/
118+
sphinx-apidoc -f -o . src
119+
make texinfo # results are in apidocs/python/_build/texinfo
120+
pushd _build
121+
pushd texinfo
122+
makeinfo --docbook ProfanityPythonPluginsAPI.texi
123+
popd
124+
popd
125+
popd
126+
127+
128+
%install
129+
%meson_install
130+
# Remove libprofanity.la generated
131+
rm -f %{buildroot}%{_libdir}/libprofanity.la
132+
133+
# Install docbook documentation for the doc subpackage
134+
mkdir -p %{buildroot}%{_datadir}/help/en/profanity/
135+
for file in apidocs/c/docbook/*.xml;
136+
do
137+
install -m644 ${file} \
138+
%{buildroot}%{_datadir}/help/en/profanity
139+
done
140+
install -m644 apidocs/python/_build/texinfo/ProfanityPythonPluginsAPI.xml \
141+
%{buildroot}%{_datadir}/help/en/profanity
142+
143+
# Install example config file
144+
cp -a profrc.example %{buildroot}%{_datadir}/%{name}/
145+
146+
147+
%check
148+
%meson_test "unit tests"
149+
150+
151+
152+
%files
153+
%license COPYING LICENSE.txt
154+
%doc CHANGELOG README.md
155+
%{_bindir}/%{name}
156+
%{_mandir}/man1/%{name}.*
157+
%{_mandir}/man1/%{name}-*
158+
%{_datadir}/%{name}/
159+
%dir %{_docdir}/profanity
160+
%{_docdir}/profanity/profrc.example
161+
%{_docdir}/profanity/theme_template
162+
163+
%files libs
164+
%{_libdir}/libprofanity.so.0{,.*}
165+
166+
167+
%files devel
168+
%{_libdir}/libprofanity.so
169+
%{_includedir}/profapi.h
170+
171+
172+
%files doc
173+
%dir %{_datadir}/help/en
174+
%lang(en) %{_datadir}/help/en/profanity
175+
176+
177+
178+
%changelog
179+
%autochangelog

0 commit comments

Comments
 (0)