1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2025-01-10 09:52:41 +00:00
Arsse/dist/rpm/arsse.spec

182 lines
6.8 KiB
RPMSpec
Raw Normal View History

2021-07-14 17:43:30 +00:00
Name: arsse
Version: 0.10.0
Release: 0
Summary: Multi-protocol RSS/Atom newsfeed synchronization server
License: MIT
Group: Productivity/Networking/Web/Utilities
URL: https://thearsse.com/
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
%define minphpver 7.1
%define arssepath %{_datadir}/php/arsse
%define socketpath %{_rundir}/php-fpm/arsse.sock
2021-07-14 17:43:30 +00:00
Requires: php >= %{minphpver}
2021-07-25 21:16:46 +00:00
Requires: php-intl php-dom php-posix php-pcntl
Requires: php-simplexml php-iconv
2021-07-14 13:23:14 +00:00
# This is usually compiled in
2021-07-14 17:43:30 +00:00
Requires: php-filter
2021-07-14 13:23:14 +00:00
# The below extensions are part of the PHP core in recent versions
2021-07-25 21:16:46 +00:00
Requires: php-hash php-json
2021-07-19 01:55:47 +00:00
# A database option is required
Requires: (php-sqlite or php-pgsql)
# User and Group
Requires: user(arsse) group(arsse)
%systemd_requires
2021-07-14 13:23:14 +00:00
2021-07-19 01:55:47 +00:00
Recommends: php-sqlite
2021-07-14 17:43:30 +00:00
Suggests: php-curl
2021-07-19 01:55:47 +00:00
Suggests: (php-pgsql if postgresql-server)
2021-07-14 21:24:38 +00:00
Obsoletes: arsse < %{version}
BuildRequires: systemd-rpm-macros
2021-07-25 21:16:46 +00:00
BuildRequires: apache-rpm-macros
BuildRequires: sysuser-tools
2021-07-14 13:23:14 +00:00
%description
The Arsse bridges the gap between multiple existing newsfeed aggregator
client protocols such as Tiny Tiny RSS, Nextcloud News and Miniflux,
allowing you to use compatible clients for many protocols with a single
server.
2021-07-22 03:06:41 +00:00
%package config-fpm
Summary: PHP-FPM process pool configuration for The Arsse
Group: Productivity/Networking/Web/Utilities
Requires: php-fpm >= %{minphpver}
2021-07-22 03:06:41 +00:00
Requires: %{name} = %{version}-%{release}
Provides: arsse-config-fpm = %{version}
Obsoletes: arsse-config-fpm < %{version}
Supplements: packageand(php-fpm:arsse)
2021-07-25 21:16:46 +00:00
%description config-fpm
2021-07-22 03:06:41 +00:00
PHP-FPM process pool configuration for The Arsse
%package config-nginx-fpm
2021-07-14 17:43:30 +00:00
Summary: Nginx Web server configuration for The Arsse using PHP-FPM
Group: Productivity/Networking/Web/Utilities
2021-07-22 03:06:41 +00:00
Requires: arsse-fpm
2021-07-14 17:43:30 +00:00
Requires: nginx
Requires: %{name} = %{version}-%{release}
Provides: arsse-config-nginx-fpm = %{version}
Obsoletes: arsse-config-nginx-fpm < %{version}
Supplements: packageand(apache2:arsse)
2021-07-14 17:43:30 +00:00
2021-07-16 20:15:28 +00:00
%description config-nginx-fpm
Nginx Web server configuration for The Arsse using PHP-FPM. Using Ngix is
generally preferred as it receives more testing.
%package config-apache-fpm
2021-07-14 17:43:30 +00:00
Summary: Apache Web server configuration for The Arsse using PHP-FPM
Group: Productivity/Networking/Web/Utilities
2021-07-22 03:06:41 +00:00
Requires: arsse-fpm
2021-07-14 17:43:30 +00:00
Requires: %{name} = %{version}-%{release}
2021-07-25 21:16:46 +00:00
Requires: apache2 >= 2.4
Provides: arsse-config-apache-fpm = %{version}
Obsoletes: arsse-config-apache-fpm < %{version}
Supplements: packageand(apache2:arsse)
2021-07-14 21:24:38 +00:00
2021-07-16 20:15:28 +00:00
%description config-apache-fpm
Apache Web server configuration for The Arsse using PHP-FPM. Using Ngix is
generally preferred as it receives more testing.
%package -n system-user-arsse
Summary: System user and group arsse
Group: System/Fhs
%{sysusers_requires}
%description -n system-user-arsse
This package provides the system account and group 'arsse'.
2021-07-14 21:24:38 +00:00
%prep
%setup -q -n %{name}
# Patch the executable so it does not use env as the interpreter; RPMLint complains about this
sed -i -se 's|/usr/bin/env php|{_bindir}/php|' dist/arsse
# Remove stray executable
rm -f vendor/nicolus/picofeed/picofeed
2021-07-25 21:16:46 +00:00
# Patch the systemd unit file to remove the binding to the PHP-FPM service
sed -i -se 's|^PartOf=.*||' dist/systemd/arsse-fetch.service
# Patch PHP-FPM pool and Web server configuration with correct socket path
sed -i -se 's|/var/run/php/arsse\.sock|%{socketpath}|' dist/php-fpm.conf dist/nginx/* dist/apache/*
# Patch various files to adjust installation path
sed -i -se 's|/usr/share/arsse/|%{arssepath}/|' dist/arsse dist/nginx/* dist/apache/* dist/tmpfiles.conf
sed -i -se 's|/usr/share/arsse|%{arssepath}|' dist/systemd/arsse-fetch.service
# Patch configuration files to adjust other paths (they're probably already correct)
sed -i -se 's|/etc/arsse/|%{_sysconfdir}/arsse/|' dist/nginx/* dist/apache/* dist/tmpfiles.conf
sed -i -se 's|/usr/bin/|%{_bindir}/|' dist/systemd/arsse-fetch.service
sed -i -se 's|/var/lib|%{_sharedstatedir}|' dist/systemd/arsse-fetch.service dist/tmpfiles.conf dist/config.php
# Patch Web server configuration to use unique hostname; "news" is recommended, but might conflict with other example configuration
sed -i -se 's|news.example.com|arsse.example.com|' dist/nginx/* dist/apache/*
2021-07-14 21:24:38 +00:00
%build
%sysusers_generate_pre dist/sysuser.conf arsse system-user-arsse.conf
2021-07-14 21:24:38 +00:00
%install
mkdir -p "%{buildroot}%{_mandir}" "%{buildroot}%{_unitdir}" "%{buildroot}%{_sysusersdir}" "%{buildroot}%{_tmpfilesdir}" "%{buildroot}%{_bindir}" "%{buildroot}%{_sysconfdir}/arsse"
mkdir -p "%{buildroot}%{arssepath}" "%{buildroot}%{_sysconfdir}/arsse/nginx" "%{buildroot}%{_sysconfdir}/arsse/apache"
cp -r lib locale sql vendor www CHANGELOG UPGRADING README.md arsse.php "%{buildroot}%{arssepath}"
2021-07-16 23:20:07 +00:00
cp -r dist/man/* "%{buildroot}%{_mandir}"
2021-07-17 00:29:57 +00:00
cp dist/systemd/arsse-fetch.service "%{buildroot}%{_unitdir}/arsse.service"
2021-07-25 21:16:46 +00:00
install -D dist/php-fpm.conf "%{buildroot}%{_sysconfdir}/php7/fpm/php-fpm.d/arsse.conf"
install -D dist/php-fpm.conf "%{buildroot}%{_sysconfdir}/php8/fpm/php-fpm.d/arsse.conf"
install dist/nginx/arsse* "%{buildroot}%{_sysconfdir}/arsse/nginx"
install dist/apache/arsse* "%{buildroot}%{_sysconfdir}/arsse/apache"
install dist/sysuser.conf "%{buildroot}%{_sysusersdir}/system-user-arsse.conf"
install dist/tmpfiles.conf "%{buildroot}%{_tmpfilesdir}/arsse.conf"
install config.defaults.php "%{buildroot}%{_sysconfdir}/arsse"
install -m 640 dist/config.php "%{buildroot}%{_sysconfdir}/arsse/config.php"
install -m 755 dist/arsse "%{buildroot}%{_bindir}/arsse"
2021-07-16 23:20:07 +00:00
%files
2021-07-18 02:00:00 +00:00
%dir %{_datadir}/php
%dir %{_sysconfdir}/arsse
%{arssepath}
%{_sysconfdir}/arsse/config.php
%{_sysconfdir}/arsse/config.defaults.php
2021-07-16 23:20:07 +00:00
%{_mandir}/man*/arsse.*
2021-07-17 00:29:57 +00:00
%{_unitdir}/arsse.service
%{_tmpfilesdir}/arsse.conf
2021-07-30 14:14:01 +00:00
%attr(755, root, root) %{_bindir}/arsse
%license LICENSE AUTHORS
%doc manual/*
%files config-fpm
%dir %{_sysconfdir}/php7
%dir %{_sysconfdir}/php8
%dir %{_sysconfdir}/php7/fpm
%dir %{_sysconfdir}/php8/fpm
%dir %{_sysconfdir}/php7/fpm/php-fpm.d
%dir %{_sysconfdir}/php8/fpm/php-fpm.d
2021-07-25 21:16:46 +00:00
%{_sysconfdir}/php7/fpm/php-fpm.d/arsse.conf
%{_sysconfdir}/php8/fpm/php-fpm.d/arsse.conf
2021-07-22 03:06:41 +00:00
%files config-nginx-fpm
%dir %{_sysconfdir}/arsse
%dir %{_sysconfdir}/arsse/nginx
%{_sysconfdir}/arsse/nginx/arsse*
%files config-apache-fpm
%dir %{_sysconfdir}/arsse
%dir %{_sysconfdir}/arsse/apache
%{_sysconfdir}/arsse/apache/arsse*
%files -n system-user-arsse
%{_sysusersdir}/system-user-arsse.conf
%pre
%service_add_pre arsse.service arsse.service
%post
%tmpfiles_create "%{_tmpfilesdir}/arsse.conf"
%service_add_post arsse.service arsse.service
%preun
%service_del_preun arsse.service
%postun
%service_del_postun arsse.service
%service_del_postun_without_restart arsse.service
2021-07-19 01:55:47 +00:00
%pre -n system-user-arsse -f arsse.pre