2010-05-18 Miguel de Dios <miguel.dedios@artica.es>

* 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
This commit is contained in:
mdtrooper 2010-05-19 16:29:14 +00:00
parent 659cfe1c17
commit d5c73f4fca
1 changed files with 91 additions and 56 deletions

View File

@ -14,34 +14,62 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # 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." package_pear=1
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null package_pandora=1
if [ $? = 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 then
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." echo "No found \"dpkg-deb\" aplication, please install."
exit 1 exit 1
else else
echo "Found \"dpkg-debs\"." echo "Found \"dpkg-debs\"."
fi
fi fi
whereis dh-make-pear | cut -d":" -f2 | grep dh-make-pear > /dev/null if [ $package_pear -eq 1 ]
if [ $? = 1 ]
then then
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." echo " \"dh-make-pear\" aplication not found, please install."
exit 1 exit 1
else else
echo "Found \"dh-make-pear\"." echo "Found \"dh-make-pear\"."
fi fi
whereis fakeroot | cut -d":" -f2 | grep fakeroot > /dev/null whereis fakeroot | cut -d":" -f2 | grep fakeroot > /dev/null
if [ $? = 1 ] if [ $? = 1 ]
then then
echo " \"fakeroot\" aplication not found, please install." echo " \"fakeroot\" aplication not found, please install."
exit 1 exit 1
else else
echo "Found \"fakeroot\"." echo "Found \"fakeroot\"."
fi
fi fi
whereis dpkg-buildpackage | cut -d":" -f2 | grep dpkg-buildpackage > /dev/null whereis dpkg-buildpackage | cut -d":" -f2 | grep dpkg-buildpackage > /dev/null
@ -56,17 +84,20 @@ fi
cd .. cd ..
echo "Make a \"temp_package\" temporary dir for job." 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." 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 $(ls | grep -v temp_package | grep -v DEBIAN ) temp_package/var/www/pandora_console
cp -R DEBIAN temp_package cp -R DEBIAN temp_package
find temp_package/var/www/pandora_console -name ".svn" | xargs rm -Rf find temp_package/var/www/pandora_console -name ".svn" | xargs rm -Rf
rm -Rf temp_package/var/www/pandora_console/pandora_console.spec rm -Rf temp_package/var/www/pandora_console/pandora_console.spec
echo "Calculate md5sum for md5sums package control file." echo "Calculate md5sum for md5sums package control file."
for item in `find temp_package` for item in `find temp_package`
do do
echo -n "." echo -n "."
if [ ! -d $item ] if [ ! -d $item ]
then then
@ -81,21 +112,25 @@ do
echo $md5" "$final_path >> temp_package/DEBIAN/md5sums echo $md5" "$final_path >> temp_package/DEBIAN/md5sums
fi fi
fi fi
done done
echo "END" echo "END"
echo "Make the package \"Pandorafms console\"." echo "Make the package \"Pandorafms console\"."
dpkg-deb --build temp_package dpkg-deb --build temp_package
mv temp_package.deb pandorafms.console_$pandora_console_version.deb mv temp_package.deb pandorafms.console_$pandora_console_version.deb
fi
echo "Make the package \"php-xml-rpc\"." if [ $package_pear -eq 1 ]
cd temp_package then
dh-make-pear --maintainer "Miguel de Dios <miguel.dedios@artica.es>" XML_RPC echo "Make the package \"php-xml-rpc\"."
cd php-xml-rpc-* cd temp_package
dpkg-buildpackage -rfakeroot dh-make-pear --maintainer "Miguel de Dios <miguel.dedios@artica.es>" XML_RPC
cd .. cd php-xml-rpc-*
mv php-xml-rpc*.deb .. dpkg-buildpackage -rfakeroot
cd .. cd ..
mv php-xml-rpc*.deb ..
cd ..
fi
echo "Delete the \"temp_package\" temporary dir for job." echo "Delete the \"temp_package\" temporary dir for job."