[php-horde-horde] - don't use system javascript libraries as this breaks horde and its cache system - use /var/log/hor
Remi Collet
remi at fedoraproject.org
Wed Sep 24 06:11:13 UTC 2014
commit 5ce5c5be8f351f19aa30343fda1aa1ec18dc3d49
Author: Remi Collet <remi at fedoraproject.org>
Date: Wed Sep 24 08:11:05 2014 +0200
- don't use system javascript libraries as this breaks horde and its cache system
- use /var/log/horde for logging
- use /var/lib/horde/cache for caching
- use /var/lib/horde/static for js and css cache
- fix regex filter, fix missing horde-power*.png
horde-logrotate | 10 ++++++
php-horde-horde.spec | 78 ++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 80 insertions(+), 8 deletions(-)
---
diff --git a/horde-logrotate b/horde-logrotate
new file mode 100644
index 0000000..73b50d0
--- /dev/null
+++ b/horde-logrotate
@@ -0,0 +1,10 @@
+# Rotate Horde logs daily, only if not empty
+# Save 14 days old logs under compressed mode
+/var/log/horde/*.log {
+ daily
+ rotate 14
+ compress
+ notifempty
+ missingok
+ create 644 apache apache
+}
diff --git a/php-horde-horde.spec b/php-horde-horde.spec
index ee476f7..476a825 100644
--- a/php-horde-horde.spec
+++ b/php-horde-horde.spec
@@ -10,11 +10,12 @@
%{!?__pear: %global __pear %{_bindir}/pear}
%global pear_name horde
%global pear_channel pear.horde.org
-%global sysckeditor 0
+# To use system js
+%global with_sysjs 0
Name: php-horde-horde
Version: 5.2.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Horde Application Framework
Group: Development/Libraries
@@ -22,6 +23,7 @@ License: LGPLv2
URL: http://www.horde.org/apps/horde
Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
Source2: horde.conf
+Source3: horde-logrotate
BuildArch: noarch
BuildRequires: gettext
@@ -35,12 +37,16 @@ Requires(postun): %{__pear}
# Web stuff
Requires: mod_php
Requires: httpd
+Requires: %{_sysconfdir}/logrotate.d
+%if %{with_sysjs}
Requires: prototype-httpd
Requires: scriptaculous-httpd
Requires: syntaxhighlighter-httpd
-%if %{sysckeditor}
Requires: ckeditor
%else
+Requires: horde-prototype
+Requires: horde-scriptaculous
+Requires: horde-syntaxhighlighter
Requires: horde-ckeditor
%endif
# PHP stuff, from package.xml
@@ -164,7 +170,7 @@ cd %{pear_name}-%{version}
# Don't install .po and .pot files
# Remove checksum for .mo, as we regenerate them
-sed -e '/%{pear_name}.po/d' \
+sed -e '/%{pear_name}\.po/d' \
-e '/htaccess/d' \
-e '/%{pear_name}.mo/s/md5sum=.*name=/name=/' \
../package.xml >%{name}.xml
@@ -197,14 +203,45 @@ mkdir -p %{buildroot}%{_sysconfdir}
mv %{buildroot}%{pear_hordedir}/config \
%{buildroot}%{_sysconfdir}/horde
ln -s %{_sysconfdir}/horde %{buildroot}%{pear_hordedir}/config
-cp %{buildroot}%{_sysconfdir}/horde/conf.php.dist \
- %{buildroot}%{_sysconfdir}/horde/conf.php
install -Dpm 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf
-%if ! %{sysckeditor}
-sed -e '/ckeditor/d' -i %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf
+%if ! %{with_sysjs}
+sed -e '\:horde/js:d' \
+ -e '\:Javascript:d' \
+ -i %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf
%endif
+# Log
+install -dm 770 %{buildroot}%{_localstatedir}/log/horde
+cat <<EOF | tee -a %{buildroot}%{_sysconfdir}/horde/conf.php.dist
+\$conf['log']['name'] = '/var/log/horde/horde.log';
+\$conf['log']['params']['append'] = true;
+\$conf['log']['params']['format'] = 'default';
+\$conf['log']['type'] = 'file';
+\$conf['log']['enabled'] = true;
+EOF
+# Cache
+install -dm 770 %{buildroot}%{_localstatedir}/lib/horde/cache
+cat <<EOF | tee -a %{buildroot}%{_sysconfdir}/horde/conf.php.dist
+\$conf['cache']['default_lifetime'] = 86400;
+\$conf['cache']['params']['dir'] = '/var/lib/horde/cache';
+\$conf['cache']['params']['sub'] = 0;
+\$conf['cache']['driver'] = 'File';
+\$conf['cache']['use_memorycache'] = '';
+EOF
+# Static
+mv %{buildroot}%{pear_hordedir}/static \
+ %{buildroot}%{_localstatedir}/lib/horde/static
+ln -s %{_localstatedir}/lib/horde/static \
+ %{buildroot}%{pear_hordedir}/static
+
+# Logrotate
+install -Dm 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/horde
+
+# Configuration
+cp %{buildroot}%{_sysconfdir}/horde/conf.php.dist \
+ %{buildroot}%{_sysconfdir}/horde/conf.php
+
# Locales
for loc in locale/{??,??_??}
do
@@ -214,6 +251,17 @@ do
done | tee ../%{pear_name}.lang
+%pretrans
+if [ -d %{pear_hordedir}/static -a ! -L %{pear_hordedir}/static ]
+then
+ save=%{pear_hordedir}/static.rpmsave
+ while [ -e $save ]
+ do save=${save}_
+ done
+ mv %{pear_hordedir}/static $save
+fi
+
+
%post
%{__pear} install --nodeps --soft --force --register-only \
%{pear_xmldir}/%{name}.xml >/dev/null || :
@@ -228,6 +276,7 @@ fi
%files -f %{pear_name}.lang
%doc %{pear_docdir}/%{pear_name}
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
+%config(noreplace) %{_sysconfdir}/logrotate.d/horde
%attr(0770,apache,apache) %dir %{_sysconfdir}/horde
%attr(0770,apache,apache) %dir %{_sysconfdir}/horde/registry.d
%attr(0640,apache,apache) %config %{_sysconfdir}/horde/*.dist
@@ -251,9 +300,22 @@ fi
%{pear_hordedir}/js/plupload
%{pear_hordedir}/js/*.js
%{pear_datadir}/%{pear_name}
+%attr(750,apache,root) %dir %{_localstatedir}/log/horde
+%attr(750,apache,root) %dir %{_localstatedir}/lib/horde
+%attr(750,apache,root) %dir %{_localstatedir}/lib/horde/cache
+%attr(750,apache,root) %dir %{_localstatedir}/lib/horde/static
+%{_localstatedir}/lib/horde/static/README
%changelog
+* Tue Sep 23 2014 Remi Collet <remi at fedoraproject.org> - 5.2.1-2
+- don't use system javascript libraries as this breaks horde
+ and its cache system
+- use /var/log/horde for logging
+- use /var/lib/horde/cache for caching
+- use /var/lib/horde/static for js and css cache
+- fix regex filter, fix missing horde-power*.png
+
* Mon Aug 04 2014 Remi Collet <remi at fedoraproject.org> - 5.2.1-1
- Update to 5.2.1
More information about the scm-commits
mailing list