diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-03-27 13:49:28 +0200 |
---|---|---|
committer | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-04-03 15:30:47 +0300 |
commit | 766d0e05d024f8d287a2e14c7ea1aad9e296d0cc (patch) | |
tree | 307e42a7bd44d336ba030688195e61f18b9b83d1 | |
parent | 87948cdfab149f7fd3fb1e8c6a40a2fd5e2c946f (diff) | |
download | git-buildpackage-766d0e05d024f8d287a2e14c7ea1aad9e296d0cc.tar.gz git-buildpackage-766d0e05d024f8d287a2e14c7ea1aad9e296d0cc.tar.bz2 git-buildpackage-766d0e05d024f8d287a2e14c7ea1aad9e296d0cc.zip |
packaging: remove Makefile
And replace it with update-dsc.sh that is used to update the .dsc file
with the post-export hook. Update .gbp.conf accordingly.
Enables using the git-buildpackage OBS source service for building
git-buildpackage itself in the backend infrastructure.
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r-- | .gbp.conf | 2 | ||||
-rw-r--r-- | packaging/Makefile | 20 | ||||
-rwxr-xr-x | packaging/update-dsc.sh | 12 |
3 files changed, 13 insertions, 21 deletions
@@ -17,4 +17,4 @@ patch-export = True patch-numbers = True patch-export-ignore-path = (.gbp.conf|packaging/.*) # Export hook -postexport=make dsc +postexport=./update-dsc.sh diff --git a/packaging/Makefile b/packaging/Makefile deleted file mode 100644 index c43542f9..00000000 --- a/packaging/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -PKG_NAME := git-buildpackage -SPECFILE = $(addsuffix .spec, $(PKG_NAME)) -PKG_VERSION := $(shell grep '^Version: ' $(SPECFILE)|awk '{print $$2}') - -TARBALL := $(PKG_NAME)_$(PKG_VERSION).tar.gz - -dsc: $(TARBALL) - $(eval MD5=$(shell md5sum $(TARBALL) | sed "s/ / $(shell stat -c '%s' $(TARBALL)) /")) - @sed -i 's/^Version:.*/Version: $(PKG_VERSION)/' $(PKG_NAME).dsc - @sed -i 's/ [a-f0-9]\+ [0-9]\+ $(PKG_NAME).*tar.*/ $(MD5)/' $(PKG_NAME).dsc - -$(TARBALL): - @cd `git rev-parse --show-toplevel` \ - && git archive --prefix $(PKG_NAME)-$(PKG_VERSION)/ HEAD \ - | gzip > $(CURDIR)/$(TARBALL) - -clean: - @rm -f $(PKG_NAME)*.tar.gz - -all: clean dsc diff --git a/packaging/update-dsc.sh b/packaging/update-dsc.sh new file mode 100755 index 00000000..baf663cd --- /dev/null +++ b/packaging/update-dsc.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e +_PKG_NAME=git-buildpackage +_SPECFILE=${_PKG_NAME}.spec +_PKG_VERSION=`grep '^Version: ' $_SPECFILE | awk '{print $2}'` +_TARBALL=${_PKG_NAME}_${_PKG_VERSION}.tar.gz + +echo "Updating dsc file to version $_PKG_VERSION" +_TARBALL_BYTES=` stat -c '%s' $_TARBALL` +_MD5=`md5sum $_TARBALL | sed "s/ / $_TARBALL_BYTES /"` +sed -i "s/^Version:.*/Version: ${_PKG_VERSION}/" ${_PKG_NAME}.dsc +sed -i "s/ [a-f0-9]\+ [0-9]\+ ${_PKG_NAME}.*tar.*/ ${_MD5}/" ${_PKG_NAME}.dsc + |