| |
@@ -78,12 +78,6 @@
|
| |
Requires: python%{python_pkgversion}-wtforms
|
| |
%endif
|
| |
|
| |
- %if 0%{?rhel} && 0%{?rhel} < 8
|
| |
- Requires: mod_wsgi
|
| |
- %else
|
| |
- Requires: python%{python_pkgversion}-mod_wsgi
|
| |
- %endif
|
| |
-
|
| |
%{?systemd_requires}
|
| |
|
| |
# No dependency of the app per se, but required to make it working.
|
| |
@@ -97,6 +91,32 @@
|
| |
create/merge pull-requests across or within projects.
|
| |
|
| |
|
| |
+ %package web-apache-httpd
|
| |
+ Summary: Apache HTTPD configuration for Pagure
|
| |
+ BuildArch: noarch
|
| |
+ Requires: %{name} = %{version}-%{release}
|
| |
+ Requires: httpd-filesystem
|
| |
+ %if 0%{?rhel} && 0%{?rhel} < 8
|
| |
+ Requires: mod_wsgi
|
| |
+ %else
|
| |
+ Requires: python%{python_pkgversion}-mod_wsgi
|
| |
+ %endif
|
| |
+ %description web-apache-httpd
|
| |
+ This package provides the configuration files for deploying
|
| |
+ a Pagure server using the Apache HTTPD server.
|
| |
+
|
| |
+
|
| |
+ %package web-nginx
|
| |
+ Summary: Nginx configuration for Pagure
|
| |
+ BuildArch: noarch
|
| |
+ Requires: %{name} = %{version}-%{release}
|
| |
+ Requires: nginx-filesystem
|
| |
+ Requires: python%{python_pkgversion}-gunicorn
|
| |
+ %description web-nginx
|
| |
+ This package provides the configuration files for deploying
|
| |
+ a Pagure server using the Nginx web server.
|
| |
+
|
| |
+
|
| |
%package theme-pagureio
|
| |
Summary: Web interface theme used for Pagure.io
|
| |
BuildArch: noarch
|
| |
@@ -227,7 +247,11 @@
|
| |
|
| |
# Install apache configuration file
|
| |
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/
|
| |
- install -p -m 644 files/pagure.conf $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/pagure.conf
|
| |
+ install -p -m 644 files/pagure-apache-httpd.conf $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/pagure.conf
|
| |
+
|
| |
+ # Install nginx configuration file
|
| |
+ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/nginx/conf.d/
|
| |
+ install -p -m 644 files/pagure-nginx.conf $RPM_BUILD_ROOT/%{_sysconfdir}/nginx/conf.d/pagure.conf
|
| |
|
| |
# Install configuration file
|
| |
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/pagure
|
| |
@@ -258,6 +282,16 @@
|
| |
# Install the alembic revisions
|
| |
cp -r alembic $RPM_BUILD_ROOT/%{_datadir}/pagure
|
| |
|
| |
+ # Install the systemd file for the web frontend
|
| |
+ mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
|
| |
+ install -p -m 644 files/pagure_web.service \
|
| |
+ $RPM_BUILD_ROOT/%{_unitdir}/pagure_web.service
|
| |
+
|
| |
+ # Install the systemd file for the docs web frontend
|
| |
+ mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
|
| |
+ install -p -m 644 files/pagure_docs_web.service \
|
| |
+ $RPM_BUILD_ROOT/%{_unitdir}/pagure_docs_web.service
|
| |
+
|
| |
# Install the systemd file for the worker
|
| |
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
|
| |
install -p -m 644 files/pagure_worker.service \
|
| |
@@ -332,16 +366,32 @@
|
| |
sed -e "s|/usr/bin/python|%{__python}|g" -i $RPM_BUILD_ROOT/%{_unitdir}/*.service
|
| |
|
| |
%if 0%{?rhel} && 0%{?rhel} < 8
|
| |
- # Change to correct static file path for apache httpd
|
| |
- sed -e "s/pythonX.Y/python%{python2_version}/g" -i $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/pagure.conf
|
| |
+ # Change to correct static file path for apache httpd and nginx
|
| |
+ sed -e "s/pythonX.Y/python%{python2_version}/g" -i \
|
| |
+ $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/pagure.conf \
|
| |
+ $RPM_BUILD_ROOT/%{_sysconfdir}/nginx/conf.d/pagure.conf
|
| |
%else
|
| |
# Switch all systemd units to use the correct celery
|
| |
sed -e "s|/usr/bin/celery|/usr/bin/celery-3|g" -i $RPM_BUILD_ROOT/%{_unitdir}/*.service
|
| |
|
| |
- # Change to correct static file path for apache httpd
|
| |
- sed -e "s/pythonX.Y/python%{python3_version}/g" -i $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/pagure.conf
|
| |
+ # Switch all systemd units to use the correct gunicorn
|
| |
+ sed -e "s|/usr/bin/gunicorn|/usr/bin/gunicorn-3|g" -i $RPM_BUILD_ROOT/%{_unitdir}/*.service
|
| |
+
|
| |
+ # Change to correct static file path for apache httpd and nginx
|
| |
+ sed -e "s/pythonX.Y/python%{python3_version}/g" -i \
|
| |
+ $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/pagure.conf \
|
| |
+ $RPM_BUILD_ROOT/%{_sysconfdir}/nginx/conf.d/pagure.conf
|
| |
%endif
|
| |
|
| |
+ # Make log directories
|
| |
+ mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/log/pagure
|
| |
+ logfiles="web docs_web"
|
| |
+
|
| |
+ for logfile in $logfiles; do
|
| |
+ touch $RPM_BUILD_ROOT/%{_localstatedir}/log/pagure/access_${logfile}.log
|
| |
+ touch $RPM_BUILD_ROOT/%{_localstatedir}/log/pagure/error_${logfile}.log
|
| |
+ done
|
| |
+
|
| |
# Regenerate missing symlinks (really needed for upgrades from pagure < 5.0)
|
| |
runnerhooks="post-receive pre-receive"
|
| |
|
| |
@@ -355,6 +405,9 @@
|
| |
%systemd_post pagure_gitolite_worker.service
|
| |
%systemd_post pagure_api_key_expire_mail.timer
|
| |
%systemd_post pagure_mirror_project_in.timer
|
| |
+ %post web-nginx
|
| |
+ %systemd_post pagure_web.service
|
| |
+ %systemd_post pagure_docs_web.service
|
| |
%post milters
|
| |
%systemd_post pagure_milter.service
|
| |
%post ev
|
| |
@@ -375,6 +428,9 @@
|
| |
%systemd_preun pagure_gitolite_worker.service
|
| |
%systemd_preun pagure_api_key_expire_mail.timer
|
| |
%systemd_preun pagure_mirror_project_in.timer
|
| |
+ %preun web-nginx
|
| |
+ %systemd_preun pagure_web.service
|
| |
+ %systemd_preun pagure_docs_web.service
|
| |
%preun milters
|
| |
%systemd_preun pagure_milter.service
|
| |
%preun ev
|
| |
@@ -395,6 +451,9 @@
|
| |
%systemd_postun_with_restart pagure_gitolite_worker.service
|
| |
%systemd_postun pagure_api_key_expire_mail.timer
|
| |
%systemd_postun pagure_mirror_project_in.timer
|
| |
+ %postun web-nginx
|
| |
+ %systemd_postun_with_restart pagure_web.service
|
| |
+ %systemd_postun_with_restart pagure_docs_web.service
|
| |
%postun milters
|
| |
%systemd_postun_with_restart pagure_milter.service
|
| |
%postun ev
|
| |
@@ -414,12 +473,10 @@
|
| |
%files
|
| |
%doc README.rst UPGRADING.rst doc/
|
| |
%license LICENSE
|
| |
- %config(noreplace) %{_sysconfdir}/httpd/conf.d/pagure.conf
|
| |
%config(noreplace) %{_sysconfdir}/pagure/pagure.cfg
|
| |
%config(noreplace) %{_sysconfdir}/pagure/alembic.ini
|
| |
%dir %{_sysconfdir}/pagure/
|
| |
%dir %{_datadir}/pagure/
|
| |
- %config(noreplace) %{_datadir}/pagure/*.wsgi
|
| |
%{_datadir}/pagure/*.py*
|
| |
%if ! (0%{?rhel} && 0%{?rhel} < 8)
|
| |
%{_datadir}/pagure/__pycache__/
|
| |
@@ -440,6 +497,21 @@
|
| |
%{_unitdir}/pagure_mirror_project_in.timer
|
| |
|
| |
|
| |
+ %files web-apache-httpd
|
| |
+ %license LICENSE
|
| |
+ %config(noreplace) %{_sysconfdir}/httpd/conf.d/pagure.conf
|
| |
+ %config(noreplace) %{_datadir}/pagure/*.wsgi
|
| |
+
|
| |
+
|
| |
+ %files web-nginx
|
| |
+ %license LICENSE
|
| |
+ %config(noreplace) %{_sysconfdir}/nginx/conf.d/pagure.conf
|
| |
+ %{_unitdir}/pagure_web.service
|
| |
+ %{_unitdir}/pagure_docs_web.service
|
| |
+ %dir %{_localstatedir}/log/pagure
|
| |
+ %ghost %{_localstatedir}/log/pagure/*.log
|
| |
+
|
| |
+
|
| |
%files theme-pagureio
|
| |
%license LICENSE
|
| |
%{python_sitelib}/pagure/themes/pagureio/
|
| |
This change adds a working nginx configuration for Pagure using
nginx and gunicorn. In addition, to support Pagure deployments
using either configuration, the webserver configuration files
have been split out into their own subpackages.