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-stamp
43 build-stamp: $(BUILDDIR)/config.status
44 dh_testdir
45 dh_clean
47 cp -r ./src/ $(BUILDDIR)
48 $(MAKE) -C $(BUILDDIR)
50 touch build-stamp
52 clean: unpatch
53 dh_testdir
54 dh_testroot
55 rm -f build-stamp
57 rm -rf $(BUILDDIR)
58 rm -f po/*.gmo
60 for file in config.guess config.sub; do \
61 if [ -e $$file.upstream ]; then \
62 rm -f $$file; \
63 mv $$file.upstream $$file; \
64 fi \
65 done
67 dh_clean
69 install: build
70 dh_testdir
71 dh_testroot
72 dh_clean -k
73 dh_installdirs
75 $(MAKE) -C $(BUILDDIR) install prefix=$(CURDIR)/debian/cadaver/usr
77 binary-indep:
78 # nothing to do here
80 binary-arch: build install
81 dh_testdir
82 dh_testroot
83 dh_installchangelogs -a ChangeLog
84 dh_installdocs -a BUGS FAQ INTEROP NEWS README THANKS TODO
85 dh_installmenu -a
86 dh_installman -a
87 dh_link -a
88 dh_strip -a
89 dh_compress -a
90 dh_fixperms -a
91 dh_installdeb -a
92 dh_shlibdeps -a
93 dh_gencontrol -a
94 dh_md5sums -a
95 dh_builddeb -a
97 binary: binary-indep binary-arch
98 .PHONY: build clean install binary-indep binary-arch binary