1 #!/usr/bin/make -f
2 # debian/rules for cadaver
3 #
4 # Written by Sebastian Harl <tokkee@debian.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) && ../../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 \
39 CFLAGS="$(CFLAGS)" LIBS="-lgcrypt"
41 build: build-arch build-indep
43 build-arch: build-stamp
44 build-indep: build-stamp
46 build-stamp: $(BUILDDIR)/config.status
47 dh_testdir
48 dh_clean
50 cp -r ./src/ $(BUILDDIR)
51 $(MAKE) -C $(BUILDDIR)
53 touch build-stamp
55 clean: unpatch
56 dh_testdir
57 dh_testroot
58 rm -f build-stamp
60 rm -rf $(BUILDDIR)
61 rm -f po/*.gmo
63 for file in config.guess config.sub; do \
64 if [ -e $$file.upstream ]; then \
65 rm -f $$file; \
66 mv $$file.upstream $$file; \
67 fi \
68 done
70 dh_clean
72 install: build
73 dh_testdir
74 dh_testroot
75 dh_clean -k
76 dh_installdirs
78 $(MAKE) -C $(BUILDDIR) install prefix=$(CURDIR)/debian/cadaver/usr
80 binary-indep:
81 # nothing to do here
83 binary-arch: build install
84 dh_testdir
85 dh_testroot
86 dh_installchangelogs -a ChangeLog
87 dh_installdocs -a BUGS FAQ INTEROP NEWS README THANKS TODO
88 dh_installmenu -a
89 dh_installman -a
90 dh_link -a
91 dh_strip -a
92 dh_compress -a
93 dh_fixperms -a
94 dh_installdeb -a
95 dh_shlibdeps -a
96 dh_gencontrol -a
97 dh_md5sums -a
98 dh_builddeb -a
100 binary: binary-indep binary-arch
101 .PHONY: build clean install binary-indep binary-arch binary