2014-03-24 14:44:44 +04:00
|
|
|
#!/bin/bash
|
2014-03-24 14:50:58 +04:00
|
|
|
# mkdeb version control-file-path deb-file-path
|
2014-03-24 14:44:44 +04:00
|
|
|
|
2014-05-16 23:54:22 +04:00
|
|
|
set -e
|
|
|
|
|
2014-03-24 14:44:44 +04:00
|
|
|
SCRIPT=`readlink -f "$0"`
|
|
|
|
ROOT=`readlink -f $(dirname $SCRIPT)/..`
|
|
|
|
cd $ROOT
|
|
|
|
|
|
|
|
VERSION="$1"
|
|
|
|
CONTROL_FILE="$2"
|
2014-03-24 15:12:41 +04:00
|
|
|
DESKTOP_FILE="$3"
|
2014-03-24 15:24:12 +04:00
|
|
|
ICON_FILE="$4"
|
|
|
|
DEB_PATH="$5"
|
2014-03-24 14:50:58 +04:00
|
|
|
|
2014-03-24 14:44:44 +04:00
|
|
|
TARGET_ROOT="`mktemp -d`"
|
2014-05-17 01:45:44 +04:00
|
|
|
chmod 755 "$TARGET_ROOT"
|
2014-03-28 14:39:45 +04:00
|
|
|
TARGET="$TARGET_ROOT/atom-$VERSION-amd64"
|
2014-03-24 14:44:44 +04:00
|
|
|
|
|
|
|
mkdir -p "$TARGET/usr"
|
|
|
|
env INSTALL_PREFIX="$TARGET/usr" script/grunt install
|
|
|
|
|
|
|
|
mkdir -p "$TARGET/DEBIAN"
|
|
|
|
mv "$CONTROL_FILE" "$TARGET/DEBIAN/control"
|
|
|
|
|
2014-03-24 15:12:41 +04:00
|
|
|
mkdir -p "$TARGET/usr/share/applications"
|
|
|
|
mv "$DESKTOP_FILE" "$TARGET/usr/share/applications"
|
|
|
|
|
2014-03-24 15:24:12 +04:00
|
|
|
mkdir -p "$TARGET/usr/share/pixmaps"
|
|
|
|
cp "$ICON_FILE" "$TARGET/usr/share/pixmaps"
|
|
|
|
|
2014-03-24 14:44:44 +04:00
|
|
|
dpkg-deb -b "$TARGET"
|
2014-03-28 14:39:45 +04:00
|
|
|
mv "$TARGET_ROOT/atom-$VERSION-amd64.deb" "$DEB_PATH"
|
2014-03-24 14:44:44 +04:00
|
|
|
rm -rf $TARGET_ROOT
|