diff --git a/dist/rpm/arsse.spec b/dist/rpm/arsse.spec index 23de66f4..304cbc14 100644 --- a/dist/rpm/arsse.spec +++ b/dist/rpm/arsse.spec @@ -8,9 +8,11 @@ URL: https://thearsse.com/ Source0: %{name}-%{version}.tar.gz BuildArch: noarch -%define minver 7.1 +%define minphpver 7.1 +%define arssepath %{_datadir}/php/arsse +%define socketpath %{_rundir}/php-fpm/arsse.sock -Requires: php >= %{minver} +Requires: php >= %{minphpver} Requires: php-intl php-dom php-posix php-pcntl Requires: php-simplexml php-iconv # This is usually compiled in @@ -42,7 +44,7 @@ server. %package config-fpm Summary: PHP-FPM process pool configuration for The Arsse Group: Productivity/Networking/Web/Utilities -Requires: php-fpm >= %{minver} +Requires: php-fpm >= %{minphpver} Requires: %{name} = %{version}-%{release} Provides: arsse-config-fpm = %{version} Obsoletes: arsse-config-fpm < %{version} @@ -90,38 +92,47 @@ This package provides the system account and group 'arsse'. %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 +sed -i -se 's|/usr/bin/env php|{_bindir}/php|' dist/arsse # Remove stray executable rm -f vendor/nicolus/picofeed/picofeed -# Patch PHP-FPM pool with correct socket path -sed -i -se 's /var/run/php/arsse\.sock %{_rundir}/php-fpm/arsse.sock ' dist/php-fpm.conf # Patch the systemd unit file to remove the binding to the PHP-FPM service -sed -i -se 's ^PartOf=.* ' dist/systemd/arsse-fetch.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/* +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/* +sed -i -se 's|/usr/bin/|%{_bindir}/|' dist/systemd/arsse-fetch.service +# 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/* %build %sysusers_generate_pre dist/sysuser.conf arsse system-user-arsse.conf %install mkdir -p "%{buildroot}%{_mandir}" "%{buildroot}%{_unitdir}" "%{buildroot}%{_sysusersdir}" "%{buildroot}%{_bindir}" "%{buildroot}%{_sysconfdir}/arsse" -mkdir -p "%{buildroot}%{_datadir}/php/arsse" "%{buildroot}%{_sysconfdir}/arsse/nginx" "%{buildroot}%{_sysconfdir}/arsse/apache" -cp -r lib locale sql vendor www CHANGELOG UPGRADING README.md arsse.php "%{buildroot}%{_datadir}/php/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}" cp -r dist/man/* "%{buildroot}%{_mandir}" cp dist/systemd/arsse-fetch.service "%{buildroot}%{_unitdir}/arsse.service" 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/* "%{buildroot}%{_sysconfdir}/arsse/nginx -#install dist/apache/* "%{buildroot}%{_sysconfdir}/arsse/apache +install dist/nginx/arsse* "%{buildroot}%{_sysconfdir}/arsse/nginx" +install dist/apache/arsse* "%{buildroot}%{_sysconfdir}/arsse/apache" install -m 755 dist/arsse "%{buildroot}%{_bindir}/arsse" install -m 644 dist/sysuser.conf %{buildroot}%{_sysusersdir}/system-user-arsse.conf %files %dir %{_datadir}/php -%license LICENSE AUTHORS -%doc manual/* -%{_datadir}/php/arsse +%dir %{_sysconfdir}/arsse +%{arssepath} %{_mandir}/man*/arsse.* %{_unitdir}/arsse.service %attr(755, root, root) %{_bindir}/arsse +%license LICENSE AUTHORS +%doc manual/* %files config-fpm %dir %{_sysconfdir}/php7 @@ -133,6 +144,16 @@ install -m 644 dist/sysuser.conf %{buildroot}%{_sysusersdir}/system-user-arsse.c %{_sysconfdir}/php7/fpm/php-fpm.d/arsse.conf %{_sysconfdir}/php8/fpm/php-fpm.d/arsse.conf +%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