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"
|
2014-06-06 05:37:09 +04:00
|
|
|
ARCH="$2"
|
|
|
|
CONTROL_FILE="$3"
|
|
|
|
DESKTOP_FILE="$4"
|
|
|
|
ICON_FILE="$5"
|
|
|
|
DEB_PATH="$6"
|
2014-08-15 21:27:16 +04:00
|
|
|
FILE_MODE=755
|
2014-03-24 14:50:58 +04:00
|
|
|
|
2014-03-24 14:44:44 +04:00
|
|
|
TARGET_ROOT="`mktemp -d`"
|
2014-09-22 21:08:39 +04:00
|
|
|
chmod $FILE_MODE "$TARGET_ROOT"
|
2014-06-06 05:37:09 +04:00
|
|
|
TARGET="$TARGET_ROOT/atom-$VERSION-$ARCH"
|
2014-03-24 14:44:44 +04:00
|
|
|
|
2014-08-15 21:27:16 +04:00
|
|
|
mkdir -m $FILE_MODE -p "$TARGET/usr"
|
2014-03-24 14:44:44 +04:00
|
|
|
env INSTALL_PREFIX="$TARGET/usr" script/grunt install
|
|
|
|
|
2014-08-15 21:27:16 +04:00
|
|
|
mkdir -m $FILE_MODE -p "$TARGET/DEBIAN"
|
2014-06-05 07:29:01 +04:00
|
|
|
cp "$CONTROL_FILE" "$TARGET/DEBIAN/control"
|
2014-03-24 14:44:44 +04:00
|
|
|
|
2014-08-15 21:27:16 +04:00
|
|
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share/applications"
|
2014-06-05 07:29:01 +04:00
|
|
|
cp "$DESKTOP_FILE" "$TARGET/usr/share/applications"
|
2014-03-24 15:12:41 +04:00
|
|
|
|
2014-08-15 21:27:16 +04:00
|
|
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share/pixmaps"
|
2014-03-24 15:24:12 +04:00
|
|
|
cp "$ICON_FILE" "$TARGET/usr/share/pixmaps"
|
|
|
|
|
2014-09-23 22:48:40 +04:00
|
|
|
# Copy generated LICENSE.md to /usr/share/doc/atom/copyright
|
|
|
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share/doc/atom"
|
|
|
|
cp "$TARGET/usr/share/atom/resources/app/LICENSE.md" "$TARGET/usr/share/doc/atom/copyright"
|
|
|
|
|
2014-09-23 23:07:08 +04:00
|
|
|
# Add lintian overrides
|
|
|
|
mkdir -m $FILE_MODE -p "$TARGET/usr/share/lintian/overrides"
|
|
|
|
cp "$ROOT/resources/linux/debian/lintian-overrides" "$TARGET/usr/share/lintian/overrides/atom"
|
|
|
|
|
2014-09-23 22:17:56 +04:00
|
|
|
# Remove executable bit from .node files
|
|
|
|
find "$TARGET" -type f -name "*.node" -exec chmod a-x {} \;
|
|
|
|
|
2014-09-22 21:13:13 +04:00
|
|
|
fakeroot dpkg-deb -b "$TARGET"
|
2014-06-06 05:37:09 +04:00
|
|
|
mv "$TARGET_ROOT/atom-$VERSION-$ARCH.deb" "$DEB_PATH"
|
2014-09-22 21:08:16 +04:00
|
|
|
rm -rf "$TARGET_ROOT"
|