Skip to content
Permalink
Browse files

Allow to create rpm instead of deb packages

  • Loading branch information...
Andreas Gruenbacher
Andreas Gruenbacher committed Jan 5, 2019
1 parent 99b9317 commit 4e383beea47cc6f2595498454b86ca18f623e148
@@ -1,6 +1,7 @@
/* export-ignore
.gitignore export-ignore
.gitattributes export-ignore
Makefile !export-ignore
backend !export-ignore
htdocs !export-ignore
create-db.sql !export-ignore
@@ -2,3 +2,5 @@
/lib/Auswertung.pm
/debs
/backend/package-lock.json
/rpm
/srpm
@@ -1,4 +1,5 @@
export PACKAGE = trialinfo
export GPG_NAME = 3BB03F34

MAKEFLAGS = --no-print-directory

@@ -48,6 +49,10 @@ serve: build
profile: build
cd backend && npm run profile

# For use by rpm.sh:
snapshot:
@tar -c $(DOWNLOAD_FILES) backend/node_modules backend/package-lock.json

.PHONY: require-tag
require-tag:
@tag="$(TAG)"; \
@@ -60,15 +65,27 @@ require-tag:
exit 2; \
fi

tarball: require-tag
@./tarball.sh $(TAG)

release: require-tag tarball
release: require-tag
@./release.sh $(TAG)

upload:
@./upload.sh

repo/RPM-GPG-KEY-trialinfo:
@gpg --export -a $(GPG_NAME) > "$@"

.PHONY: repo
repo: repo/RPM-GPG-KEY-trialinfo
@rpmbuild -bb \
-D "_sourcedir $(PWD)/repo" \
-D "_rpmdir $(PWD)/rpm" \
-D "_gpg_name $(GPG_NAME)" \
repo/trialinfo-repo.spec
@rpm --addsign \
-D "__gpg /usr/bin/gpg" \
-D "_gpg_name $(GPG_NAME)" \
rpm/noarch/trialinfo-repo-*.rpm

htdocs/js/angular-$(ANGULAR_VERSION)/angular%:
@mkdir -p $(dir $@)
$(CURL) -o $@ --silent --location \

This file was deleted.

@@ -1,4 +1,4 @@
#! /usr/bin/python
#! /usr/bin/python2

import sys
import getopt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,30 +1,32 @@
#! /bin/sh

set -e
: ${PACKAGE:=trialinfo}

REPO=debs
set -e

topdir=$PWD
tag=$1
version=${tag#$PACKAGE-}

tarball=$PACKAGE-$version.tar.gz
version=${tag#$PACKAGE-}
basename=$PACKAGE-$version
deb=${PACKAGE}_${version}_all.deb

curdir=$PWD

tmpdir=$(mktemp -d)
trap "rm -rf $tmpdir" EXIT

tar -xz -C "$tmpdir" < "$tarball"
cp -r debian "$tmpdir/$basename/"
cd "$tmpdir/$basename"
sed -i \
-e "s/@VERSION@/$version/g" \
-e "s/@DATE@/$(date -R)/g" \
"debian/changelog"
sudo dpkg-buildpackage -us -uc -d
cd ..
sudo chown -R $(whoami) .
mkdir -p "$curdir/$REPO"
cat "$deb" > "$curdir/$REPO/$deb"
mkdir "$tmpdir/$basename"
git show "$tag:$PACKAGE.spec" > "$tmpdir/$PACKAGE.spec"
git archive --prefix="$basename/" "$tag" | gzip -9 > "$tmpdir/$basename.tar.gz"
make snapshot | gzip -9 > "$tmpdir/snapshot.tar.gz"

cd "$tmpdir"
rpmbuild -ba \
-D "_sourcedir $tmpdir" \
-D "_rpmdir $topdir/rpm" \
-D "_srcrpmdir $topdir/srpm" \
-D "VERSION $version" \
"$PACKAGE.spec"
rpm --addsign \
-D "__gpg /usr/bin/gpg" \
-D "_gpg_name $GPG_NAME" \
$topdir/rpm/*/trialinfo-$version-*.rpm \
$topdir/srpm/trialinfo-$version-*.rpm
@@ -0,0 +1 @@
/RPM-GPG-KEY-trialinfo

0 comments on commit 4e383be

Please sign in to comment.
You can’t perform that action at this time.