automate push of updated and tagged master branch during debian/rules prebuild
[fw/altos] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3
4 export DH_VERBOSE=1
5 PKG_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)/\1/p')
6 DEB_VERSION := $(shell git describe | tr - +)
7
8 # this target invoked by git-buildpackage using a clean hook, see .gbp.conf
9 prebuild:
10         git-dch --release --new-version=$(DEB_VERSION)
11         git log > ChangeLog
12         git commit ChangeLog debian/changelog \
13                 -m "update changelogs for Debian build"
14         git tag debian/$(DEB_VERSION)
15         git push --tags master
16
17 configure: configure-stamp
18 configure-stamp:
19         dh_testdir
20         ./autogen.sh --prefix=/usr
21         touch configure-stamp
22
23 build: build-stamp
24
25 build-stamp: configure-stamp  
26         dh_testdir
27         $(MAKE) VERSION=$(PKG_VERSION)
28         touch $@
29
30 clean: 
31         dh_testdir
32         dh_testroot
33         rm -f build-stamp configure-stamp
34         [ ! -f Makefile ] || $(MAKE) distclean
35         dh_clean 
36
37 install: build
38         dh_testdir
39         dh_testroot
40         dh_prep  
41         dh_installdirs
42
43         $(MAKE) DESTDIR=$(CURDIR)/debian/altos install
44         install -o root -g root -m 0644 debian/altusmetrum.xpm \
45                 $(CURDIR)/debian/altos/usr/share/pixmaps/altusmetrum.xpm
46
47 # Build architecture-independent files here.
48 binary-indep: install
49 # We have nothing to do by default.
50
51 # Build architecture-dependent files here.
52 binary-arch: install
53         dh_testdir
54         dh_testroot
55         dh_installchangelogs ChangeLog
56         dh_installdocs
57         dh_installexamples
58         dh_install
59         dh_installmenu
60 #       dh_installdebconf
61 #       dh_installlogrotate
62 #       dh_installemacsen
63 #       dh_installpam
64 #       dh_installmime
65 #       dh_python
66 #       dh_installinit
67 #       dh_installcron
68 #       dh_installinfo
69         dh_installman
70         dh_link
71         dh_strip
72         dh_compress
73         dh_fixperms
74 #       dh_perl
75 #       dh_makeshlibs
76         dh_installdeb
77         dh_shlibdeps
78         dh_gencontrol
79         dh_md5sums
80         dh_builddeb
81
82 binary: binary-indep binary-arch
83 .PHONY: build clean binary-indep binary-arch binary install configure