]> git.pld-linux.org Git - packages/clickheat.git/blob - clickheat.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/clickheat.git] / clickheat.spec
1 # TODO
2 # - frontend package
3 # - admin package
4 %define         php_min_version 5.0.0
5 Summary:        ClickHeat | Clicks heatmap
6 Name:           clickheat
7 Version:        1.12
8 Release:        0.12
9 License:        GPL v2
10 Group:          Applications/WWW
11 Source0:        http://downloads.sourceforge.net/clickheat/%{name}-%{version}.zip
12 # Source0-md5:  5a4a057a55c904782facad0add684e69
13 Source1:        apache.conf
14 Source2:        lighttpd.conf
15 Source3:        config.php
16 Patch0:         paths.patch
17 Patch1:         languages.patch
18 Patch2:         js-scoping.patch
19 URL:            http://www.labsmedia.com/clickheat/
20 BuildRequires:  js
21 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
22 BuildRequires:  rpmbuild(macros) >= 1.268
23 BuildRequires:  yuicompressor
24 Requires:       php-common >= 4:%{php_min_version}
25 Requires:       php-gd
26 Requires:       webapps
27 Requires:       webserver(access)
28 Requires:       webserver(alias)
29 Requires:       webserver(php)
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
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
47 %description
48 ClickHeat is a visual heatmap of clicks on a HTML page, showing hot
49 and cold click zones.
50
51 %prep
52 %setup -qc
53 mv %{name}/* .
54 %patch0 -p1
55 %patch1 -p1
56 %patch2 -p1
57
58 # to satisfy deps
59 %{__sed} -i -e '1s,#!/usr/bin/php5-cgi -q,#!/usr/bin/php,' scripts/compressJs.php
60
61 # simplify packaging
62 install -d doc
63 mv INSTALL LICENSE LISEZMOI README VERSION doc
64 %{__rm} languages/__readme.txt images/flags/_flags.txt
65
66 %{__rm} {cache,config,logs}/.htaccess
67 rmdir cache config logs
68
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
74 %install
75 rm -rf $RPM_BUILD_ROOT
76 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},/var/{cache,log}/%{name}}
77
78 cp -a . $RPM_BUILD_ROOT%{_appdir}
79 ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/config
80 rm -rf $RPM_BUILD_ROOT%{_appdir}/{doc,examples,scripts}
81
82 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
83 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
84
85 rm $RPM_BUILD_ROOT%{_appdir}/js/clickheat-original.js
86
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
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
105 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
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
128 %files -f %{name}.lang
129 %defattr(644,root,root,755)
130 %doc doc/* scripts
131 %dir %attr(770,root,http) %{_sysconfdir}
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
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
141 %dir %{_appdir}/images
142 %{_appdir}/images/*.png
143 %{_appdir}/js
144 %{_appdir}/styles
145 %{_examplesdir}/%{name}-%{version}
146 %dir %attr(775,root,http) /var/cache/%{name}
147 %dir %attr(775,root,http) /var/log/%{name}
This page took 0.082327 seconds and 3 git commands to generate.