]>
Commit | Line | Data |
---|---|---|
e2663f46 | 1 | %define mod_name auth_yp |
11120f3e | 2 | %define apxs /usr/sbin/apxs1 |
e2663f46 | 3 | Summary: NIS/YP domain authentication module for Apache |
89851588 | 4 | Summary(pl.UTF-8): Moduł Apache'a uwierzytelniający użytkownika w domenie NIS/YP |
11120f3e | 5 | Name: apache1-mod_%{mod_name} |
e2663f46 | 6 | Version: 1.0 |
e6f30c79 | 7 | Release: 3 |
e2663f46 SZ |
8 | License: GPL |
9 | Group: Networking/Daemons | |
10 | Source0: http://nte.univ-lyon2.fr/~brogniar/articles/mod_%{mod_name}.c | |
11 | Source1: %{name}-htaccess | |
12 | Patch0: %{name}-authfile.patch | |
13 | Patch1: %{name}-shadow.patch | |
11120f3e | 14 | BuildRequires: %{apxs} |
f3d3ffc0 | 15 | BuildRequires: apache1-devel >= 1.3.33-2 |
d90159dc | 16 | BuildRequires: rpmbuild(macros) >= 1.268 |
f3d3ffc0 | 17 | Requires(triggerpostun): %{apxs} |
e6f30c79 | 18 | Requires: apache1(EAPI) |
ff2dd88a | 19 | Obsoletes: apache-mod_auth_yp <= 1.0 |
e2663f46 SZ |
20 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
21 | ||
f3d3ffc0 ER |
22 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
23 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) | |
e2663f46 SZ |
24 | |
25 | %description | |
26 | Apache module authenticating against a NIS/YP domain. | |
27 | ||
437eaa45 JR |
28 | %description -l pl.UTF-8 |
29 | Moduł do Apache'a autoryzujący w domenie NIS/YP. | |
e2663f46 SZ |
30 | |
31 | %prep | |
a18465f0 | 32 | %setup -qcT |
e2663f46 SZ |
33 | install %{SOURCE0} . |
34 | %patch0 | |
35 | %patch1 | |
36 | ||
37 | %build | |
38 | %{apxs} \ | |
39 | -c mod_%{mod_name}.c \ | |
3e5915de JR |
40 | -o mod_%{mod_name}.so \ |
41 | -l nsl | |
e2663f46 SZ |
42 | |
43 | %install | |
44 | rm -rf $RPM_BUILD_ROOT | |
f3d3ffc0 | 45 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/conf.d} |
e2663f46 SZ |
46 | |
47 | install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
48 | install %{SOURCE1} ./sample-htaccess | |
49 | ||
f3d3ffc0 ER |
50 | echo 'LoadModule %{mod_name}_module modules/mod_%{mod_name}.so' > \ |
51 | $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_%{mod_name}.conf | |
52 | ||
e2663f46 | 53 | %post |
d90159dc | 54 | %service -q apache restart |
e2663f46 | 55 | |
099dc6e2 | 56 | %postun |
e2663f46 | 57 | if [ "$1" = "0" ]; then |
d90159dc | 58 | %service -q apache restart |
e2663f46 SZ |
59 | fi |
60 | ||
61 | %clean | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | ||
f3d3ffc0 ER |
64 | %triggerpostun -- apache1-mod_%{mod_name} < 1.0-1.1 |
65 | # check that they're not using old apache.conf | |
66 | if grep -q '^Include conf\.d' /etc/apache/apache.conf; then | |
67 | %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 | |
68 | fi | |
69 | ||
e2663f46 SZ |
70 | %files |
71 | %defattr(644,root,root,755) | |
72 | %doc sample-htaccess | |
a18465f0 | 73 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf |
e2663f46 | 74 | %attr(755,root,root) %{_pkglibdir}/* |