| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
#export DH_VERBOSE=1 |
| 4 |
|
| 5 |
include /usr/share/dpkg/pkg-info.mk |
| 6 |
|
| 7 |
# Make sure not to generate manpages with a non-C locale date format: |
| 8 |
export LC_ALL=C |
| 9 |
|
| 10 |
prepare-changelog: LAST?=$(shell git describe | sed 's/-.*//') |
| 11 |
prepare-changelog: BRANCH=$(shell git branch | grep '^*' | awk '{print $$2}') |
| 12 |
prepare-changelog: |
| 13 |
# Make sure git-buildpackage is installed (ensures git-core is, too): |
| 14 |
@if [ -z "$(shell which git-dch)" ] ; then \ |
| 15 |
echo "E: git-buildpackage isn't installed, needed for this target." ; \ |
| 16 |
exit 1 ; \ |
| 17 |
fi |
| 18 |
|
| 19 |
# Determine last tag: |
| 20 |
git dch --debian-branch=$(BRANCH) --since=$(LAST) |
| 21 |
|
| 22 |
|
| 23 |
git-build: PACKAGE=module-assistant |
| 24 |
git-build: VERSION=$(DEB_VERSION) |
| 25 |
git-build: |
| 26 |
# Make sure git-core is installed: |
| 27 |
@if [ -z "$(shell which git)" ] ; then \ |
| 28 |
echo "E: git-core isn't installed, needed for this target." ; \ |
| 29 |
exit 1 ; \ |
| 30 |
fi |
| 31 |
|
| 32 |
# Generate the tarball with an appropriate prefix: |
| 33 |
git archive --prefix=$(PACKAGE)-$(VERSION)/ HEAD | gzip -9 \ |
| 34 |
> ../$(PACKAGE)_$(VERSION).tar.gz ; echo $$? |
| 35 |
|
| 36 |
# Extract it, build the source package, clean afterwards |
| 37 |
# (also clean before, there might be something already): |
| 38 |
cd .. && \ |
| 39 |
rm -rf $(PACKAGE)-$(VERSION) && \ |
| 40 |
tar xfz $(PACKAGE)_$(VERSION).tar.gz && \ |
| 41 |
cd $(PACKAGE)-$(VERSION) && \ |
| 42 |
debuild $(DEBUILDFLAGS) && \ |
| 43 |
cd .. && \ |
| 44 |
rm -rf $(PACKAGE)-$(VERSION) |
| 45 |
|
| 46 |
source-package: DEBUILDFLAGS=-us -uc -S |
| 47 |
source-package: git-build |
| 48 |
|
| 49 |
binary-package: git-build |
| 50 |
|
| 51 |
git-release: git-build pristine-tar-commit |
| 52 |
|
| 53 |
.NOTPARALLEL: |
| 54 |
# keep the order above. Could use |
| 55 |
# $(MAKE) -f $(lastword $(MAKEFILE_LIST)) pristine-tar-commit |
| 56 |
# instead but this is easier and speed is hardly an issue |
| 57 |
|
| 58 |
pristine-tar-commit: PACKAGE=module-assistant |
| 59 |
pristine-tar-commit: VERSION=$(DEB_VERSION) |
| 60 |
pristine-tar-commit: TARBALL=../$(PACKAGE)_$(VERSION).tar.gz |
| 61 |
pristine-tar-commit: BRANCH=$(shell git branch | grep '^*' | awk '{print $$2}') |
| 62 |
pristine-tar-commit: |
| 63 |
# Make sure pristine-tar is installed: |
| 64 |
@if [ -z "$(shell which pristine-tar)" ] ; then \ |
| 65 |
echo "E: pristine-tar isn't installed, needed for this target." ; \ |
| 66 |
exit 1 ; \ |
| 67 |
fi |
| 68 |
|
| 69 |
# Make sure the tarball exists: |
| 70 |
@if [ ! -f $(TARBALL) ] ; then \ |
| 71 |
echo "E: $(TARBALL) tarball is missing." ; \ |
| 72 |
echo "I: Need to use the 'source-package' target first?" ; \ |
| 73 |
exit 1 ; \ |
| 74 |
fi |
| 75 |
|
| 76 |
# Commit the tarball: |
| 77 |
pristine-tar commit $(TARBALL) $(subst ~,_,$(VERSION)) |
| 78 |
|
| 79 |
############################################################################ |
| 80 |
|
| 81 |
VENDOR ?= $(call dpkg_late_eval,VENDOR,dpkg-vendor --derives-from Ubuntu && echo Ubuntu || echo Debian) |
| 82 |
AUTOGENERATED := $(patsubst %.in,%,$(wildcard modass/*.in)) |
| 83 |
|
| 84 |
execute_before_dh_auto_configure: $(AUTOGENERATED) ; |
| 85 |
|
| 86 |
override_dh_auto_install: |
| 87 |
dh_auto_install --destdir=debian/tmp |
| 88 |
|
| 89 |
override_dh_install: |
| 90 |
dh_install -X.in |
| 91 |
|
| 92 |
execute_after_dh_auto_clean: |
| 93 |
$(RM) $(AUTOGENERATED) |
| 94 |
|
| 95 |
%: %.in |
| 96 |
sed 's%@VENDOR@%$(VENDOR)%g' < $< > $@ |
| 97 |
chmod --reference=$< $@ |
| 98 |
|
| 99 |
%: |
| 100 |
dh $@ --without single-binary |