[longomatch] Simplify linux packaging



commit af410637c70ef66f9020ae5082e30ba5235dff0c
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Mar 29 19:01:25 2014 +0100

    Simplify linux packaging

 configure.ac        |    1 +
 tools/deb-pkg.sh    |   43 -------------------------------------------
 tools/deb-pkg.sh.in |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+), 43 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5ab618c..6bd4ebb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -136,6 +136,7 @@ LongoMatch/Makefile
 LongoMatch/longomatch
 LongoMatch/longomatch.desktop.in
 LongoMatch/AssemblyInfo.cs
+tools/deb-pkg.sh
 
 po/Makefile.in
 ])
diff --git a/tools/deb-pkg.sh.in b/tools/deb-pkg.sh.in
new file mode 100644
index 0000000..289b029
--- /dev/null
+++ b/tools/deb-pkg.sh.in
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# Creates a debian package for longomatch and uploads it to the ppa
+# USAGE: $./deb-pkg.sh 1
+
+if [ $# -ne 1 ]
+then
+  echo "Usage: `basename $0` DEB_VERSION"
+  exit 1
+fi
+
+BUILD_DIR=`pwd`"/build"
+PKG_NAME= PACKAGE@
+PKG_VERSION= VERSION@
+DEB_VERSION=$1
+
+package () {
+       DIST=$1                                 # karmic
+       DEB_RELEASE=$DIST$DEB_VERSION           # karmic
+       RELEASE=$PKG_NAME-$PKG_VERSION          # longomatch-x.y.z
+       TARBALL=$RELEASE.tar.gz                 # longomatch-x.y.z.tar.gz
+       ORIG=$RELEASE~$DEB_RELEASE.orig.tar.gz  # longomatch-x.y.z~karmicw.orig.tar.gz
+       DEST=$RELEASE~$DEB_RELEASE              # longomatch-x.y.z~karmicw
+
+       mkdir -p $BUILD_DIR
+       echo "Copy $TARBALL to $BUILD_DIR/$ORIG"
+       cp $TARBALL $BUILD_DIR/$ORIG
+       echo `pwd $BUILD_DIR`
+       cd $BUILD_DIR
+       echo "Extract $ORIG"
+       tar xvzf $ORIG
+       echo "Move $RELEASE to $DEST"
+       mv $RELEASE $DEST
+       echo "Copy debian folder to $DEST"
+       cp -R ../debian $DEST/
+       cd $DEST
+       rm debian/changelog
+       export DEBEMAIL=ylatuya gmail com
+       echo "Create changelog dch --create --empty -v $PKG_VERSION~$DEB_RELEASE  --package $PKG_NAME 
--distribution $DIST"
+       dch --create -v $PKG_VERSION~$DEB_RELEASE  --package $PKG_NAME --distribution $DIST
+       dpkg-buildpackage -S
+       cd $BUILD_DIR
+       dput ppa:ylatuya/ppa $PKG_NAME\_$PKG_VERSION~$DEB_RELEASE\_source.changes
+}
+
+for dist in saucy quantal precise raring; do
+       package ($dist)
+done


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]