forked from pool/python-HyperKitty
Accepting request 1150191 from openSUSE:infrastructure:mailman3
- Split out system user (needed for other packages shipping directories/files owned by hyperkitty) and switch to sysusers - Build for Python 3.12 (to restore compatibility with Mailman) OBS-URL: https://build.opensuse.org/request/show/1150191 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:mailman/python-HyperKitty?expand=0&rev=76
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Feb 24 20:34:06 UTC 2024 - Georg Pfuetzenreuter <mail+rpm@georg-pfuetzenreuter.net>
|
||||||
|
|
||||||
|
- Split out system user
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Feb 23 22:20:00 UTC 2024 - Georg Pfuetzenreuter <mail+rpm@georg-pfuetzenreuter.net>
|
Fri Feb 23 22:20:00 UTC 2024 - Georg Pfuetzenreuter <mail+rpm@georg-pfuetzenreuter.net>
|
||||||
|
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
%global webapps_dir /srv/www/webapps
|
%global webapps_dir /srv/www/webapps
|
||||||
|
|
||||||
%global hyperkitty_pkgname HyperKitty
|
%global hyperkitty_pkgname HyperKitty
|
||||||
|
%global lowname hyperkitty
|
||||||
|
|
||||||
%global hyperkitty_basedir %{webapps_dir}/mailman/hyperkitty
|
%global hyperkitty_basedir %{webapps_dir}/mailman/hyperkitty
|
||||||
%global hyperkitty_localedir %{hyperkitty_basedir}/locale
|
%global hyperkitty_localedir %{hyperkitty_basedir}/locale
|
||||||
@@ -182,8 +183,7 @@ Requires: %{hyperkitty_pkgname}
|
|||||||
Requires: acl
|
Requires: acl
|
||||||
Requires: openssl
|
Requires: openssl
|
||||||
Requires: sudo
|
Requires: sudo
|
||||||
Requires(pre): /usr/sbin/groupadd
|
Requires: system-user-%{lowname}
|
||||||
Requires(pre): /usr/sbin/useradd
|
|
||||||
|
|
||||||
%description -n %{hyperkitty_pkgname}-web
|
%description -n %{hyperkitty_pkgname}-web
|
||||||
A web user interface for GNU Mailman.
|
A web user interface for GNU Mailman.
|
||||||
@@ -204,6 +204,15 @@ A web user interface for GNU Mailman.
|
|||||||
|
|
||||||
This package holds the uwsgi configuration.
|
This package holds the uwsgi configuration.
|
||||||
|
|
||||||
|
%package -n system-user-%{lowname}
|
||||||
|
Summary: System user for HyperKitty
|
||||||
|
BuildArch: noarch
|
||||||
|
BuildRequires: sysuser-tools
|
||||||
|
%sysusers_requires
|
||||||
|
|
||||||
|
%description -n system-user-%{lowname}
|
||||||
|
System user for HyperKitty.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -n HyperKitty-%{version}
|
%setup -n HyperKitty-%{version}
|
||||||
cp %{SOURCE30} .
|
cp %{SOURCE30} .
|
||||||
@@ -214,6 +223,10 @@ rsync -a example_project/* build_static_files
|
|||||||
|
|
||||||
%autopatch -p1
|
%autopatch -p1
|
||||||
|
|
||||||
|
tee > %{lowname}.sysuser <<EOF
|
||||||
|
u %{lowname} - "HyperKitty" %{hyperkitty_basedir} -
|
||||||
|
EOF
|
||||||
|
|
||||||
%build
|
%build
|
||||||
sed -i 's|^#!/usr/bin/env.*|#!%{__mypython}|' \
|
sed -i 's|^#!/usr/bin/env.*|#!%{__mypython}|' \
|
||||||
example_project/manage.py
|
example_project/manage.py
|
||||||
@@ -227,6 +240,8 @@ export PYTHONPATH=$(pwd)
|
|||||||
%python_exec build_static_files/manage.py collectstatic --clear --noinput
|
%python_exec build_static_files/manage.py collectstatic --clear --noinput
|
||||||
%python_exec build_static_files/manage.py compress --force
|
%python_exec build_static_files/manage.py compress --force
|
||||||
|
|
||||||
|
%sysusers_generate_pre %{lowname}.sysuser %{lowname}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
install -d -m 0750 \
|
install -d -m 0750 \
|
||||||
%{buildroot}%{hyperkitty_etcdir} \
|
%{buildroot}%{hyperkitty_etcdir} \
|
||||||
@@ -276,7 +291,7 @@ ln -svf %{hyperkitty_etcdir}/settings_local.py \
|
|||||||
|
|
||||||
# Manage script
|
# Manage script
|
||||||
install -d -m 0755 %{buildroot}%{_sbindir}
|
install -d -m 0755 %{buildroot}%{_sbindir}
|
||||||
install -m 0750 %{SOURCE10} %{buildroot}%{_sbindir}/hyperkitty-manage
|
install -m 0755 %{SOURCE10} %{buildroot}%{_sbindir}/hyperkitty-manage
|
||||||
|
|
||||||
install -d -m 0755 %{buildroot}%{_sysconfdir}/uwsgi/vassals
|
install -d -m 0755 %{buildroot}%{_sysconfdir}/uwsgi/vassals
|
||||||
install -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/uwsgi/vassals/hyperkitty.ini
|
install -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/uwsgi/vassals/hyperkitty.ini
|
||||||
@@ -316,6 +331,8 @@ for job in \
|
|||||||
sed -i "s#@HYPERKITTY_RUNJOB@#${hyperkitty_runjob_name}#g" %{buildroot}%{_unitdir}/hyperkitty-runjob-${job}.timer
|
sed -i "s#@HYPERKITTY_RUNJOB@#${hyperkitty_runjob_name}#g" %{buildroot}%{_unitdir}/hyperkitty-runjob-${job}.timer
|
||||||
done
|
done
|
||||||
|
|
||||||
|
install -Dm644 %{lowname}.sysuser %{buildroot}%{_sysusersdir}/%{lowname}.conf
|
||||||
|
|
||||||
%if %{with testuite}
|
%if %{with testuite}
|
||||||
%check
|
%check
|
||||||
export PYTHONPATH="$(pwd)"
|
export PYTHONPATH="$(pwd)"
|
||||||
@@ -324,11 +341,10 @@ export LANG=C.UTF-8
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%pre -n %{hyperkitty_pkgname}-web
|
%pre -n %{hyperkitty_pkgname}-web
|
||||||
/usr/sbin/groupadd -r hyperkitty || :
|
|
||||||
/usr/sbin/useradd -g hyperkitty -s /bin/false -r -c "HyperKitty" -d %{hyperkitty_basedir} hyperkitty || :
|
|
||||||
|
|
||||||
%service_add_pre %{hyperkitty_services}
|
%service_add_pre %{hyperkitty_services}
|
||||||
|
|
||||||
|
%pre -n system-user-%{lowname} -f %{lowname}.pre
|
||||||
|
|
||||||
%post -n %{hyperkitty_pkgname}-web
|
%post -n %{hyperkitty_pkgname}-web
|
||||||
# We need a SECRET_KEY for manage to work
|
# We need a SECRET_KEY for manage to work
|
||||||
if ! grep -q "^SECRET_KEY.*" %{hyperkitty_etcdir}/settings_local.py; then
|
if ! grep -q "^SECRET_KEY.*" %{hyperkitty_etcdir}/settings_local.py; then
|
||||||
@@ -402,4 +418,7 @@ fi
|
|||||||
%dir %{_sysconfdir}/uwsgi/vassals
|
%dir %{_sysconfdir}/uwsgi/vassals
|
||||||
%config (noreplace) %{_sysconfdir}/uwsgi/vassals/hyperkitty.ini
|
%config (noreplace) %{_sysconfdir}/uwsgi/vassals/hyperkitty.ini
|
||||||
|
|
||||||
|
%files -n system-user-%{lowname}
|
||||||
|
%{_sysusersdir}/%{lowname}.conf
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Reference in New Issue
Block a user