1 %define php_min_version 5.1.3
2 Summary: Open source web analytics
6 License: GPL v3 and other OSS licenses
7 Group: Applications/WWW
8 Source0: http://piwik.org/latest.zip
9 # Source0-md5: 04c5dc7f595adce4d68be9f94bbb140c
11 Source2: lighttpd.conf
12 URL: http://www.piwik.org
13 BuildRequires: rpmbuild(macros) >= 1.268
14 Requires: php-common >= 4:%{php_min_version}
15 Requires: php-pdo-mysql
17 Requires: webserver(access)
18 Requires: webserver(alias)
19 Requires: webserver(php)
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 %define _webapps /etc/webapps
25 %define _webapp %{name}
26 %define _sysconfdir %{_webapps}/%{_webapp}
27 %define _appdir %{_datadir}/%{_webapp}
30 %define _noautopear pear
31 # exclude optional php dependencies
32 %define _noautophp php-curl
33 # put it together for rpmbuild
34 %define _noautoreq %{?_noautophp} %{?_noautopear}
37 Piwik is a downloadable, open source (GPL licensed) real time web
38 analytics software program. It provides you with detailed reports on
39 your website visitors: the search engines and keywords they used, the
40 language they speak, your popular pages... and so much more.
42 Piwik aims to be an open source alternative to Google Analytics, and
43 is already used on more than 200,000 websites.
48 # relocate for simplier install and doc section
49 mv %{name}/{config,misc} .
50 mv %{name}/{LEGALNOTICE,README} .
56 rm -rf $RPM_BUILD_ROOT
57 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
58 cp -a %{name}/* $RPM_BUILD_ROOT%{_appdir}
60 cp -a config/* $RPM_BUILD_ROOT%{_sysconfdir}
61 ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/config
63 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
64 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
65 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
67 %triggerin -- apache1 < 1.3.37-3, apache1-base
68 %webapp_register apache %{_webapp}
70 %triggerun -- apache1 < 1.3.37-3, apache1-base
71 %webapp_unregister apache %{_webapp}
73 %triggerin -- apache < 2.2.0, apache-base
74 %webapp_register httpd %{_webapp}
76 %triggerun -- apache < 2.2.0, apache-base
77 %webapp_unregister httpd %{_webapp}
79 %triggerin -- lighttpd
80 %webapp_register lighttpd %{_webapp}
82 %triggerun -- lighttpd
83 %webapp_unregister lighttpd %{_webapp}
86 rm -rf $RPM_BUILD_ROOT
89 %defattr(644,root,root,755)
90 %doc LEGALNOTICE README misc
91 %dir %attr(750,root,http) %{_sysconfdir}
92 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
93 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
94 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
95 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php