diff --git a/SPECS/openlitespeed.spec b/SPECS/openlitespeed.spec index 6e76c42..59db68d 100644 --- a/SPECS/openlitespeed.spec +++ b/SPECS/openlitespeed.spec @@ -1,8 +1,8 @@ %global _lsws_dir %{_prefix}/lsws -Name: openlitespeed -Version: 1.8.2 -Release: 1%{?dist} +Name: openlitespeed +Version: 1.8.2 +Release: 2%{?dist} Summary: Open source HTTP server developed and copyrighted by LiteSpeed Technologies. License: GPLv3+ Url: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -30,9 +30,7 @@ BuildRequires: libaio-devel BuildRequires: doxygen BuildRequires: docbook2X -%if 0%{?systemd_requires} Requires: systemd -%endif %description OpenLiteSpeed is a high-performance, lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies. @@ -106,29 +104,24 @@ rm -f %{buildroot}%{_lsws_dir}/admin/misc/lsws.rc.gentoo %pre -if [ $1 -gt 1 ] ; then - getent group lsadm > /dev/null || groupadd -r lsadm lsadm_gid=`grep ^lsadm: /etc/group | awk -F : '{ print $3; }'` >/dev/null 2>&1 -getent passwd lsadm > /dev/null || useradd -g $lsadm_gid -d / -r -s /sbin/nologin -c "lsadm" lsadm >/dev/null 2>&1 +getent passwd lsadm > /dev/null || useradd -g lsadm -d %{_lsws_dir} -r -s /sbin/nologin -c "lsadm" lsadm >/dev/null 2>&1 usermod -G lsadm,nobody lsadm >/dev/null 2>&1 exit 0 -fi - %preun -if [ $1 -gt 0 ] ; then -%systemd_preun lsws -fi +%systemd_preun lsws.service %postun -if [ $1 -gt 0 ] ; then +if [ $1 -eq 0 ] ; then userdel lsadm -%systemd_postun lsws fi +%systemd_postun lsws.service %post -if [ $1 -gt 1 ] ; then +%systemd_post lsws.service +if [ $1 -eq 1 ] ; then DEFAULT_USER="nobody" DEFAULT_GROUP="nobody" @@ -239,17 +232,14 @@ chown lsadm.lsadm %{sslcert}; chmod 400 %{sslcert}; chown lsadm.lsadm %{sslkey}; chmod 400 %{sslkey}; ln -sf %{_lsws_dir}/fcgi-bin/lsphp5 %{_lsws_dir}/fcgi-bin/lsphp -%systemd_post lsws - echo "To change admin password run /usr/lsws/admin/misc/admpass.sh script" echo "To start the openlitespeed server, run the command: systemctl start lsws" - fi %files -%{_unitdir}/lsws.service %doc README.md +%{_unitdir}/lsws.service %dir %{_lsws_dir} %{_lsws_dir}/* %config(noreplace) %{_lsws_dir}/conf/* @@ -267,6 +257,10 @@ fi %{_lsws_dir}/modules/mod_lua.so %changelog +* Tue Oct 8 2024 Arkady L. Shane - 1.8.2-2 +- Fix scripts conditions +- Clean up spec + * Wed Sep 18 2024 Eduard Basov - 1.8.2-1 - Rebuild for MSVSphere 9.4