]>
Commit | Line | Data |
---|---|---|
297b752b ER |
1 | # Replace MODNAME with real module name (example for mod_example) |
2 | # Replace VERSION with version since what confdir support was | |
3 | # introduced for the module. only needed for older .specs, not needed | |
4 | # for new packages. | |
5 | # | |
6 | %define mod_name MODNAME | |
7 | %define apxs %{_sbindir}/apxs | |
6ea9291c | 8 | Summary: Apache HTTPD module: .. |
297b752b ER |
9 | Summary(pl.UTF-8): Moduł Apache'a: ... |
10 | Name: apache-mod_%{mod_name} | |
11 | Version: - | |
12 | Release: 0.1 | |
13 | License: - (enter Apache/GPL/LGPL/BSD/BSD-like/other license name here) | |
4f4f5e06 | 14 | Group: Networking/Daemons/HTTP |
297b752b ER |
15 | Source0: - |
16 | # Source0-md5: - | |
e7b6e3a0 | 17 | Source1: apache.conf |
297b752b ER |
18 | URL: - |
19 | BuildRequires: %{apxs} | |
20 | BuildRequires: apache-devel >= 2.2 | |
21 | BuildRequires: rpmbuild(macros) >= 1.268 | |
22 | Requires: apache(modules-api) = %apache_modules_api | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
26 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d | |
27 | ||
28 | %description | |
6ea9291c | 29 | MODNAME is Apache HTTPD module... |
297b752b ER |
30 | |
31 | %description -l pl.UTF-8 | |
32 | ||
33 | %prep | |
34 | %setup -q -n mod_%{mod_name}-%{version} | |
35 | ||
36 | %build | |
37 | %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so | |
38 | ||
39 | %install | |
40 | rm -rf $RPM_BUILD_ROOT | |
41 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} | |
e7b6e3a0 | 42 | install -p mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} |
297b752b ER |
43 | |
44 | # module configuration | |
45 | # - should contain LoadModule line | |
46 | # - and directives must be between IfModule (so user could disable the module easily) | |
bd5ffd48 | 47 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf |
297b752b ER |
48 | |
49 | # or, if no directives needed, put just LoadModule line | |
50 | echo 'LoadModule %{mod_name}_module modules/mod_%{mod_name}.so' > \ | |
51 | $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf | |
52 | ||
53 | %clean | |
54 | rm -rf $RPM_BUILD_ROOT | |
55 | ||
56 | %post | |
4f4f5e06 | 57 | %service -q httpd restart |
297b752b ER |
58 | |
59 | %postun | |
60 | if [ "$1" = "0" ]; then | |
4f4f5e06 | 61 | %service -q httpd restart |
297b752b ER |
62 | fi |
63 | ||
297b752b ER |
64 | %files |
65 | %defattr(644,root,root,755) | |
66 | %doc README | |
67 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf | |
e7b6e3a0 | 68 | %attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so |