From 52c58901e6a3c832d51b1eb598d7e67f7231da1d Mon Sep 17 00:00:00 2001 From: SJ Date: Sat, 2 Nov 2013 15:02:35 +0100 Subject: [PATCH] improved rpm build --- piler.spec | 4 ++++ util/postinstall.sh.in | 19 +++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/piler.spec b/piler.spec index cd5edefb..c33f0ab5 100644 --- a/piler.spec +++ b/piler.spec @@ -1,6 +1,7 @@ %define name piler %define version 0.1.25 %define release 2 +%define myhostname piler.yourdomain.com Summary: an email archiving application Name: %{name} @@ -30,6 +31,8 @@ make clean all mkdir -p /root/rpmbuild/BUILDROOT/piler-0.1.25-2.x86_64/etc/init.d mkdir -p /root/rpmbuild/BUILDROOT/piler-0.1.25-2.x86_64/usr/local/lib make install DESTDIR=/root/rpmbuild/BUILDROOT/piler-0.1.25-2.x86_64 +mkdir -p /root/rpmbuild/BUILDROOT/piler-0.1.25-2.x86_64/var/www +cp -R webui /root/rpmbuild/BUILDROOT/piler-0.1.25-2.x86_64/var/www/%{myhostname} %files @@ -40,6 +43,7 @@ make install DESTDIR=/root/rpmbuild/BUILDROOT/piler-0.1.25-2.x86_64 %dir /var/piler/store %dir /var/piler/stat %dir /var/run/piler +%dir /var/www/%{myhostname} %attr(0655,piler,piler) /usr/local/bin/pileraget %attr(0655,piler,piler) /usr/local/bin/pilerexport %attr(0655,piler,piler) /usr/local/bin/pilerget diff --git a/util/postinstall.sh.in b/util/postinstall.sh.in index ae0571a6..6a657870 100755 --- a/util/postinstall.sh.in +++ b/util/postinstall.sh.in @@ -389,18 +389,25 @@ execute_post_install_tasks() { chmod 755 $LOCALSTATEDIR/piler/stat - if [ -d webui ]; then webui_install; fi + if [ -d webui ]; then + echo -n "Copying www files to $DOCROOT... " + mkdir -p $DOCROOT || exit 1 + cp -R webui/* $DOCROOT + cp -R webui/.htaccess $DOCROOT + fi + + if [ -d /var/www/piler.yourdomain.com ]; then + mv /var/www/piler.yourdomain.com $DOCROOT + fi + + + if [ -d $DOCROOT ]; then webui_install; fi } webui_install() { - echo -n "Copying www files to $DOCROOT... " - mkdir -p $DOCROOT || exit 1 - - cp -R webui/* $DOCROOT - cp -R webui/.htaccess $DOCROOT chmod 770 $DOCROOT/tmp $DOCROOT/images chgrp $WWWGROUP $DOCROOT/tmp chgrp $WWWGROUP $DOCROOT/system/helper/phpqrcode/cache