4 %define php_min_version 5.0.0
5 %include /usr/lib/rpm/macros.php
6 Summary: ClickHeat | Clicks heatmap
11 Group: Applications/WWW
12 Source0: http://downloads.sourceforge.net/clickheat/%{name}-%{version}.zip
13 # Source0-md5: 5a4a057a55c904782facad0add684e69
15 Source2: lighttpd.conf
18 Patch1: languages.patch
19 Patch2: js-scoping.patch
20 URL: http://www.labsmedia.com/clickheat/
22 BuildRequires: rpm-php-pearprov >= 4.4.2-11
23 BuildRequires: rpmbuild(macros) >= 1.268
24 BuildRequires: yuicompressor
25 Requires: php-common >= 4:%{php_min_version}
28 Requires: webserver(access)
29 Requires: webserver(alias)
30 Requires: webserver(php)
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 %define _webapps /etc/webapps
35 %define _webapp %{name}
36 %define _sysconfdir %{_webapps}/%{_webapp}
37 %define _appdir %{_datadir}/%{_webapp}
40 %define _noautopear pear
42 # exclude optional php dependencies
43 %define _noautophp php-mysql
45 # put it together for rpmbuild
46 %define _noautoreq %{?_noautophp} %{?_noautopear}
49 ClickHeat is a visual heatmap of clicks on a HTML page, showing hot
60 %{__sed} -i -e '1s,#!/usr/bin/php5-cgi -q,#!/usr/bin/php,' scripts/compressJs.php
64 mv INSTALL LICENSE LISEZMOI README VERSION doc
65 %{__rm} languages/__readme.txt images/flags/_flags.txt
67 %{__rm} {cache,config,logs}/.htaccess
68 rmdir cache config logs
72 yuicompressor --charset UTF-8 js/clickheat-original.js -o js/clickheat.js
73 js -C -f js/clickheat.js
76 rm -rf $RPM_BUILD_ROOT
77 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},/var/{cache,log}/%{name}}
79 cp -a . $RPM_BUILD_ROOT%{_appdir}
80 ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/config
81 rm -rf $RPM_BUILD_ROOT%{_appdir}/{doc,examples,scripts}
83 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
84 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
86 rm $RPM_BUILD_ROOT%{_appdir}/js/clickheat-original.js
89 echo "%dir %{_appdir}/languages"
90 echo "%dir %{_appdir}/images/flags"
91 for f in languages/*.php; do
92 l=${f##*/} l=${l%*.php}
97 echo "$ll %{_appdir}/languages/$l.php"
98 echo "$ll %{_appdir}/images/flags/$l.png"
101 process_languages > %{name}.lang
103 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
104 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
105 cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
106 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
108 %triggerin -- apache1 < 1.3.37-3, apache1-base
109 %webapp_register apache %{_webapp}
111 %triggerun -- apache1 < 1.3.37-3, apache1-base
112 %webapp_unregister apache %{_webapp}
114 %triggerin -- apache < 2.2.0, apache-base
115 %webapp_register httpd %{_webapp}
117 %triggerun -- apache < 2.2.0, apache-base
118 %webapp_unregister httpd %{_webapp}
120 %triggerin -- lighttpd
121 %webapp_register lighttpd %{_webapp}
123 %triggerun -- lighttpd
124 %webapp_unregister lighttpd %{_webapp}
127 rm -rf $RPM_BUILD_ROOT
129 %files -f %{name}.lang
130 %defattr(644,root,root,755)
132 %dir %attr(770,root,http) %{_sysconfdir}
133 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
134 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
135 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
136 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
142 %dir %{_appdir}/images
143 %{_appdir}/images/*.png
146 %{_examplesdir}/%{name}-%{version}
147 %dir %attr(775,root,http) /var/cache/%{name}
148 %dir %attr(775,root,http) /var/log/%{name}