Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions debian/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -exo pipefail

PKGNAME=pidgin-chime
COMMITDESC=$(git describe --tags | sed -e 's/$$/-0/' -e 's/v\([^-]\+-[^-]\+\)\(-g[0-9a-f-]\+\|\)/\1/')
COMMITDATE="$(git show -s --format=%cD)"
SCRATCHDIR=$(mktemp -d)

git archive HEAD --prefix=${PKGNAME}/ \
| xz -c \
> $SCRATCHDIR/${PKGNAME}.tar
cd $SCRATCHDIR
tar xvf ${PKGNAME}.tar
cd ${PKGNAME}

NOCONFIGURE=1 ./autogen.sh
for DISTRO in bionic focal ; do
make -f debian/rules.maint clean all DISTRIB_CODENAME=$DISTRO COMMITDESC=$COMMITDESC COMMITDATE="${COMMITDATE}"
debuild -S -d
dput pidgin-chime ../${PKGNAME}_${COMMITDESC}~${DISTRO}+1_source.changes
done

cd /tmp
rm -r $SCRATCHDIR
10 changes: 7 additions & 3 deletions debian/rules.maint
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# git and lsb_release are required, and these rules must be run from within a git working copy


export DISTRIB_CODENAME=$(shell lsb_release -cs)
DISTRIB_CODENAME=$(shell lsb_release -cs)
COMMITDESC=$(shell git describe --tags | sed -e 's/$$/-0/' -e 's/v\([^-]\+-[^-]\+\)\(-g[0-9a-f-]\+\|\)/\1/')
COMMITDATE=$(shell git show -s --format=%cD)

ifeq ($(DISTRIB_CODENAME),)
DISTRIB_CODENAME=$(error Unable to identify distribution)
Expand All @@ -16,14 +18,16 @@ else
PKGVERSIONSUFFIX=~${DISTRIB_CODENAME}+1
endif

all: debian/control debian/changelog

debian/control: debian/control.in debian/deps/build-$(DISTRIB_CODENAME) debian/deps/bin-$(DISTRIB_CODENAME)
@BUILDDEPS=$$(egrep -v '^\s*(#|$$$$)' debian/deps/build-$(DISTRIB_CODENAME) | tr '\n' ' '); \
BINDEPS=$$(egrep -v '^\s*(#|$$$$)' debian/deps/bin-$(DISTRIB_CODENAME) | tr '\n' ' '); \
sed -e "s/%BUILDDEPS%/$$BUILDDEPS/" -e "s/%BINDEPS%/$$BINDEPS/" $< > $@

debian/changelog: debian/changelog.in debian/control
@COMMITDESC=$$(git describe --tags | sed -e 's/$$/-0/' -e 's/v\([^-]\+-[^-]\+\)\(-g[0-9a-f-]\+\|\)/\1/') \
COMMITDATE=$$(git show -s --format=%cD) && \
@COMMITDESC="${COMMITDESC}" \
COMMITDATE="${COMMITDATE}" && \
sed -e "s/%COMMITDESC%/$$COMMITDESC${PKGVERSIONSUFFIX}/" -e "s/%COMMITDATE%/$$COMMITDATE/" \
-e "s/%DIST%/$$DISTRIB_CODENAME/" $< > $@

Expand Down