Code

06c0f3e1587f8f122dfb4b834c8245ae4087283a
[pkg-pfstools.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules for pfstools
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 CXXFLAGS = -Wall -g
16 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
17         CXXFLAGS += -O0
18 else
19         CXXFLAGS += -O2
20 endif
22 include /usr/share/octave/debian/defs.make
23 include /usr/share/dpatch/dpatch.make
25 confflags = --host=$(DEB_HOST_GNU_TYPE) \
26                         --build=$(DEB_BUILD_GNU_TYPE) \
27                         --prefix=/usr \
28                         --mandir=\$${prefix}/share/man \
29                         --with-moc=moc-qt3 \
30                         --with-octave-m-dir=$(MDIR)/pfstools \
31                         --with-octave-oct-dir=$(OCTDIR)/pfstools
33 # Matlab is not available in Debian.
34 confflags += --disable-matlab
36 # These libraries are not available / unusable in Debian.
37 confflags += --disable-jpeghdr --disable-gdal
39 config.status: configure $(DPATCH_STAMPFN)
40         dh_testdir
41         
42         for file in config.guess config.sub; do \
43                 if [ ! -e $$file.upstream ]; then \
44                         mv $$file $$file.upstream; \
45                         ln -s /usr/share/misc/$$file .; \
46                 fi \
47         done
48         
49         CXXFLAGS="$(CXXFLAGS)" ./configure $(confflags)
51 build: build-stamp
53 build-stamp: config.status
54         dh_testdir
55         
56         $(MAKE)
57         
58         touch build-stamp
60 clean: unpatch
61         dh_testdir
62         dh_testroot
63         rm -f build-stamp 
64         
65         [ ! -f Makefile ] || $(MAKE) clean
66         [ ! -f Makefile ] || $(MAKE) distclean
67         
68         for file in config.guess config.sub; do \
69                 if [ -e $$file.upstream ]; then \
70                         rm -f $$file; \
71                         mv $$file.upstream $$file; \
72                 fi \
73         done
74         
75         dh_clean 
77 install: build
78         dh_testdir
79         dh_testroot
80         dh_clean -k 
81         dh_installdirs
82         
83         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
84         
85         chmod 644 debian/tmp/$(MDIR)/pfstools/*
86         
87         # these binaries are not available
88         rm debian/tmp/usr/share/man/man1/pfs*jpeghdr.1
89         rm debian/tmp/usr/share/man/man1/pfsingdal.1
91 binary-indep: build install
92         # nothing to do here
94 binary-arch: build install
95         dh_testdir
96         dh_testroot
97         dh_installchangelogs ChangeLog
98         dh_installdocs README TODO doc/faq.txt doc/pfs_format_spec.pdf
99         dh_installdocs -A AUTHORS
100         dh_installexamples
101         dh_install --sourcedir=debian/tmp --fail-missing
102         # these files have been installed twice by dh_install
103         rm -f debian/pfstools/usr/bin/pfs*view debian/pfstools/usr/bin/pfsv \
104                 debian/pfstools/usr/share/man/man1/pfsv.1 \
105                 debian/pfstools/usr/share/man/man1/pfs*view.1
106         dh_installman
107         dh_link
108         dh_strip --dbg-package=pfstools-dbg
109         # mkoctfile removes any symbol table and relocation information from the
110         # .oct files making them unusable for the -dbg package
111         rm -rf debian/pfstools-dbg/usr/lib/debug/usr/lib/octave/
112         dh_compress -X.pdf
113         dh_fixperms
114         dh_makeshlibs
115         dh_installdeb
116         dh_shlibdeps -Llibpfs-1.2-0 -ldebian/libpfs-1.2-0/usr/lib/
117         octave3.0-depends -poctave-pfstools
118         dh_gencontrol
119         dh_md5sums
120         dh_builddeb
122 binary: binary-indep binary-arch
123 .PHONY: build clean binary-indep binary-arch binary install