SINGA-274 Create Debian packages Get the size of the debian folder and update the size field in the control file via build.sh
Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/734009e6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/734009e6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/734009e6 Branch: refs/heads/master Commit: 734009e60bea6a4df5ea41d2d52421283efe001f Parents: f4e4a78 Author: wangwei <[email protected]> Authored: Fri Jan 6 21:20:08 2017 +0800 Committer: wangwei <[email protected]> Committed: Sun Jan 8 11:07:35 2017 +0800 ---------------------------------------------------------------------- tool/debian/build.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/734009e6/tool/debian/build.sh ---------------------------------------------------------------------- diff --git a/tool/debian/build.sh b/tool/debian/build.sh index 8433516..43a21cb 100755 --- a/tool/debian/build.sh +++ b/tool/debian/build.sh @@ -81,7 +81,7 @@ fi # create the folder for the package FOLDER_PREFIX="singa" -if [ -n ${BUILD_ID+x} ]; then +if [ -n "$BUILD_ID" ]; then FOLDER_PREFIX=$BUILD_ID/$COMMIT/$OS_VERSION fi @@ -107,9 +107,6 @@ else cp -r tool/debian/singa/* build/debian/$FOLDER/ fi -# change SINGA version in the control file -sed -i "s/\(Version: [0-9]\.[0-9]\.[0-9]\)/Version: $SINGA_VERSION/" build/debian/$FOLDER/DEBIAN/control - # remove unnecessary dependencies if [ $MODULES = "ON" ]; then sed -i 's/<libopenblas-dev\>,*//' build/debian/$FOLDER/DEBIAN/control @@ -143,6 +140,11 @@ if [ $PYTHON = "ON" ]; then cp build/python/singa/_singa_wrap.so $PY_FOLDER/singa/ cp -r build/python/singa/proto $PY_FOLDER/singa/ fi +# change SINGA version in the control file +sed -i "s/\(Version: [0-9]\.[0-9]\.[0-9]\)/Version: $SINGA_VERSION/" build/debian/$FOLDER/DEBIAN/control +SIZE=`du -s build/debian/$FOLDER|cut -f 1` +# change the Size +sed -i "s/\(Installed-Size: [1-9][0-9]*\)/Installed-Size: $SIZE/" build/debian/$FOLDER/DEBIAN/control dpkg -b build/debian/$FOLDER/
