Commit scripts to help building packages

Release_1.4_Bugfix
Bradlee Speice 2012-07-30 11:38:42 -04:00
parent fa1a7432c0
commit 1b498a8bd9
2 changed files with 110 additions and 0 deletions

55
packageDebian.sh Normal file
View File

@ -0,0 +1,55 @@
#!/bin/bash -
#===============================================================================
#
# FILE: packageDebian.sh
#
# USAGE: ./packageDebian.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Bradlee Speice (), bspeice@uncc.edu
# ORGANIZATION:
# REVISION: ---
#===============================================================================
#This script is a simple wrapper for building the .deb packages for libcvautomation
#It is not intended to be bullet-proof - if it gets broken I will do my best to
#provide bugfixes, but this is a fairly low priority.
#Also, this script is intended to be run from the Git source, and *not* from
#a release tarball.
set -o errexit
if [ -z "$1" ]; then
echo "Building without signing the package..."
fi
PACKAGE_NAME=`grep AC_INIT configure.ac | cut -d'(' -f2 | cut -d',' -f1`
PACKAGE_VERSION=`grep AC_INIT configure.ac | cut -d',' -f2 | tr -d [:space:]`
./autogen.sh
./configure
make -j`grep processor /proc/cpuinfo | wc -l`
make dist
BUILD_DIR=`mktemp -d`
TARBALL="${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz"
cp $TARBALL $BUILD_DIR
cd $BUILD_DIR
cp $TARBALL `echo $TARBALL | sed 's/-/_/g;s/tar/orig.tar/'`
tar xf $TARBALL
cd $PACKAGE_NAME-$PACKAGE_VERSION/debian
if [ -z "$1" ]; then
debuild
else
debuild -k$1
fi
echo "Package successfully built in $BUILD_DIR."

55
packageRPM.sh Normal file
View File

@ -0,0 +1,55 @@
#!/bin/bash -
#===============================================================================
#
# FILE: packageRPM.sh
#
# USAGE: ./packageRPM.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Bradlee Speice (), bspeice.nc@gmail.com
# ORGANIZATION:
# CREATED: 07/30/2012 11:29:28 AM EDT
# REVISION: ---
#===============================================================================
#This script is a simple wrapper for building the .rpm packages for libcvautomation
#It is not intended to be bullet-proof - if it gets broken I will do my best to
#provide bugfixes, but this is a fairly low priority.
#Also, this script is intended to be run from the Git source, and *not* from
#a release tarball.
set -o errexit
if [ -z "$SIGN_PACKAGE" ]; then
echo "Building without signing packages..."
fi
PACKAGE_NAME=`grep AC_INIT configure.ac | cut -d'(' -f2 | cut -d',' -f1`
PACKAGE_VERSION=`grep AC_INIT configure.ac | cut -d',' -f2 | tr -d [:space:]`
./autogen.sh
./configure
make -j`grep processor /proc/cpuinfo | wc -l`
make dist
if [ ! -d $HOME/rpmbuild ]; then
echo "Could not find the rpmbuild directory!"
echo "Please make sure your packaging environment is set up correctly."
fi
TARBALL="${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz"
cp $TARBALL $HOME/rpmbuild/SOURCES
cp rpm/libcvautomation.spec $HOME/rpmbuild/SPECS
cd $HOME/rpmbuild/SPECS
if [ -z "$SIGN_PACKAGE" ]; then
rpmbuild -ba libcvautomation.spec
else
rpmbuild -ba --sign libcvautomation.spec
fi
echo "Package successfully built in $HOME/rpmbuild/RPMS."