1 #!/usr/bin/make -f
2 # debian/rules for pfstools
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 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 config.status: configure $(DPATCH_STAMPFN)
26 dh_testdir
28 for file in config.guess config.sub; do \
29 if [ ! -e $$file.upstream ]; then \
30 mv $$file $$file.upstream; \
31 ln -s /usr/share/misc/$$file .; \
32 fi \
33 done
35 CXXFLAGS="$(CXXFLAGS)" ./configure \
36 --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
37 --prefix=/usr --mandir=\$${prefix}/share/man \
38 --with-moc=moc-qt3 \
39 --with-octave-m-dir=$(MDIR)/pfstools \
40 --with-octave-oct-dir=$(OCTDIR)/pfstools
42 build: build-stamp
44 build-stamp: config.status
45 dh_testdir
47 $(MAKE)
49 touch build-stamp
51 clean: unpatch
52 dh_testdir
53 dh_testroot
54 rm -f build-stamp
56 [ ! -f Makefile ] || $(MAKE) clean
57 [ ! -f Makefile ] || $(MAKE) distclean
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) DESTDIR=$(CURDIR)/debian/tmp install
76 chmod 644 debian/tmp/usr/share/octave/site/api-v13/m/pfstools/*
78 # these binaries are not available
79 rm debian/tmp/usr/share/man/man1/pfs*jpeghdr.1
81 binary-indep: build install
82 # nothing to do here
84 binary-arch: build install
85 dh_testdir
86 dh_testroot
87 dh_installchangelogs ChangeLog
88 dh_installdocs AUTHORS README TODO doc/faq.txt doc/pfs_format_spec.pdf
89 dh_installexamples
90 dh_install --sourcedir=debian/tmp --list-missing
91 dh_installman debian/pfsglview.1
92 dh_link
93 dh_strip --dbg-package=pfstools-dbg
94 # mkoctfile removes any symbol table and relocation information from the
95 # .oct files making them unusable for the -dbg package
96 rm -rf debian/pfstools-dbg/usr/lib/debug/usr/lib/octave/
97 dh_compress -X.pdf
98 dh_fixperms
99 dh_makeshlibs
100 dh_installdeb
101 dh_shlibdeps -Llibpfs-1.2-0 -ldebian/libpfs-1.2-0/usr/lib/
102 dh_gencontrol
103 dh_md5sums
104 dh_builddeb
106 binary: binary-indep binary-arch
107 .PHONY: build clean binary-indep binary-arch binary install