File: rules

package info (click to toggle)
git-ftp 0.7.4%2Bgit20120528-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 512 kB
  • sloc: sh: 2,383; makefile: 86
file content (40 lines) | stat: -rwxr-xr-x 1,335 bytes parent folder | download
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
38
39
40
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PACKAGE := git-ftp
MANPAGES := man/git-ftp.1
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)

%:
	dh $@

override_dh_auto_clean:
	$(RM) $(MANPAGES)

override_dh_auto_build: $(MANPAGES)
	.

$(MANPAGES):
	pandoc --columns=84 --standalone --to=man --output=$@ $@.md
	perl -0pi -e 's{(\s)\-}{$$1\\-}sg;' $@

override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.md

get-orig-source:
	#uscan --noconf --force-download --repack --rename --download-current-version --verbose --destdir=.
	@echo " Upstream version: $(UVER)\n Version: $(VER)\n UDATE: $(UVER_UDATE)"
	git clone git://github.com/resmo/git-ftp.git $(PACKAGE)-$(UVER)
	cd $(PACKAGE)-$(UVER) \
	&& git reset --hard $$(git rev-list --all -n 1 --before=$(UVER_UDATE)) \
	&& git checkout master \
	&& $(RM) -r .git .git* && cd .. && echo "Packing..." \
	&& tar cJf $(PACKAGE)_$(VER).orig.tar.xz $(PACKAGE)-$(UVER)
	$(RM) -r $(PACKAGE)-$(UVER)