Skip to content
Snippets Groups Projects
Commit 3704dc25 authored by Igor Ippolitov's avatar Igor Ippolitov
Browse files

several minor fixes into spec file

parent bbbde8d2
No related branches found
No related tags found
No related merge requests found
......@@ -33,8 +33,7 @@ install -d -m755 %buildroot/etc/default
install -m644 %name.default %buildroot/etc/default/%name
install -d -m755 %buildroot/etc/logrotate.d
install -m644 %name.logrotate %buildroot%_sysconfdir/logrotate.d/%name
mkdir -p %{buildroot}%{logdir}
touch %{buildroot}%{logdir}/daemon.log
install -d -m755 %{buildroot}%{logdir}
%files
%doc README.md nginx-ldap-auth.conf backend-sample-app.py LICENSE
......@@ -43,18 +42,23 @@ touch %{buildroot}%{logdir}/daemon.log
%_bindir/nginx-ldap-auth-daemon
%_unitdir/%name.service
%attr(750,nginx-ldap-auth,nginx-ldap-auth) %dir %{logdir}
%config %ghost %attr(640,nginx-ldap-auth,nginx-ldap-auth) %{logdir}/daemon.log
%post
%pre
getent group nginx-ldap-auth > /dev/null || groupadd -r nginx-ldap-auth
getent passwd nginx-ldap-auth > /dev/null || \
useradd -r -d /var/lib/nginx -g nginx-ldap-auth \
-s /sbin/nologin -c "Nginx auth helper" nginx-ldap-auth
/usr/bin/systemctl preset nginx-ldap-auth.service
%post
if [ $1 -eq 1 ]; then
/usr/bin/systemctl preset nginx-ldap-auth.service >/dev/null 2>&1 ||:
fi;
%preun
if [ $1 -eq 0 ]; then
/usr/bin/systemctl --no-reload disable nginx-ldap-auth.service >/dev/null 2>&1 ||:
/usr/bin/systemctl stop nginx-ldap-auth.service >/dev/null 2>&1 ||:
fi;
%postun
/usr/bin/systemctl daemon-reload >/dev/null 2>&1 ||:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment