-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathnginx-ldap-auth.spec
68 lines (56 loc) · 1.94 KB
/
nginx-ldap-auth.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
%global logdir /var/log/%name
Name: nginx-ldap-auth
Version: 0.0.5
Release: 1%{?dist}
Summary: NGINX Plus LDAP authentication daemon
Group: System Environment/Daemons
License: 2-clause BSD-like license
URL: https://github.com/nginxinc/nginx-ldap-auth
Source0: nginx-ldap-auth-release-%{version}.tar.gz
BuildRequires: systemd
Requires: systemd
Requires: python-ldap
Requires: python-argparse
Requires: logrotate
%description
Reference implementation of method for authenticating users on behalf of
servers proxied by NGINX or NGINX Plus.
%prep
%setup -q
%install
ls
mkdir -p %buildroot%_bindir
install -m755 nginx-ldap-auth-daemon.py %buildroot%_bindir/nginx-ldap-auth-daemon
mkdir -p %buildroot%_unitdir
install -m644 %name.service %buildroot%_unitdir/
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
install -d -m755 %{buildroot}%{logdir}
%files
%doc README.md nginx-ldap-auth.conf backend-sample-app.py LICENSE
%config(noreplace) /etc/default/%name
%config(noreplace) %_sysconfdir/logrotate.d/%name
%_bindir/nginx-ldap-auth-daemon
%_unitdir/%name.service
%attr(750,nginx-ldap-auth,nginx-ldap-auth) %dir %{logdir}
%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
%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 ||:
%changelog
* Wed Nov 02 2016 Konstantin Pavlov <[email protected]> 0.0.3-1
- Initial release