Update build-deps
[jigdo.git] / deb / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 # Non-standard default goal. This also does enough to allow you to
7 # compile from CVS just by typing "deb/rules"
8 build-deb: debian/changelog
9         if test ! -d debian -a ! -h debian; then ln -s deb debian; fi
10         if test ! -f configure; then autoconf; fi
11         dpkg-buildpackage -rfakeroot -us -uc -b
12         rm -f debian deb/changelog
13 debian/changelog:
14         printf "jigdo (%s) unstable; urgency=low\n\n  * This version was built directly from upstream sources. It is not\n    an official Debian package.\n\n -- Richard Atterer <jigdo%satterer.org>  %s\n" "`read a b v <jigdo.spec && echo $$v`" "@" "`date -R`" >deb/changelog
15 src/Makedeps:
16         $(MAKE) depend
17
18 # If the user did "./configure --some-option && make deb", then
19 # recover the --some-option from config.status and use it when
20 # reconfiguring with correct --prefix
21 configure: configure-stamp
22 configure-stamp:
23         dh_testdir
24         @o=`test config.status && sed -n "/^# [^ ]*configure/ { s/\(^# [^ ]*\|'\?--\(prefix\|mandir\|infodir\)=[^ ]*\)//gp; q;}" config.status`; \
25         echo "(user-supplied configure options: $$o)"; \
26         cmd="./configure $$o --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info"; \
27         echo "$$cmd"; $$cmd
28         touch configure-stamp
29
30 build: configure-stamp src/Makedeps debian/changelog build-stamp 
31 build-stamp:
32         dh_testdir
33         $(MAKE)
34         $(MAKE) -C src test
35         touch build-stamp
36
37 clean:
38         dh_testdir
39         dh_testroot
40         rm -f build-stamp configure-stamp
41         -$(MAKE) distclean
42         dh_clean
43
44 install: build
45         dh_testdir
46         dh_testroot
47         dh_clean -k
48         $(MAKE) DESTDIR=debian/jigdo install-jigdo install-po
49         $(MAKE) DESTDIR=debian/jigdo-file \
50             install-jigdo-file install-jigdo-lite install-jigdo-mirror
51         ln -sf "../common-licenses/GPL-2" \
52             "debian/jigdo/usr/share/jigdo/COPYING"
53         for package in jigdo jigdo-file; do \
54             mkdir -p debian/$$package/usr/share/bug/$$package; \
55             at="@"; echo "Send-To: jigdo\${at}atterer.org" \
56                 >debian/$$package/usr/share/bug/$$package/control; \
57         done
58
59 # Build architecture-independent files here.
60 binary-indep: build install
61 # We have nothing to do by default.
62
63 # Build architecture-dependent files here.
64 binary-arch: build install
65         dh_testdir
66         dh_testroot
67         dh_installdocs
68         dh_installexamples
69         dh_installmenu
70 #       dh_undocumented
71 #       dh_installchangelogs 
72         dh_link
73         dh_strip
74         dh_compress
75         dh_fixperms
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