-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a script to build debian packages (#563)
Signed-off-by: Marius Messerschmidt <marius.messerschmidt@googlemail.com>
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ binaries/ | |
tmp.sh | ||
test/ | ||
.idea/ | ||
packages/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |