Code

Updated to new upstream release 1.6.4.
[pkg-pfstools.git] / debian / rules
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
26         
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
33         
34         CXXFLAGS="$(CXXFLAGS)" ./configure \
35                         --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
36                         --prefix=/usr --mandir=\$${prefix}/share/man \
37                         --with-moc=moc-qt3 \
38                         --with-octave-m-dir=$(MDIR)/pfstools \
39                         --with-octave-oct-dir=$(OCTDIR)/pfstools
41 build: build-stamp
43 build-stamp: config.status
44         dh_testdir
45         
46         $(MAKE)
47         
48         touch build-stamp
50 clean:
51         dh_testdir
52         dh_testroot
53         rm -f build-stamp 
54         
55         [ ! -f Makefile ] || $(MAKE) clean
56         [ ! -f Makefile ] || $(MAKE) distclean
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) DESTDIR=$(CURDIR)/debian/tmp install
74         
75         chmod 644 debian/tmp/usr/share/octave/site/api-v13/m/pfstools/*
76         
77         # these binaries are not available
78         rm debian/tmp/usr/share/man/man1/pfs*jpeghdr.1
80 binary-indep: build install
81         # nothing to do here
83 binary-arch: build install
84         dh_testdir
85         dh_testroot
86         dh_installchangelogs ChangeLog
87         dh_installdocs AUTHORS README TODO doc/faq.txt doc/pfs_format_spec.pdf
88         dh_installexamples
89         dh_install --sourcedir=debian/tmp --list-missing
90         # these files have been installed twice
91         rm -f debian/pfstools/usr/bin/pfs*view debian/pfstools/usr/bin/pfsv \
92                 debian/pfstools/usr/share/man/man1/pfsv.1 \
93                 debian/pfstools/usr/share/man/man1/pfs*view.1
94         dh_installman -ppfsglview debian/pfsglview.1
95         dh_link
96         dh_strip --dbg-package=pfstools-dbg
97         # mkoctfile removes any symbol table and relocation information from the
98         # .oct files making them unusable for the -dbg package
99         rm -rf debian/pfstools-dbg/usr/lib/debug/usr/lib/octave/
100         dh_compress -X.pdf
101         dh_fixperms
102         dh_makeshlibs
103         dh_installdeb
104         dh_shlibdeps -Llibpfs-1.2-0 -ldebian/libpfs-1.2-0/usr/lib/
105         dh_gencontrol
106         dh_md5sums
107         dh_builddeb
109 binary: binary-indep binary-arch
110 .PHONY: build clean binary-indep binary-arch binary install