1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
PACKAGE := git2cl
VER := $(shell dpkg-parsechangelog | perl -ne 'print $$1 if m/Version:\s*([\d\.+git]+)/')
UVER := $(shell echo $(VER) | perl -ne 'print $$1 if m/\+git(\d+)/')
UVER_DATE := $(shell echo '$(UVER)' | perl -ne 'print $$1 if m/^(\d{8})/')
UVER_TIME := $(shell echo '$(UVER)' | perl -ne 'print $$1 if m/^\d{8}(\d+)/')
UVER_UDATE := $(shell date -u -d "$(UVER_DATE) $(UVER_TIME)" +%s)
MANPAGES := $(patsubst debian/%.mdwn, debian/%.1, $(wildcard debian/*.mdwn))
$(MANPAGES):
pandoc --standalone --to=man --output=$@ $(patsubst %.1, %.mdwn, $@)
%:
dh $@
override_dh_auto_clean:
$(RM) $(MANPAGES)
dh_auto_clean
override_dh_auto_build: $(MANPAGES)
get-orig-source:
@echo " Upstream version: $(UVER)\n Version: $(VER)\n UDATE: $(UVER_UDATE)"
git clone git://repo.or.cz/git2cl.git $(PACKAGE)-$(UVER)
cd $(PACKAGE)-$(UVER) \
&& git reset --hard `git rev-list --all -n 1 --before=$(UVER_UDATE)` \
&& echo "Generating ChangeLog" \
&& ( [ -e ChangeLog ] || ./git2cl > ChangeLog ) \
&& $(RM) -r .git && cd .. && echo "Packing..." \
&& tar cjvf $(PACKAGE)_$(VER).orig.tar.bz2 $(PACKAGE)-$(UVER)
$(RM) -r $(PACKAGE)-$(UVER)
|