]> git.pld-linux.org Git - packages/apache-mod_cloudflare.git/blob - apache-mod_cloudflare.spec
version is in VERSION file. doh
[packages/apache-mod_cloudflare.git] / apache-mod_cloudflare.spec
1 %define         mod_name        cloudflare
2 %define         apxs            %{_sbindir}/apxs
3 Summary:        Apache module to show true visitor IPs in logs for domains using CloudFlare
4 Name:           apache-mod_%{mod_name}
5 Version:        2016.10.0
6 Release:        1
7 License:        Apache v2.0
8 Group:          Networking/Daemons/HTTP
9 Source0:        https://github.com/cloudflare/mod_cloudflare/archive/98ab38a/mod_%{mod_name}-%{version}.tar.gz
10 # Source0-md5:  d618e95ba37e48139858ebadc908b142
11 Source1:        apache.conf
12 URL:            https://github.com/cloudflare/mod_cloudflare
13 BuildRequires:  apache-devel >= 2.2
14 BuildRequires:  rpmbuild(macros) >= 1.268
15 Requires:       apache(modules-api) = %apache_modules_api
16 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
17
18 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
19 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
20
21 %description
22 CloudFlare acts as a proxy, which means that your visitors are routed
23 through the CloudFlare network and you do not see their original IP
24 address.
25
26 This module uses HTTP headers provided by the CloudFlare proxy to log
27 the real IP address of the visitor. Based on mod_remoteip.c, this
28 apache extension will replace the remote_ip variable in user's logs
29 with the correct remote_ip sent from CloudFlare. This also does
30 authentication, only performing the switch for requests originating
31 from CloudFlare IPs.
32
33 %prep
34 %setup -qc
35 mv mod_cloudflare-*/* .
36
37 %build
38 . ./VERSION
39 version=$MAJOR.$MINOR.$BUILD
40 test "$version" = %{version}
41
42 %{apxs} -c mod_%{mod_name}.c
43
44 %install
45 rm -rf $RPM_BUILD_ROOT
46 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
47
48 %{apxs} -i -S LIBEXECDIR=$RPM_BUILD_ROOT%{_pkglibdir} -n 'mod_cloudflare' mod_cloudflare.la
49
50 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
51
52 %clean
53 rm -rf $RPM_BUILD_ROOT
54
55 %post
56 %service -q httpd restart
57
58 %postun
59 if [ "$1" = "0" ]; then
60         %service -q httpd restart
61 fi
62
63 %files
64 %defattr(644,root,root,755)
65 %doc README.md
66 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_%{mod_name}.conf
67 %attr(755,root,root) %{_pkglibdir}/mod_%{mod_name}.so
This page took 0.172467 seconds and 4 git commands to generate.