packages: clickheat/clickheat.spec, clickheat/languages.patch (NEW) - add d...
glen
glen at pld-linux.org
Wed Apr 20 00:02:40 CEST 2011
Author: glen Date: Tue Apr 19 22:02:40 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- add default config, localization packaging
---- Files affected:
packages/clickheat:
clickheat.spec (1.2 -> 1.3) , languages.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/clickheat/clickheat.spec
diff -u packages/clickheat/clickheat.spec:1.2 packages/clickheat/clickheat.spec:1.3
--- packages/clickheat/clickheat.spec:1.2 Tue Apr 19 23:40:21 2011
+++ packages/clickheat/clickheat.spec Wed Apr 20 00:02:34 2011
@@ -7,14 +7,16 @@
Summary: ClickHeat | Clicks heatmap
Name: clickheat
Version: 1.12
-Release: 0.4
+Release: 0.8
License: GPL v2
Group: Applications/WWW
Source0: http://downloads.sourceforge.net/clickheat/%{name}-%{version}.zip
# Source0-md5: 5a4a057a55c904782facad0add684e69
Source1: apache.conf
Source2: lighttpd.conf
+Source3: config.php
Patch0: paths.patch
+Patch1: languages.patch
URL: http://www.labsmedia.com/clickheat/
BuildRequires: rpm-php-pearprov >= 4.4.2-11
BuildRequires: rpmbuild(macros) >= 1.268
@@ -49,6 +51,7 @@
%setup -qc
mv %{name}/* .
%patch0 -p1
+%patch1 -p1
# to satisfy deps
%{__sed} -i -e '1s,#!/usr/bin/php5-cgi -q,#!/usr/bin/php,' scripts/compressJs.php
@@ -56,6 +59,7 @@
# simplify packaging
install -d doc
mv INSTALL LICENSE LISEZMOI README VERSION doc
+%{__rm} languages/__readme.txt images/flags/_flags.txt
%{__rm} {cache,config,logs}/.htaccess
rmdir cache config logs
@@ -74,9 +78,25 @@
rm $RPM_BUILD_ROOT%{_appdir}/js/clickheat-original.js
rm $RPM_BUILD_ROOT%{_appdir}/scripts/compressJs.php
+process_languages() {
+ echo "%dir %{_appdir}/languages"
+ echo "%dir %{_appdir}/images/flags"
+ for f in languages/*.php; do
+ l=${f##*/} l=${l%*.php}
+ ll="%lang($l)"
+ if [ $l = en ]; then
+ ll=
+ fi
+ echo "$ll %{_appdir}/languages/$l.php"
+ echo "$ll %{_appdir}/images/flags/$l.png"
+ done
+}
+process_languages > %{name}.lang
+
cp -a %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}
%triggerin -- apache1 < 1.3.37-3, apache1-base
%webapp_register apache %{_webapp}
@@ -99,15 +119,25 @@
%clean
rm -rf $RPM_BUILD_ROOT
-%files
+%files -f %{name}.lang
%defattr(644,root,root,755)
%doc doc/*
%dir %attr(770,root,http) %{_sysconfdir}
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
-#%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*.php
-%{_appdir}
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
+%dir %{_appdir}
+%{_appdir}/*.php
+%{_appdir}/*.html
+%{_appdir}/classes
+%{_appdir}/config
+%{_appdir}/clickheat
+%dir %{_appdir}/images
+%{_appdir}/images/*.png
+%{_appdir}/js
+%{_appdir}/scripts
+%{_appdir}/styles
%{_examplesdir}/%{name}-%{version}
%dir %attr(775,root,http) /var/cache/%{name}
%dir %attr(775,root,http) /var/log/%{name}
@@ -118,6 +148,9 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.3 2011/04/19 22:02:34 glen
+- add default config, localization packaging
+
Revision 1.2 2011/04/19 21:40:21 glen
- up to 1.12, somewhat more packaging
================================================================
Index: packages/clickheat/languages.patch
diff -u /dev/null packages/clickheat/languages.patch:1.1
--- /dev/null Wed Apr 20 00:02:40 2011
+++ packages/clickheat/languages.patch Wed Apr 20 00:02:34 2011
@@ -0,0 +1,35 @@
+--- clickheat/index.php~ 2011-04-20 00:53:09.000000000 +0300
++++ clickheat/index.php 2011-04-20 00:53:11.781485704 +0300
+@@ -72,7 +72,7 @@
+ {
+ $lang = strtolower(substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2));
+ }
+-if (!isset($lang) || !in_array($lang, $__languages))
++if (!isset($lang) || !in_array($lang, $__languages) || !file_exists(CLICKHEAT_ROOT.'languages/'.$lang.'.php'))
+ {
+ $lang = 'en';
+ }
+--- clickheat/view.php~ 2011-03-08 13:51:16.000000000 +0200
++++ clickheat/view.php 2011-04-20 00:52:19.615980496 +0300
+@@ -92,6 +92,9 @@
+ <?php
+ foreach ($__languages as $lang)
+ {
++ if (!file_exists(CLICKHEAT_ROOT.'languages/'.$lang.'.php')) {
++ continue;
++ }
+ echo '<a href="', CLICKHEAT_INDEX_PATH, 'language=', $lang, '"><img src="', CLICKHEAT_PATH, 'images/flags/', $lang, '.png" width="18" height="12" alt="', $lang, '" /></a> ';
+ }
+ ?><br />
+--- clickheat/login.php~ 2011-03-08 13:51:16.000000000 +0200
++++ clickheat/login.php 2011-04-20 00:52:40.036830709 +0300
+@@ -17,6 +17,9 @@
+ <?php
+ foreach ($__languages as $lang)
+ {
++ if (!file_exists(CLICKHEAT_ROOT.'languages/'.$lang.'.php')) {
++ continue;
++ }
+ echo '<a href="', CLICKHEAT_INDEX_PATH, 'language=', $lang, '"><img src="', CLICKHEAT_PATH, 'images/flags/', $lang, '.png" width="18" height="12" alt="', $lang, '" /></a> ';
+ }
+ ?></div>
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/clickheat/clickheat.spec?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list