PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/sdk-installer/deb-builder.sh

https://bitbucket.org/mmeinhold/amps
Shell | 39 lines | 20 code | 12 blank | 7 comment | 3 complexity | c27fe6c2c6f79fe5e57b48d9766ec2a0 MD5 | raw file
 1#!/bin/sh
 2
 3SDKVERSION=$1
 4DEBVERSION=$2
 5
 6#make sure we use GNU sed (gsed from macports) on OSX
 7
 8OS=`uname`
 9
10echo "OS = $OS"
11
12if [ "${OS}" == "Darwin" ]; then
13    SED=gsed
14else
15	SED=sed
16fi
17
18# Make sure we have a clean /usr/bin
19rm -rf target/deb-work/usr/bin/
20mkdir -p target/deb-work/usr/bin/
21
22# Add the symlinks we need from /usr/share to /usr/bin
23for f in `find target/deb-work/usr/share/atlassian-plugin-sdk-$SDKVERSION/bin/ -name "atlas-*" | xargs -n1 basename`; do
24  ln -s /usr/share/atlassian-plugin-sdk-$SDKVERSION/bin/$f target/deb-work/usr/bin/$f
25done
26
27# Add the install size to our control file
28DIRSIZE=`du -ks target/deb-work/usr/share/atlassian-plugin-sdk-$SDKVERSION | cut -f 1`
29$SED -i -e "s/SIZE/$DIRSIZE/g" target/deb-work/DEBIAN/control
30
31# update version in control
32$SED -i -e "s/DEBVERSION/$DEBVERSION/g" target/deb-work/DEBIAN/control
33
34echo "using deb version: $DEBVERSION"
35
36# Make the deb file
37dpkg --build target/deb-work target/atlassian-plugin-sdk-$DEBVERSION.deb
38
39exit 0