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}
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
14 BuildRequires: rpmbuild(macros) >= 1.268
15 Requires: apache(modules-api) = %apache_modules_api
16 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
19 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)
20 %define _pkglogdir %(%{apxs} -q PREFIX 2>/dev/null)/logs
23 mod_xsendfile is a small Apache2 module that processes X-SENDFILE
24 headers registered by the original output handler. If it encounters
25 the presence of such header it will discard all output and send the
26 file specified by that header instead using Apache internals including
27 all optimizations like caching-headers and sendfile or mmap if
28 configured. It is useful for processing script-output of e.g. PHP,
35 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.la
38 rm -rf $RPM_BUILD_ROOT
39 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd.conf}
41 install .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
42 echo 'LoadModule %{mod_name}_module modules/mod_%{mod_name}.so' > \
43 $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/90_mod_%{mod_name}.conf
46 rm -rf $RPM_BUILD_ROOT
49 %service -q httpd restart
52 if [ "$1" = "0" ]; then
53 %service -q httpd restart
57 %defattr(644,root,root,755)
58 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*_mod_%{mod_name}.conf
59 %attr(755,root,root) %{_pkglibdir}/*.so