From 15bcfa34e5d43f8c5285417d5ed5c77729262ac6 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 20 Jun 2018 00:58:26 +0200 Subject: [PATCH] WIP: updated deb production script. --- scripts/makedeb.sh | 63 +++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/scripts/makedeb.sh b/scripts/makedeb.sh index 83e696e20..9f6f7f69e 100755 --- a/scripts/makedeb.sh +++ b/scripts/makedeb.sh @@ -39,14 +39,21 @@ umask 0022 echo "Checking $bits installation" echo "----------------------------------------" -bindir="bin.linux.release" +bininstdir="bin.linux.release" builddir="build.linux.release" -libdir="/usr/lib/klayout" + +# destination folders +sharedir="usr/share" +bindir="usr/bin" +libdir="usr/lib/klayout" + +# TODO: is there a better way to produce this path? +pylibdir="usr/lib/python3/dist-packages/klayout" ./build.sh -j2 \ - -bin $bindir \ + -bin $bininstdir \ -build $builddir \ - -rpath $libdir + -rpath /$libdir if [ "$bits" = "32" ]; then arch="i386" @@ -72,44 +79,54 @@ tar xf data.tar rm data.tar cd .. -mkdir -p makedeb-tmp/usr/share/doc/klayout -mkdir -p makedeb-tmp/usr/share/applications -mkdir -p makedeb-tmp/usr/share/pixmaps -mkdir -p makedeb-tmp/usr/lib/klayout -mkdir -p makedeb-tmp/usr/bin +mkdir -p makedeb-tmp/${sharedir}/doc/klayout +mkdir -p makedeb-tmp/${sharedir}/applications +mkdir -p makedeb-tmp/${sharedir}/pixmaps +mkdir -p makedeb-tmp/${libdir}/db_plugins +mkdir -p makedeb-tmp/${libdir}/lay_plugins +mkdir -p makedeb-tmp/${pylibdir} +mkdir -p makedeb-tmp/${bindir} -cp etc/klayout.desktop makedeb-tmp/usr/share/applications -cp etc/logo.png makedeb-tmp/usr/share/pixmaps -cp Changelog makedeb-tmp/usr/share/doc/klayout/changelog -cp Changelog.Debian makedeb-tmp/usr/share/doc/klayout/changelog.Debian -cp COPYRIGHT makedeb-tmp/usr/share/doc/klayout/copyright +cp etc/klayout.desktop makedeb-tmp/${sharedir}/applications +cp etc/logo.png makedeb-tmp/${sharedir}/pixmaps +cp Changelog makedeb-tmp/${sharedir}/doc/klayout/changelog +cp Changelog.Debian makedeb-tmp/${sharedir}/doc/klayout/changelog.Debian +cp COPYRIGHT makedeb-tmp/${sharedir}/doc/klayout/copyright -cp -pd $bindir/strm* makedeb-tmp/usr/bin -cp -pd $bindir/klayout makedeb-tmp/usr/bin -cp -pd $bindir/lib*so* makedeb-tmp/usr/lib/klayout +cp -pd $bininstdir/strm* makedeb-tmp/${bindir} +cp -pd $bininstdir/klayout makedeb-tmp/${bindir} +cp -pd $bininstdir/lib*so* makedeb-tmp/${libdir} +cp -pd $bininstdir/db_plugins/lib*so* makedeb-tmp/${libdir}/db_plugins +cp -pd $bininstdir/lay_plugins/lib*so* makedeb-tmp/${libdir}/lay_plugins +cp -pd $bininstdir/pymod/klayout/*so makedeb-tmp/${pylibdir} +cp -pd $bininstdir/pymod/klayout/*py makedeb-tmp/${pylibdir} cd makedeb-tmp echo "Checking files .." -grep -q $version usr/share/doc/klayout/copyright || ( +grep -q $version ${sharedir}/doc/klayout/copyright || ( echo "*** ERROR: version $version not found in copyright file" exit 1 ) -grep -q $version usr/share/doc/klayout/changelog || ( +grep -q $version ${sharedir}/doc/klayout/changelog || ( echo "*** ERROR: version $version not found in changelog file" exit 1 ) -grep -q $version usr/share/doc/klayout/changelog.Debian || ( +grep -q $version ${sharedir}/doc/klayout/changelog.Debian || ( echo "*** ERROR: version $version not found in changelog.Debian file" exit 1 ) echo "Modifying control file .." -strip usr/bin/* +strip ${bindir}/* +strip ${libdir}/*.so* +strip ${pylibdir}/*.so +strip ${libdir}/db_plugins/*.so* +strip ${libdir}/lay_plugins/*.so* size=`du -ck usr | grep total | sed "s/ *total//"` @@ -120,8 +137,8 @@ cat control echo "Building .deb package .." -gzip -n --best usr/share/doc/klayout/changelog -gzip -n --best usr/share/doc/klayout/changelog.Debian +gzip -n --best ${sharedir}/doc/klayout/changelog +gzip -n --best ${sharedir}/doc/klayout/changelog.Debian # lintian complains about exec bits set find ./usr -name "lib*.so.*" -exec chmod 644 "{}" ";"