@ -1,9 +1,9 @@
Name: openlitespeed
Version: 1.8.2
Release: 1%{?dist}
Summary: OpenLiteSpeed is a high-performance, lightweight, o pen source HTTP server developed and copyrighted by LiteSpeed Technologies.
Summary: O pen source HTTP server developed and copyrighted by LiteSpeed Technologies.
License: GNU General Public License v3.0
Url: https://github.com/litespeedtech/openlitespeed
Url: https://github.com/litespeedtech/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source0: %{name}.tar.xz
Source1: third-party.tar.xz
@ -25,58 +25,52 @@ BuildRequires: docbook2X
%description
OpenLiteSpeed is a high-performance, lightweight, open source HTTP server developed and copyrighted by LiteSpeed Technologies.
%package -n ols-lua
Group: Application/WebServer
%package -n %{name}-lua
Summary: Lua
Requires: openlitespeed == %{version}
Requires: openlitespeed = %{version}-%{release}
%description -n ols -lua
%description -n %{name} -lua
Mod Lua module for openlitespeed webserver.
%package -n ols-pagespeed
Group: Application/WebServer
%package -n %{name}-pagespeed
Summary: Pagespeed
Requires: openlitespeed == %{version}
Requires: openlitespeed = %{version}-%{release}
%description -n ols -pagespeed
%description -n %{name} -pagespeed
Pagespeed module for openlitespeed webserver.
%package -n ols-modsecurity
Group: Application/WebServer
%package -n %{name}-modsecurity
Summary: Mod Security
Requires: openlitespeed == %{version}
Requires: openlitespeed = %{version}-%{release}
%description -n ols -modsecurity
%description -n %{name} -modsecurity
Mod Security for openlitespeed webserver.
%prep
tar -xpaf %{_sourcedir}/openlitespeed.tar.xz -C %{_builddir}
#mv %{_builddir}/openlitespeed-1.8.2-1/openlitespeed/ %{_builddir}
#rm -rf %{_builddir}/openlitespeed-1.8.2-1
tar -xpaf %{_sourcedir}/third-party.tar.xz -C %{_builddir}
%autosetup -n %{name} -b1
%build
sh -x e %{_builddir}/openlitespeed/ build.sh
sh -e build.sh
%install
install -m 755 -d %{buildroot}/usr/lsws
rm -rf %{_builddir}/openlitespeed/ dist/ols.conf
buildroot_path=$(rpm --eval "%{buildroot}")
sed -i -e 's:USE_LSPHP7=yes:USE_LSPHP7=no:g' %{_builddir}/openlitespeed/ dist/install.sh
sed -i -e "s:SERVERROOT=/usr/lsws:SERVERROOT=$buildroot_path/usr/lsws:g" %{_builddir}/openlitespeed/ dist/install.sh
sed -i -e 's:OPENLSWS_ADMINSSL=yes:OPENLSWS_ADMINSSL=no:g' %{_builddir}/openlitespeed/ dist/install.sh
sed -i -e 's:ln -sf "$LSWS_HOME/fcgi-bin/lsphp5" "$LSWS_HOME/fcgi-bin/lphp":cd $LSWS_HOME/fcgi-bin/; ln -sf lsphp5 ./lsphp; cd -:g' %{_builddir}/openlitespeed/ dist/_in.sh
sed -i -e 's:mkdir $SERVERROOT:mkdir -p $SERVERROOT:g' %{_builddir}/openlitespeed/ dist/install.sh
sed -i -e 's|s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:|s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:|g' %{_builddir}/openlitespeed/ dist/functions.sh
%{_builddir}/openlitespeed/ dist/install.sh
install -d m 755 %{buildroot}/usr/lsws
rm dist/ols.conf
local buildroot_path=$(rpm --eval "%{buildroot}")
sed -i -e 's:USE_LSPHP7=yes:USE_LSPHP7=no:g' dist/install.sh
sed -i -e "s:SERVERROOT=/usr/lsws:SERVERROOT=$buildroot_path/usr/lsws:g" dist/install.sh
sed -i -e 's:OPENLSWS_ADMINSSL=yes:OPENLSWS_ADMINSSL=no:g' dist/install.sh
sed -i -e 's:ln -sf "$LSWS_HOME/fcgi-bin/lsphp5" "$LSWS_HOME/fcgi-bin/lphp":cd $LSWS_HOME/fcgi-bin/; ln -sf lsphp5 ./lsphp; cd -:g' dist/_in.sh
sed -i -e 's:mkdir $SERVERROOT:mkdir -p $SERVERROOT:g' dist/install.sh
sed -i -e 's|s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:|s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:|g' dist/functions.sh
sh dist/install.sh
rm -f %{buildroot}/usr/lsws/admin/conf/admin_config.conf
cp -pr %{_builddir}/openlitespeed/ dist/admin/conf/admin_config_ssl.conf.in %{buildroot}/usr/lsws/admin/conf/admin_config.conf
cp -pr dist/admin/conf/admin_config_ssl.conf.in %{buildroot}/usr/lsws/admin/conf/admin_config.conf
sed -i -e "s:%ADMIN_PORT%:7080:g" %{buildroot}/usr/lsws/admin/conf/admin_config.conf
sed -i -e "s:%SSL_HOSTNAME%:webadmin:g" %{buildroot}/usr/lsws/admin/conf/admin_config.conf
install -m 755 -d %{buildroot}/etc/init.d
chmod u+w %{buildroot}/usr/lsws/admin/misc/lsws.rc
sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" %{_builddir}/openlitespeed/ dist/admin/misc/lsws.rc.in > %{buildroot}/usr/lsws/admin/misc/lsws.rc
sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" %{_builddir}/openlitespeed/ dist/admin/misc/lsws.rc.in > %{buildroot}/etc/init.d/lsws
sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" dist/admin/misc/lsws.rc.in > %{buildroot}/usr/lsws/admin/misc/lsws.rc
sed "s:%LSWS_CTRL%:/usr/lsws/bin/lswsctrl:" dist/admin/misc/lsws.rc.in > %{buildroot}/etc/init.d/lsws
chmod 0755 %{buildroot}/etc/init.d/lsws
sed -i -e 's:fcgi-bin/lsphp:$SERVER_ROOT/lsphp73/bin/lsphp:g' %{buildroot}/usr/lsws/conf/httpd_config.conf
echo 'RPM' > %{buildroot}/usr/lsws/PLAT
@ -89,7 +83,6 @@ rm %{buildroot}/usr/lsws/fcgi-bin/lsphp
rm %{buildroot}/usr/lsws/admin/misc/lsws.rc.gentoo
%clean
%pre
getent group lsadm > /dev/null || groupadd -r lsadm
lsadm_gid=`grep ^lsadm: /etc/group | awk -F : '{ print $3; }'` >/dev/null 2>&1
@ -97,6 +90,11 @@ getent passwd lsadm > /dev/null || useradd -g $lsadm_gid -d / -r -s /sbin/nologi
usermod -G lsadm,nobody lsadm >/dev/null 2>&1
exit 0
%preun
userdel -r lsadm
groupdel lsadm
rm -rf /usr/lsws/
%post
DEFAULT_USER="nobody"
DEFAULT_GROUP="nobody"
@ -157,7 +155,6 @@ chgrp $WS_GROUP /usr/lsws/admin/tmp >/dev/null 2>&1
chown "$CONF_OWN" $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1
chown "$DIR_OWN" $LSWS_HOME/cachedata >/dev/null 2>&1
chown "$SDIR_OWN" "$LSWS_HOME/fcgi-bin/lsphp" >/dev/null 2>&1
chmod "$EXEC_MOD" "$LSWS_HOME/fcgi-bin/lsphp" >/dev/null 2>&1
chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair" >/dev/null 2>&1
chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair" >/dev/null 2>&1
chown "$CONF_OWN" "$LSWS_HOME/admin/conf/htpasswd" >/dev/null 2>&1
@ -169,8 +166,8 @@ chown "$LOGDIR_OWN" "$LSWS_HOME/logs" "$LSWS_HOME/admin/logs" >/dev/null 2>&1
chmod 0750 "$LSWS_HOME/logs" "$LSWS_HOME/admin/logs" >/dev/null 2>&1
#########this is the end of script to fix rpm build related file group and permission problem.
SSL_COUNTRY='US '
SSL_STATE="New Jersey "
SSL_COUNTRY='R U'
SSL_STATE="Moscow "
SSL_LOCALITY='Virtual'
SSL_ORG='LiteSpeedCommunity'
SSL_ORGUNIT='Testing'
@ -210,12 +207,11 @@ chown lsadm.lsadm %{sslkey}; chmod 400 %{sslkey};
ln -s /usr/lsws/fcgi-bin/lsphp5 /usr/lsws/fcgi-bin/lsphp
/usr/lsws/admin/misc/rc-inst.sh > /dev/null 2>&1
echo "Запустите скрипт admpass.sh от лица привилегированного пользователя root, чтобы задать пароль пользователю admin. Скрипт находится в директории: /usr/lsws/admin/misc/admpass.sh. Запишите пароль, чтобы не потерять доступ к веб серверу, после создания пароля он будет храниться в зашифрованном виде. "
echo "Чтобы запустить сервер openlitespeed выполните команду : systemctl restart lsws"
echo "To change admin password run /usr/lsws/admin/misc/admpass.sh script "
echo "To start the openlitespeed server, run the command : systemctl restart lsws"
%files
%defattr(-,root,root,-)
/etc/init.d/lsws
%dir /usr/lsws
/usr/lsws/*
@ -224,17 +220,14 @@ echo "Чтобы запустить сервер openlitespeed выполнит
%config(noreplace) /usr/lsws/fcgi-bin/*
%config(noreplace) /usr/lsws/PLAT
%files -n ols-pagespeed
%defattr(-,root,root,-)
%attr(-,root,root) /usr/lsws/modules/modpagespeed.so
%files -n %{name}-pagespeed
/usr/lsws/modules/modpagespeed.so
%files -n ols-modsecurity
%defattr(-,root,root,-)
%attr(-,root,root) /usr/lsws/modules/mod_security.so
%files -n %{name}-modsecurity
/usr/lsws/modules/mod_security.so
%files -n ols-lua
%defattr(-,root,root,-)
%attr(-,root,root) /usr/lsws/modules/mod_lua.so
%files -n %{name}-lua
/usr/lsws/modules/mod_lua.so
%changelog
* Wed Sep 18 2024 Eduard Basov <ebasov@msvsphere-os.ru> - 1.8.2