Skip to content

Commit

Permalink
Added a script to build debian packages (#563)
Browse files Browse the repository at this point in the history
Signed-off-by: Marius Messerschmidt <marius.messerschmidt@googlemail.com>
  • Loading branch information
mame98 authored and zyedidia committed Mar 2, 2017
1 parent 6df2d7d commit 89acc70
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ binaries/
tmp.sh
test/
.idea/
packages/
62 changes: 62 additions & 0 deletions tools/build-deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Builds two .deb packages, for x86 (i386) and x86_64 (amd64)
# These packages are the bare minimum, which means that they can be installed
# But they do not feature everything yet.
# This does not mean that the editor itself is affected.

function getControl() {
echo Section: editors
echo Package: micro
echo Version: $2
echo Priority: extra
echo Maintainer: \"Zachary Yedidia\" \<zyedidia@gmail.com\>
echo Standards-Version: 3.9.8
echo Homepage: https://micro-editor.github.io/
echo Architecture: $1
echo "Description: A modern and intuitive terminal-based text editor"
echo " This package contains a modern alternative to other terminal-based"
echo " Editors. It is easy to Use, highly customizable via themes and plugins"
echo " and it supports mouse input"
}

function installFiles() {
TO="$1/$2/usr/share/doc/micro/"
mkdir -p $TO
cp ../LICENSE $TO
cp ../LICENSE-THIRD-PARTY $TO
cp ../README.md $TO
}

version=$1
if [ "$1" == "" ]
then
version=$(go run build-version.go)
fi
echo "Building packages for Version '$version'"
echo "Running Cross-Compile"
./cross-compile.sh $version

echo "Beginning package build process"

PKGPATH="../packages/deb"

rm -fr ../packages
mkdir -p $PKGPATH/amd64/DEBIAN/
mkdir -p $PKGPATH/i386/DEBIAN/

getControl "amd64" "$version" > $PKGPATH/amd64/DEBIAN/control
tar -xzf "../binaries/micro-$version-linux64.tar.gz" "micro-$version/micro"
mkdir -p $PKGPATH/amd64/usr/local/bin/
mv "micro-$version/micro" "$PKGPATH/amd64/usr/local/bin/"

getControl "i386" "$version" > $PKGPATH/i386/DEBIAN/control
tar -xzf "../binaries/micro-$version-linux32.tar.gz" "micro-$version/micro"
mkdir -p $PKGPATH/i386/usr/local/bin/
mv "micro-$version/micro" "$PKGPATH/i386/usr/local/bin/"

rm -rf "micro-$version"

installFiles $PKGPATH "amd64"
installFiles $PKGPATH "i386"

dpkg -b "$PKGPATH/amd64/" "../packages/micro-$version-amd64.deb"
dpkg -b "$PKGPATH/i386/" "../packages/micro-$version-i386.deb"

0 comments on commit 89acc70

Please sign in to comment.