pulsar/script/mkdeb

35 lines
741 B
Plaintext
Raw Normal View History

#!/bin/bash
2014-03-24 14:50:58 +04:00
# mkdeb version control-file-path deb-file-path
set -e
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"
ICON_FILE="$4"
DEB_PATH="$5"
2014-03-24 14:50:58 +04:00
TARGET_ROOT="`mktemp -d`"
chmod 755 "$TARGET_ROOT"
2014-03-28 14:39:45 +04:00
TARGET="$TARGET_ROOT/atom-$VERSION-amd64"
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"
mkdir -p "$TARGET/usr/share/pixmaps"
cp "$ICON_FILE" "$TARGET/usr/share/pixmaps"
dpkg-deb -b "$TARGET"
2014-03-28 14:39:45 +04:00
mv "$TARGET_ROOT/atom-$VERSION-amd64.deb" "$DEB_PATH"
rm -rf $TARGET_ROOT