From cf99725ce4ff3080bb0131b42b8eb89da4a1b475 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 19 May 2010 16:29:14 +0000 Subject: [PATCH] 2010-05-18 Miguel de Dios * DEBIAN/make_deb_package.sh: added parameter to make only packages of pear modules or not. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2753 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/DEBIAN/make_deb_package.sh | 147 +++++++++++++-------- 1 file changed, 91 insertions(+), 56 deletions(-) diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 9167031807..6287a46e5f 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,34 +14,62 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_console_version="3.0.0" +pandora_console_version="3.1.0" -echo "Test if you have all the needed tools to make the packages." -whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null -if [ $? = 1 ] +package_pear=1 +package_pandora=1 + +for param in $@ +do + if [ $param = "-h" -o $param = "--help" ] + then + echo "For only make packages of pear type +pear" + echo "For not make packages of pear type -pear" + exit 0 + fi + + if [ $param = "+pear" ] + then + package_pandora=0 + fi + if [ $param = "-pear" ] + then + package_pear=0 + fi +done + +if [ $package_pandora -eq 1 ] then - echo "No found \"dpkg-deb\" aplication, please install." - exit 1 -else - echo "Found \"dpkg-debs\"." + echo "Test if you have all the needed tools to make the packages." + whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null + if [ $? = 1 ] + then + echo "No found \"dpkg-deb\" aplication, please install." + exit 1 + else + echo "Found \"dpkg-debs\"." + fi fi -whereis dh-make-pear | cut -d":" -f2 | grep dh-make-pear > /dev/null -if [ $? = 1 ] +if [ $package_pear -eq 1 ] then - echo " \"dh-make-pear\" aplication not found, please install." - exit 1 -else - echo "Found \"dh-make-pear\"." -fi + whereis dh-make-pear | cut -d":" -f2 | grep dh-make-pear > /dev/null + if [ $? = 1 ] + then + echo " \"dh-make-pear\" aplication not found, please install." + exit 1 + else + echo "Found \"dh-make-pear\"." + fi -whereis fakeroot | cut -d":" -f2 | grep fakeroot > /dev/null -if [ $? = 1 ] -then - echo " \"fakeroot\" aplication not found, please install." - exit 1 -else - echo "Found \"fakeroot\"." + whereis fakeroot | cut -d":" -f2 | grep fakeroot > /dev/null + if [ $? = 1 ] + then + echo " \"fakeroot\" aplication not found, please install." + exit 1 + else + echo "Found \"fakeroot\"." + fi fi whereis dpkg-buildpackage | cut -d":" -f2 | grep dpkg-buildpackage > /dev/null @@ -56,46 +84,53 @@ fi cd .. echo "Make a \"temp_package\" temporary dir for job." -mkdir -p temp_package/var/www/pandora_console +mkdir -p temp_package +if [ $package_pandora -eq 1 ] +then + mkdir -p temp_package/var/www/pandora_console -echo "Make directory system tree for package." -cp -R $(ls | grep -v temp_package | grep -v DEBIAN ) temp_package/var/www/pandora_console -cp -R DEBIAN temp_package -find temp_package/var/www/pandora_console -name ".svn" | xargs rm -Rf -rm -Rf temp_package/var/www/pandora_console/pandora_console.spec + echo "Make directory system tree for package." + cp -R $(ls | grep -v temp_package | grep -v DEBIAN ) temp_package/var/www/pandora_console + cp -R DEBIAN temp_package + find temp_package/var/www/pandora_console -name ".svn" | xargs rm -Rf + rm -Rf temp_package/var/www/pandora_console/pandora_console.spec -echo "Calculate md5sum for md5sums package control file." -for item in `find temp_package` -do - echo -n "." - if [ ! -d $item ] - then - echo $item | grep "DEBIAN" > /dev/null - #last command success - if [ $? -eq 1 ] + echo "Calculate md5sum for md5sums package control file." + for item in `find temp_package` + do + echo -n "." + if [ ! -d $item ] then - md5=`md5sum $item | cut -d" " -f1` - - #delete "temp_package" in the path - final_path=${item#temp_package} - echo $md5" "$final_path >> temp_package/DEBIAN/md5sums + echo $item | grep "DEBIAN" > /dev/null + #last command success + if [ $? -eq 1 ] + then + md5=`md5sum $item | cut -d" " -f1` + + #delete "temp_package" in the path + final_path=${item#temp_package} + echo $md5" "$final_path >> temp_package/DEBIAN/md5sums + fi fi - fi -done -echo "END" + done + echo "END" -echo "Make the package \"Pandorafms console\"." -dpkg-deb --build temp_package -mv temp_package.deb pandorafms.console_$pandora_console_version.deb + echo "Make the package \"Pandorafms console\"." + dpkg-deb --build temp_package + mv temp_package.deb pandorafms.console_$pandora_console_version.deb +fi -echo "Make the package \"php-xml-rpc\"." -cd temp_package -dh-make-pear --maintainer "Miguel de Dios " XML_RPC -cd php-xml-rpc-* -dpkg-buildpackage -rfakeroot -cd .. -mv php-xml-rpc*.deb .. -cd .. +if [ $package_pear -eq 1 ] +then + echo "Make the package \"php-xml-rpc\"." + cd temp_package + dh-make-pear --maintainer "Miguel de Dios " XML_RPC + cd php-xml-rpc-* + dpkg-buildpackage -rfakeroot + cd .. + mv php-xml-rpc*.deb .. + cd .. +fi echo "Delete the \"temp_package\" temporary dir for job."