packages: bacula-web/apache.conf, bacula-web/bacula-web.spec, bacula-web/sy...

glen glen at pld-linux.org
Sat Apr 7 14:00:15 CEST 2012


Author: glen                         Date: Sat Apr  7 12:00:15 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- use external libs, add cachedir

---- Files affected:
packages/bacula-web:
   apache.conf (1.2 -> 1.3) , bacula-web.spec (1.9 -> 1.10) , sys-libs.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/bacula-web/apache.conf
diff -u packages/bacula-web/apache.conf:1.2 packages/bacula-web/apache.conf:1.3
--- packages/bacula-web/apache.conf:1.2	Sat Apr  7 13:27:40 2012
+++ packages/bacula-web/apache.conf	Sat Apr  7 14:00:10 2012
@@ -1,6 +1,14 @@
+Alias /bacula-web/templates_c/ /var/cache/bacula-web/
 Alias /bacula-web /usr/share/bacula-web
 <Directory /usr/share/bacula-web>
 	allow from all
+</Directory>
+
+<Directory /var/cache/bacula-web>
+	deny from all
+	<Files *.png>
+		allow from all
+	</Files>
 </Directory>
 
 <Directory /usr/share/bacula-web/config>

================================================================
Index: packages/bacula-web/bacula-web.spec
diff -u packages/bacula-web/bacula-web.spec:1.9 packages/bacula-web/bacula-web.spec:1.10
--- packages/bacula-web/bacula-web.spec:1.9	Sat Apr  7 13:27:40 2012
+++ packages/bacula-web/bacula-web.spec	Sat Apr  7 14:00:10 2012
@@ -1,26 +1,27 @@
 # $Revision$, $Date$
 %define		php_min_version 5.2.4
-#%include	/usr/lib/rpm/macros.php
+%include	/usr/lib/rpm/macros.php
 Summary:	Open source monitoring and reporting tool for Bacula
 Name:		bacula-web
 Version:	5.2.2
-Release:	0.3
+Release:	1
 License:	GPL v2
 Group:		Applications/WWW
 URL:		http://www.bacula-web.org/
 Source0:	http://www.bacula-web.org/tl_files/downloads/%{name}.%{version}.tar.gz
 # Source0-md5:	b52253963cc6edb6437a0dbe59c6051f
 Source1:	apache.conf
+Patch0:		sys-libs.patch
 BuildRequires:	rpm-php-pearprov >= 4.4.2-11
 BuildRequires:	rpmbuild(macros) >= 1.268
 BuildRequires:	sed >= 4.0
-#Requires:	php-Smarty
+Requires:	Smarty
+Requires:	Smarty-plugin-gettext
 Requires:	php-common >= 4:%{php_min_version}
 Requires:	php-gd
 Requires:	php-gettext
 Requires:	php-pdo
 Requires:	phplot
-Requires:	smarty-gettext
 Requires:	webserver(php)
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -29,6 +30,7 @@
 %define		_webapp		%{name}
 %define		_sysconfdir	%{_webapps}/%{_webapp}
 %define		_appdir		%{_datadir}/%{_webapp}
+%define		cachedir	/var/cache/%{name}
 %define		_smartyplugindir	%{php_data_dir}/Smarty/plugins
 
 # bad depsolver
@@ -43,32 +45,37 @@
 
 %prep
 %setup -qc
+%patch0 -p1
 
 mv config/config.php{.sample,}
 rm locale/*/LC_MESSAGES/*.po
-
-# nonstandard plugins
-install -d smarty-plugins
-#mv core/external/smarty/libs/plugins/modifier.fsize_format.php smarty-plugins
-
-%{__rm} -r templates_c
-#external_packages
+mv core/external .
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir},%{cachedir}}
 cp -a *.php core locale style templates $RPM_BUILD_ROOT%{_appdir}
-#cp -a smarty-plugins/* $RPM_BUILD_ROOT%{_smartyplugindir}
 
 cp -a config/* $RPM_BUILD_ROOT%{_sysconfdir}
 ln -s %{_sysconfdir} $RPM_BUILD_ROOT%{_appdir}/config
 
+ln -s %{cachedir} $RPM_BUILD_ROOT%{_appdir}/templates_c
+
 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
 cp -p $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+# cleanup cache from previous rpm
+echo %{cachedir}/* | xargs rm -f
+
+%preun
+if [ "$1" = 0 ]; then
+	echo %{cachedir}/* | xargs rm -f
+fi
+
 %triggerin -- apache1 < 1.3.37-3, apache1-base
 %webapp_register apache %{_webapp}
 
@@ -100,6 +107,7 @@
 %{_appdir}/config
 %{_appdir}/style
 %{_appdir}/templates
+%{_appdir}/templates_c
 
 %dir %{_appdir}/core
 %{_appdir}/core/bweb.inc.php
@@ -118,12 +126,7 @@
 %lang(it) %{_appdir}/locale/it_IT
 %lang(sv) %{_appdir}/locale/sv_SV
 
-%dir %{_appdir}/core/external
-%{_appdir}/core/external/phplot
-%{_appdir}/core/external/smarty
-%{_appdir}/core/external/smarty_gettext-0.9
-
-#%{_appdir}/templates_c
+%dir %attr(775,root,http) %{cachedir}
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -131,6 +134,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.10  2012/04/07 12:00:10  glen
+- use external libs, add cachedir
+
 Revision 1.9  2012/04/07 11:27:40  glen
 - start updating to 5.2.2
 

================================================================
Index: packages/bacula-web/sys-libs.patch
diff -u /dev/null packages/bacula-web/sys-libs.patch:1.1
--- /dev/null	Sat Apr  7 14:00:15 2012
+++ packages/bacula-web/sys-libs.patch	Sat Apr  7 14:00:10 2012
@@ -0,0 +1,23 @@
+--- bacula-web-5.2.2/config/global.inc.php~	2011-12-04 15:14:21.000000000 +0200
++++ bacula-web-5.2.2/config/global.inc.php	2012-04-07 14:43:17.230952000 +0300
+@@ -18,8 +18,8 @@
+  define( 'BW_OBJ', BW_ROOT . '/core/' ); 
+  define( 'BW_EXTERNAL', BW_OBJ . 'external' );
+  
+- define( 'BW_PHPLOT', BW_EXTERNAL . '/phplot/'  );					
+- define( 'BW_SMARTY', BW_EXTERNAL . '/smarty/libs/' );				
++ define( 'BW_PHPLOT', '/usr/share/php/phplot/'  );					
++ define( 'BW_SMARTY', '/usr/share/php/Smarty/' );				
+  define( 'BW_SMARTY_GETTEXT', BW_EXTERNAL . '/smarty_gettext-0.9/' );
+  
+  
+@@ -27,8 +27,7 @@
+  require_once BW_OBJ . "bweb.inc.php";
+  
+  // Template engine
+- require_once( BW_SMARTY . "Smarty.class.php");			
+- require_once( BW_SMARTY_GETTEXT . "smarty_gettext.php" );		
++ require_once( "Smarty.class.php");			
+  
+  // Configuration 
+  require_once BW_OBJ . "cfg/config.class.php";
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/packages/bacula-web/apache.conf?r1=1.2&r2=1.3
    http://cvs.pld-linux.org/packages/bacula-web/bacula-web.spec?r1=1.9&r2=1.10



More information about the pld-cvs-commit mailing list