]>
Commit | Line | Data |
---|---|---|
06a8e3ae ER |
1 | # TODO |
2 | # - frontend package | |
3 | # - admin package | |
006bdd36 | 4 | %define php_min_version 5.0.0 |
06a8e3ae ER |
5 | Summary: ClickHeat | Clicks heatmap |
6 | Name: clickheat | |
006bdd36 | 7 | Version: 1.12 |
67a8632c | 8 | Release: 0.12 |
06a8e3ae ER |
9 | License: GPL v2 |
10 | Group: Applications/WWW | |
11 | Source0: http://downloads.sourceforge.net/clickheat/%{name}-%{version}.zip | |
006bdd36 | 12 | # Source0-md5: 5a4a057a55c904782facad0add684e69 |
06a8e3ae ER |
13 | Source1: apache.conf |
14 | Source2: lighttpd.conf | |
5318d14e | 15 | Source3: config.php |
006bdd36 | 16 | Patch0: paths.patch |
5318d14e | 17 | Patch1: languages.patch |
3b8009a3 | 18 | Patch2: js-scoping.patch |
06a8e3ae | 19 | URL: http://www.labsmedia.com/clickheat/ |
3b8009a3 | 20 | BuildRequires: js |
006bdd36 | 21 | BuildRequires: rpm-php-pearprov >= 4.4.2-11 |
06a8e3ae | 22 | BuildRequires: rpmbuild(macros) >= 1.268 |
3b8009a3 | 23 | BuildRequires: yuicompressor |
006bdd36 | 24 | Requires: php-common >= 4:%{php_min_version} |
06a8e3ae | 25 | Requires: php-gd |
006bdd36 | 26 | Requires: webapps |
06a8e3ae ER |
27 | Requires: webserver(access) |
28 | Requires: webserver(alias) | |
06a8e3ae | 29 | Requires: webserver(php) |
06a8e3ae ER |
30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %define _webapps /etc/webapps | |
34 | %define _webapp %{name} | |
35 | %define _sysconfdir %{_webapps}/%{_webapp} | |
36 | %define _appdir %{_datadir}/%{_webapp} | |
37 | ||
006bdd36 ER |
38 | # bad depsolver |
39 | %define _noautopear pear | |
40 | ||
41 | # exclude optional php dependencies | |
42 | %define _noautophp php-mysql | |
43 | ||
44 | # put it together for rpmbuild | |
45 | %define _noautoreq %{?_noautophp} %{?_noautopear} | |
46 | ||
06a8e3ae ER |
47 | %description |
48 | ClickHeat is a visual heatmap of clicks on a HTML page, showing hot | |
49 | and cold click zones. | |
50 | ||
51 | %prep | |
006bdd36 ER |
52 | %setup -qc |
53 | mv %{name}/* . | |
54 | %patch0 -p1 | |
5318d14e | 55 | %patch1 -p1 |
3b8009a3 | 56 | %patch2 -p1 |
006bdd36 ER |
57 | |
58 | # to satisfy deps | |
59 | %{__sed} -i -e '1s,#!/usr/bin/php5-cgi -q,#!/usr/bin/php,' scripts/compressJs.php | |
06a8e3ae ER |
60 | |
61 | # simplify packaging | |
62 | install -d doc | |
63 | mv INSTALL LICENSE LISEZMOI README VERSION doc | |
5318d14e | 64 | %{__rm} languages/__readme.txt images/flags/_flags.txt |
06a8e3ae | 65 | |
006bdd36 ER |
66 | %{__rm} {cache,config,logs}/.htaccess |
67 | rmdir cache config logs | |
68 | ||
3b8009a3 ER |
69 | %build |
70 | # compress .js | |
71 | yuicompressor --charset UTF-8 js/clickheat-original.js -o js/clickheat.js | |
72 | js -C -f js/clickheat.js | |
73 | ||
06a8e3ae ER |
74 | %install |
75 | rm -rf $RPM_BUILD_ROOT | |
006bdd36 | 76 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},/var/{cache,log}/%{name}} |
06a8e3ae ER |
77 | |
78 | cp -a . $RPM_BUILD_ROOT%{_appdir} | |
006bdd36 | 79 | ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/config |
5830fc6c | 80 | rm -rf $RPM_BUILD_ROOT%{_appdir}/{doc,examples,scripts} |
006bdd36 ER |
81 | |
82 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
83 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
84 | ||
06a8e3ae ER |
85 | rm $RPM_BUILD_ROOT%{_appdir}/js/clickheat-original.js |
86 | ||
5318d14e ER |
87 | process_languages() { |
88 | echo "%dir %{_appdir}/languages" | |
89 | echo "%dir %{_appdir}/images/flags" | |
90 | for f in languages/*.php; do | |
91 | l=${f##*/} l=${l%*.php} | |
92 | ll="%lang($l)" | |
93 | if [ $l = en ]; then | |
94 | ll= | |
95 | fi | |
96 | echo "$ll %{_appdir}/languages/$l.php" | |
97 | echo "$ll %{_appdir}/images/flags/$l.png" | |
98 | done | |
99 | } | |
100 | process_languages > %{name}.lang | |
101 | ||
06a8e3ae ER |
102 | cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf |
103 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
104 | cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf | |
5318d14e | 105 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir} |
06a8e3ae ER |
106 | |
107 | %triggerin -- apache1 < 1.3.37-3, apache1-base | |
108 | %webapp_register apache %{_webapp} | |
109 | ||
110 | %triggerun -- apache1 < 1.3.37-3, apache1-base | |
111 | %webapp_unregister apache %{_webapp} | |
112 | ||
113 | %triggerin -- apache < 2.2.0, apache-base | |
114 | %webapp_register httpd %{_webapp} | |
115 | ||
116 | %triggerun -- apache < 2.2.0, apache-base | |
117 | %webapp_unregister httpd %{_webapp} | |
118 | ||
119 | %triggerin -- lighttpd | |
120 | %webapp_register lighttpd %{_webapp} | |
121 | ||
122 | %triggerun -- lighttpd | |
123 | %webapp_unregister lighttpd %{_webapp} | |
124 | ||
125 | %clean | |
126 | rm -rf $RPM_BUILD_ROOT | |
127 | ||
5318d14e | 128 | %files -f %{name}.lang |
06a8e3ae | 129 | %defattr(644,root,root,755) |
5830fc6c | 130 | %doc doc/* scripts |
006bdd36 | 131 | %dir %attr(770,root,http) %{_sysconfdir} |
06a8e3ae ER |
132 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf |
133 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
134 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
5318d14e ER |
135 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php |
136 | %dir %{_appdir} | |
137 | %{_appdir}/*.php | |
138 | %{_appdir}/*.html | |
139 | %{_appdir}/classes | |
140 | %{_appdir}/config | |
5318d14e ER |
141 | %dir %{_appdir}/images |
142 | %{_appdir}/images/*.png | |
143 | %{_appdir}/js | |
5318d14e | 144 | %{_appdir}/styles |
006bdd36 ER |
145 | %{_examplesdir}/%{name}-%{version} |
146 | %dir %attr(775,root,http) /var/cache/%{name} | |
147 | %dir %attr(775,root,http) /var/log/%{name} |