update cf ip list in config
[packages/apache-mod_cloudflare.git] / apache-mod_cloudflare.spec
CommitLineData
b4ff000f
ER
1%define mod_name cloudflare
2%define apxs %{_sbindir}/apxs
3Summary: Apache module to show true visitor IPs in logs for domains using CloudFlare
4Name: apache-mod_%{mod_name}
0424cd78 5Version: 2016.10.0
b4ff000f
ER
6Release: 1
7License: Apache v2.0
8Group: Networking/Daemons/HTTP
0424cd78
ER
9Source0: https://github.com/cloudflare/mod_cloudflare/archive/98ab38a/mod_%{mod_name}-%{version}.tar.gz
10# Source0-md5: d618e95ba37e48139858ebadc908b142
b4ff000f 11Source1: apache.conf
0424cd78 12URL: https://github.com/cloudflare/mod_cloudflare
b4ff000f
ER
13BuildRequires: apache-devel >= 2.2
14BuildRequires: rpmbuild(macros) >= 1.268
15Requires: apache(modules-api) = %apache_modules_api
16BuildRoot: %{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
22CloudFlare acts as a proxy, which means that your visitors are routed
23through the CloudFlare network and you do not see their original IP
24address.
25
26This module uses HTTP headers provided by the CloudFlare proxy to log
27the real IP address of the visitor. Based on mod_remoteip.c, this
28apache extension will replace the remote_ip variable in user's logs
29with the correct remote_ip sent from CloudFlare. This also does
30authentication, only performing the switch for requests originating
31from CloudFlare IPs.
32
33%prep
34%setup -qc
35mv mod_cloudflare-*/* .
36
37%build
0424cd78
ER
38. ./VERSION
39version=$MAJOR.$MINOR.$BUILD
40test "$version" = %{version}
41
b11b0a63 42%{apxs} -c mod_%{mod_name}.c
b4ff000f
ER
43
44%install
45rm -rf $RPM_BUILD_ROOT
46install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
b11b0a63
AM
47
48%{apxs} -i -S LIBEXECDIR=$RPM_BUILD_ROOT%{_pkglibdir} -n 'mod_cloudflare' mod_cloudflare.la
49
b4ff000f
ER
50cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/90_mod_%{mod_name}.conf
51
52%clean
53rm -rf $RPM_BUILD_ROOT
54
55%post
56%service -q httpd restart
57
58%postun
59if [ "$1" = "0" ]; then
60 %service -q httpd restart
61fi
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.124159 seconds and 4 git commands to generate.