]>
Commit | Line | Data |
---|---|---|
35d1673e ER |
1 | %define mod_name xsendfile |
2 | %define apxs /usr/sbin/apxs | |
3 | Summary: Apache module: convert character encoding of request URLs | |
4 | Name: apache-mod_%{mod_name} | |
5 | Version: 0.8 | |
6 | Release: 0.1 | |
7 | License: Apache 2.0 | |
8 | Group: Networking/Daemons | |
9 | Source0: http://celebnamer.celebworld.ws/stuff/mod_xsendfile/mod_xsendfile-%{version}.tar.gz | |
10 | # Source0-md5: aa885ed32cce545404f329fdf507e53b | |
11 | URL: http://celebnamer.celebworld.ws/stuff/mod_xsendfile/ | |
12 | BuildRequires: %{apxs} | |
13 | BuildRequires: apache-devel >= 2.0.40 | |
14 | BuildRequires: autoconf | |
15 | BuildRequires: automake | |
16 | BuildRequires: rpmbuild(macros) >= 1.268 | |
17 | Requires: apache(modules-api) = %apache_modules_api | |
18 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
19 | ||
20 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) | |
21 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null) | |
22 | %define _pkglogdir %(%{apxs} -q PREFIX 2>/dev/null)/logs | |
23 | ||
24 | %description | |
25 | mod_xsendfile is a small Apache2 module that processes X-SENDFILE | |
26 | headers registered by the original output handler. If it encounters | |
27 | the presence of such header it will discard all output and send the | |
28 | file specified by that header instead using Apache internals including | |
29 | all optimizations like caching-headers and sendfile or mmap if | |
30 | configured. It is useful for processing script-output of e.g. PHP, | |
31 | Perl or any CGI. | |
32 | ||
33 | %prep | |
34 | %setup -qc | |
35 | ||
36 | %build | |
37 | %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.la | |
38 | ||
39 | %install | |
40 | rm -rf $RPM_BUILD_ROOT | |
41 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd.conf} | |
42 | ||
43 | install .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
44 | echo 'LoadModule %{mod_name}_module modules/mod_%{mod_name}.so' > \ | |
45 | $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/90_mod_%{mod_name}.conf | |
46 | ||
47 | %clean | |
48 | rm -rf $RPM_BUILD_ROOT | |
49 | ||
50 | %post | |
51 | %service -q httpd restart | |
52 | ||
53 | %postun | |
54 | if [ "$1" = "0" ]; then | |
55 | %service -q httpd restart | |
56 | fi | |
57 | ||
58 | %files | |
59 | %defattr(644,root,root,755) | |
60 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*_mod_%{mod_name}.conf | |
61 | %attr(755,root,root) %{_pkglibdir}/*.so |