Code

Copy up to date config.{sub,guess} files to the source directory.
[pkg-cadaver.git] / debian / rules
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
27         dh_testdir
28         
29         for file in config.guess config.sub; do \
30                 mv $$file $$file.upstream; \
31                 ln -s /usr/share/misc/$$file .; \
32         done
33         
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 --without-ssl
40 build: build-stamp
42 build-stamp: $(BUILDDIR)/config.status patch
43         dh_testdir
44         dh_clean
45         
46         cp -r ./src/ $(BUILDDIR)
47         $(MAKE) -C $(BUILDDIR)
48         
49         touch build-stamp
51 clean: unpatch
52         dh_testdir
53         dh_testroot
54         rm -f build-stamp
55         
56         rm -rf $(BUILDDIR)
57         
58         for file in config.guess config.sub; do \
59                 if [ -e $$file.upstream ]; then \
60                         rm -f $$file; \
61                         mv $$file.upstream $$file; \
62                 fi \
63         done
64         
65         dh_clean
67 install: build
68         dh_testdir
69         dh_testroot
70         dh_clean -k
71         dh_installdirs
72         
73         $(MAKE) -C $(BUILDDIR) install prefix=$(CURDIR)/debian/cadaver/usr
75 binary-indep:
76         # nothing to do here
78 binary-arch: build install
79         dh_testdir
80         dh_testroot
81         dh_installchangelogs -a ChangeLog
82         dh_installdocs -a BUGS FAQ INTEROP NEWS README THANKS TODO
83         dh_installmenu -a
84         dh_installman -a
85         dh_link -a
86         dh_strip -a
87         dh_compress -a
88         dh_fixperms -a
89         dh_installdeb -a
90         dh_shlibdeps -a
91         dh_gencontrol -a
92         dh_md5sums -a
93         dh_builddeb -a
95 binary: binary-indep binary-arch
96 .PHONY: build clean install binary-indep binary-arch binary