]> git.pld-linux.org Git - packages/bacula-web.git/blobdiff - bacula-web.spec
- use external libs, add cachedir
[packages/bacula-web.git] / bacula-web.spec
index 193ae3969a32f3a99c5e9923c81612c6c02f3a69..01fe4a120679c215ca50fe36b62b2ff1582fe638 100644 (file)
@@ -1,25 +1,26 @@
 %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)
@@ -28,6 +29,7 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %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
@@ -42,32 +44,37 @@ information from your bacula catalog's database.
 
 %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}
 
@@ -99,6 +106,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_appdir}/config
 %{_appdir}/style
 %{_appdir}/templates
+%{_appdir}/templates_c
 
 %dir %{_appdir}/core
 %{_appdir}/core/bweb.inc.php
@@ -117,9 +125,4 @@ rm -rf $RPM_BUILD_ROOT
 %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}
This page took 0.063929 seconds and 4 git commands to generate.