From 1b498a8bd9e89d1aa35bdcf38af6ecdc607d0ea2 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Mon, 30 Jul 2012 11:38:42 -0400 Subject: [PATCH] Commit scripts to help building packages --- packageDebian.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ packageRPM.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 packageDebian.sh create mode 100644 packageRPM.sh diff --git a/packageDebian.sh b/packageDebian.sh new file mode 100644 index 0000000..e02fdca --- /dev/null +++ b/packageDebian.sh @@ -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." diff --git a/packageRPM.sh b/packageRPM.sh new file mode 100644 index 0000000..8e65e9d --- /dev/null +++ b/packageRPM.sh @@ -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."