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
24 config.status: configure
25 dh_testdir
27 for file in config.guess config.sub; do \
28 if [ ! -e $$file.upstream ]; then \
29 mv $$file $$file.upstream; \
30 ln -s /usr/share/misc/$$file .; \
31 fi \
32 done
34 CXXFLAGS="$(CXXFLAGS)" ./configure \
35 --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
36 --prefix=/usr --mandir=\$${prefix}/share/man \
37 --with-octave-m-dir=$(MDIR)/pfstools \
38 --with-octave-oct-dir=$(OCTDIR)/pfstools
40 build: build-stamp
42 build-stamp: config.status
43 dh_testdir
45 $(MAKE)
47 touch build-stamp
49 clean:
50 dh_testdir
51 dh_testroot
52 rm -f build-stamp
54 -$(MAKE) clean
55 -$(MAKE) distclean
57 for file in config.guess config.sub; do \
58 if [ -e $$file.upstream ]; then \
59 rm -f $$file; \
60 mv $$file.upstream $$file; \
61 fi \
62 done
64 dh_clean
66 install: build
67 dh_testdir
68 dh_testroot
69 dh_clean -k
70 dh_installdirs
72 $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
74 chmod 644 debian/tmp/usr/share/octave/site/api-v13/m/pfstools/*
76 # these binaries are not available
77 rm debian/tmp/usr/share/man/man1/pfs{in,out}jpeghdr.1
79 binary-indep: build install
80 # nothing to do here
82 binary-arch: build install
83 dh_testdir
84 dh_testroot
85 dh_installchangelogs ChangeLog
86 dh_installdocs AUTHORS README TODO doc/faq.txt doc/pfs_format_spec.pdf
87 dh_installexamples
88 dh_install --sourcedir=debian/tmp --list-missing
89 dh_installman debian/pfsglview.1
90 dh_link
91 dh_strip
92 dh_compress
93 dh_fixperms
94 dh_makeshlibs
95 dh_installdeb
96 dh_shlibdeps -Llibpfs-1.2-0 -ldebian/libpfs-1.2-0/usr/lib/
97 dh_gencontrol
98 dh_md5sums
99 dh_builddeb
101 binary: binary-indep binary-arch
102 .PHONY: build clean binary-indep binary-arch binary install