More improvements to debpkg target.

The generated deb has been confirmed to install and run
on a fresh ubuntu/trusty64 vagrant box.
This commit is contained in:
John MacFarlane 2014-12-17 16:38:11 -08:00
parent b1a9b1a696
commit e60efdd98f
2 changed files with 13 additions and 5 deletions

View file

@ -2,7 +2,7 @@ Package: pandoc
Version: VERSION Version: VERSION
Section: text Section: text
Priority: optional Priority: optional
Architecture: all Architecture: ARCHITECTURE
Depends: libc6 (>= 2.11), libgmp10, zlib1g (>= 1:1.1.4) Depends: libc6 (>= 2.11), libgmp10, zlib1g (>= 1:1.1.4)
Maintainer: John MacFarlane <jgm@berkeley.edu> Maintainer: John MacFarlane <jgm@berkeley.edu>
Description: general markup converter Description: general markup converter

View file

@ -1,17 +1,24 @@
#!/bin/bash -e #!/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 SANDBOX=`pwd`/.cabal-sandbox
VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}') VERSION=$(grep -e '^Version' pandoc.cabal | awk '{print $2}')
DEBPKGVER=1 DEBPKGVER=1
DEBVER=$VERSION-$DEBPKGVER DEBVER=$VERSION-$DEBPKGVER
BASE=pandoc-$DEBVER BASE=pandoc-$DEBVER-$ARCHITECTURE
DIST=`pwd`/$BASE DIST=`pwd`/$BASE
MANDIR=`pwd`/man MANDIR=`pwd`/man
DEST=$DIST/usr/local DEST=$DIST/usr/local
ME=$(whoami) ME=$(whoami)
echo "DEBVER = $DEBVER"
# echo Removing old files... # echo Removing old files...
rm -rf $DIST rm -rf $DIST
@ -45,7 +52,8 @@ install $PANDOC_CITEPROC_PATH/LICENSE $DEST/share/doc/pandoc-citeproc/LICENSE
rm -rf make_binary_package.tmp.$$ rm -rf make_binary_package.tmp.$$
mkdir $DIST/DEBIAN 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 dpkg-deb --build $DIST
rm -rf $DIST rm -rf $DIST