summaryrefslogtreecommitdiff
path: root/bin/build-distribution-archives
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2022-01-10 12:20:15 -0500
committerGitHub <noreply@github.com>2022-01-10 18:20:15 +0100
commit5cf0519928a99fa976623981991a4b8d1b0b3eb9 (patch)
tree426ed91efad90a39acdacacc935f1b8498d8447d /bin/build-distribution-archives
parent5dce5c14e410c595e53869d6d595d88db1dbf474 (diff)
add deb and rpm building (#1501)
Diffstat (limited to 'bin/build-distribution-archives')
-rwxr-xr-xbin/build-distribution-archives52
1 files changed, 49 insertions, 3 deletions
diff --git a/bin/build-distribution-archives b/bin/build-distribution-archives
index 2373c23a..584c0579 100755
--- a/bin/build-distribution-archives
+++ b/bin/build-distribution-archives
@@ -84,7 +84,53 @@ if [ "$BUILD" = "windows" ]; then
fi
if [ "$BUILD" = "linux" ]; then
- cd dist
- python -m zipfile -c ../artifacts/inkstitch-${VERSION}-${OS}.zip *;
- cd ..
+ gem install fpm
+
+ if [[ "$VERSION" =~ ^v[0-9][.0-9]+$ ]]; then
+ VERSION=${VERSION#v}
+ else
+ # dpkg requires versions to start with a number, so we have to add
+ # 0.0.1 for development builds
+ VERSION="0.0.1-${VERSION}"
+ fi
+
+ echo -n "$INKSTITCH_GPG_KEY" | base64 -d | gpg --import
+ cat <<EOF > $HOME/.rpmmacros
+%_gpg_name EA93BCE2CCD0FB2E77B2CC29E8120E50709E5C44
+%_signature gpg
+EOF
+
+ fpm -s dir \
+ -t deb \
+ -n inkstitch \
+ -v "$VERSION" \
+ -d "inkscape >= 1.0.0" \
+ --license "GPL-3.0" \
+ --description "An open-source machine embroidery design platform based on Inkscape" \
+ --url "https://inkstitch.org" \
+ --maintainer "maintainer@inkstitch.org" \
+ --after-install bin/after-install \
+ --before-remove bin/before-remove \
+ --verbose \
+ dist/inkstitch=/opt
+
+ fpm -s dir \
+ -t rpm \
+ -n inkstitch \
+ -v "$VERSION" \
+ -d "inkscape >= 1.0.0" \
+ --license "GPL-3.0" \
+ --description "An open-source machine embroidery design platform based on Inkscape" \
+ --url "https://inkstitch.org" \
+ --maintainer "maintainer@inkstitch.org" \
+ --after-install bin/after-install \
+ --before-remove bin/before-remove \
+ --verbose \
+ dist/inkstitch=/opt
+
+ rpmsign --addsign inkstitch*.rpm
+ mv inkstitch*.deb inkstitch*.rpm artifacts/
+
+ tar -C dist -Jcf artifacts/inkstitch-${VERSION}-${OS}.tar.xz inkstitch
+ cat "$(dirname "$0")/linux-sh-installer" artifacts/inkstitch-${VERSION}-${OS}.tar.xz > artifacts/inkstitch-${VERSION}-${OS}.sh
fi