summaryrefslogtreecommitdiff
path: root/make_deb.sh
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-17 16:38:11 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-17 16:38:11 -0800
commite60efdd98f6fefd69cb2c02395ac8a0fa7b0dfdf (patch)
tree0878d608e1cfb07ba7329216c28ec021784af8fd /make_deb.sh
parentb1a9b1a696a48fcd21133fef451db2fd28efb1c5 (diff)
More improvements to debpkg target.
The generated deb has been confirmed to install and run on a fresh ubuntu/trusty64 vagrant box.
Diffstat (limited to 'make_deb.sh')
-rwxr-xr-xmake_deb.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/make_deb.sh b/make_deb.sh
index 0883c911e..fcf82accc 100755
--- a/make_deb.sh
+++ b/make_deb.sh
@@ -1,17 +1,24 @@
#!/bin/bash -e
+MACHINE=$(uname -m)
+if [ "$MACHINE" = "x86_64" ]; then
+ ARCHITECTURE=amd64
+elif [ "$MACHINE" = "i686" ]; then
+ ARCHICTECTURE=i386
+elif [ "$MACHINE" = "i386" ]; then
+ ARCHICTECTURE=i386
+fi
+
SANDBOX=`pwd`/.cabal-sandbox
VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
DEBPKGVER=1
DEBVER=$VERSION-$DEBPKGVER
-BASE=pandoc-$DEBVER
+BASE=pandoc-$DEBVER-$ARCHITECTURE
DIST=`pwd`/$BASE
MANDIR=`pwd`/man
DEST=$DIST/usr/local
ME=$(whoami)
-echo "DEBVER = $DEBVER"
-
# echo Removing old files...
rm -rf $DIST
@@ -45,7 +52,8 @@ install $PANDOC_CITEPROC_PATH/LICENSE $DEST/share/doc/pandoc-citeproc/LICENSE
rm -rf make_binary_package.tmp.$$
mkdir $DIST/DEBIAN
-perl -pe "s/VERSION/$DEBVER/" deb/control.in > $DIST/DEBIAN/control
+perl -pe "s/VERSION/$DEBVER/" deb/control.in | \
+ perl -pe "s/ARCHITECTURE/$ARCHITECTURE/" > $DIST/DEBIAN/control
dpkg-deb --build $DIST
rm -rf $DIST