1 #!/usr/bin/make -f
2 # debian/rules for cadaver
3 #
4 # Written by Sebastian Harl <sh@tokkee.org>.
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
9 # These are used for cross-compiling and for saving the configure script
10 # from having to guess our platform (since we know it already)
11 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14 CFLAGS = -Wall -g
16 BUILDDIR = ./debian/build/
18 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19 CFLAGS += -O0
20 else
21 CFLAGS += -O2
22 endif
24 include /usr/share/dpatch/dpatch.make
26 $(BUILDDIR)/config.status: configure $(DPATCH_STAMPFN)
27 dh_testdir
29 for file in config.guess config.sub; do \
30 mv $$file $$file.upstream; \
31 ln -s /usr/share/misc/$$file .; \
32 done
34 [ -e $(BUILDDIR) ] || mkdir $(BUILDDIR)
35 cd $(BUILDDIR) && CFLAGS="$(CFLAGS)" ../../configure \
36 --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
37 --prefix=/usr --mandir=\$${prefix}/share/man \
38 --enable-warnings --enable-netrc --with-ssl=gnutls
40 build: build-stamp
42 build-stamp: $(BUILDDIR)/config.status
43 dh_testdir
44 dh_clean
46 cp -r ./src/ $(BUILDDIR)
47 $(MAKE) -C $(BUILDDIR)
49 touch build-stamp
51 clean: unpatch
52 dh_testdir
53 dh_testroot
54 rm -f build-stamp
56 rm -rf $(BUILDDIR)
57 rm -f po/*.gmo
59 for file in config.guess config.sub; do \
60 if [ -e $$file.upstream ]; then \
61 rm -f $$file; \
62 mv $$file.upstream $$file; \
63 fi \
64 done
66 dh_clean
68 install: build
69 dh_testdir
70 dh_testroot
71 dh_clean -k
72 dh_installdirs
74 $(MAKE) -C $(BUILDDIR) install prefix=$(CURDIR)/debian/cadaver/usr
76 binary-indep:
77 # nothing to do here
79 binary-arch: build install
80 dh_testdir
81 dh_testroot
82 dh_installchangelogs -a ChangeLog
83 dh_installdocs -a BUGS FAQ INTEROP NEWS README THANKS TODO
84 dh_installmenu -a
85 dh_installman -a
86 dh_link -a
87 dh_strip -a
88 dh_compress -a
89 dh_fixperms -a
90 dh_installdeb -a
91 dh_shlibdeps -a
92 dh_gencontrol -a
93 dh_md5sums -a
94 dh_builddeb -a
96 binary: binary-indep binary-arch
97 .PHONY: build clean install binary-indep binary-arch binary