Browse Source

Commit scripts to help building packages

Bradlee Speice 7 years ago
parent
commit
1b498a8bd9
2 changed files with 110 additions and 0 deletions
  1. 55
    0
      packageDebian.sh
  2. 55
    0
      packageRPM.sh

+ 55
- 0
packageDebian.sh View File

@@ -0,0 +1,55 @@
1
+#!/bin/bash - 
2
+#===============================================================================
3
+#
4
+#          FILE: packageDebian.sh
5
+# 
6
+#         USAGE: ./packageDebian.sh 
7
+# 
8
+#   DESCRIPTION: 
9
+# 
10
+#       OPTIONS: ---
11
+#  REQUIREMENTS: ---
12
+#          BUGS: ---
13
+#         NOTES: ---
14
+#        AUTHOR: Bradlee Speice (), bspeice@uncc.edu
15
+#  ORGANIZATION: 
16
+#      REVISION:  ---
17
+#===============================================================================
18
+
19
+#This script is a simple wrapper for building the .deb packages for libcvautomation
20
+#It is not intended to be bullet-proof - if it gets broken I will do my best to
21
+#provide bugfixes, but this is a fairly low priority.
22
+
23
+#Also, this script is intended to be run from the Git source, and *not* from
24
+#a release tarball.
25
+
26
+set -o errexit
27
+
28
+if [ -z "$1" ]; then
29
+	echo "Building without signing the package..."
30
+fi
31
+
32
+PACKAGE_NAME=`grep AC_INIT configure.ac | cut -d'(' -f2 | cut -d',' -f1`
33
+PACKAGE_VERSION=`grep AC_INIT configure.ac | cut -d',' -f2 | tr -d [:space:]`
34
+
35
+./autogen.sh
36
+./configure
37
+make -j`grep processor /proc/cpuinfo | wc -l`
38
+make dist
39
+
40
+BUILD_DIR=`mktemp -d`
41
+TARBALL="${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz"
42
+cp $TARBALL $BUILD_DIR
43
+cd $BUILD_DIR
44
+
45
+cp $TARBALL `echo $TARBALL | sed 's/-/_/g;s/tar/orig.tar/'`
46
+tar xf $TARBALL
47
+cd $PACKAGE_NAME-$PACKAGE_VERSION/debian
48
+
49
+if [ -z "$1" ]; then
50
+	debuild
51
+else
52
+	debuild -k$1
53
+fi
54
+
55
+echo "Package successfully built in $BUILD_DIR."

+ 55
- 0
packageRPM.sh View File

@@ -0,0 +1,55 @@
1
+#!/bin/bash - 
2
+#===============================================================================
3
+#
4
+#          FILE: packageRPM.sh
5
+# 
6
+#         USAGE: ./packageRPM.sh 
7
+# 
8
+#   DESCRIPTION: 
9
+# 
10
+#       OPTIONS: ---
11
+#  REQUIREMENTS: ---
12
+#          BUGS: ---
13
+#         NOTES: ---
14
+#        AUTHOR: Bradlee Speice (), bspeice.nc@gmail.com
15
+#  ORGANIZATION: 
16
+#       CREATED: 07/30/2012 11:29:28 AM EDT
17
+#      REVISION:  ---
18
+#===============================================================================
19
+
20
+#This script is a simple wrapper for building the .rpm packages for libcvautomation
21
+#It is not intended to be bullet-proof - if it gets broken I will do my best to
22
+#provide bugfixes, but this is a fairly low priority.
23
+
24
+#Also, this script is intended to be run from the Git source, and *not* from
25
+#a release tarball.
26
+set -o errexit
27
+
28
+if [ -z "$SIGN_PACKAGE" ]; then
29
+	echo "Building without signing packages..."
30
+fi
31
+
32
+PACKAGE_NAME=`grep AC_INIT configure.ac | cut -d'(' -f2 | cut -d',' -f1`
33
+PACKAGE_VERSION=`grep AC_INIT configure.ac | cut -d',' -f2 | tr -d [:space:]`
34
+
35
+./autogen.sh
36
+./configure
37
+make -j`grep processor /proc/cpuinfo | wc -l`
38
+make dist
39
+
40
+if [ ! -d $HOME/rpmbuild ]; then
41
+	echo "Could not find the rpmbuild directory!"
42
+	echo "Please make sure your packaging environment is set up correctly."
43
+fi
44
+
45
+TARBALL="${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.gz"
46
+cp $TARBALL $HOME/rpmbuild/SOURCES
47
+cp rpm/libcvautomation.spec $HOME/rpmbuild/SPECS
48
+cd $HOME/rpmbuild/SPECS
49
+if [ -z "$SIGN_PACKAGE" ]; then
50
+	rpmbuild -ba libcvautomation.spec
51
+else
52
+	rpmbuild -ba --sign libcvautomation.spec
53
+fi
54
+
55
+echo "Package successfully built in $HOME/rpmbuild/RPMS."

Loading…
Cancel
Save