hardcode /bin/sh to idl2wrs
[obnox/wireshark/wip.git] / debian / rules
1 #!/usr/bin/make -f
2 # Made with the aid of dh_make, by Craig Small
3 # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
4 # Some lines taken from debmake, by Cristoph Lameter.
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
9 include /usr/share/dpatch/dpatch.make 
10 DB2MAN=/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
11
12
13 DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14 DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15
16 PYTHON_VERSION=python2.4
17
18 CFLAGS=-g -O2
19
20 # Enable IEEE-conformant floating point math on alphas (not the default)
21 ifeq (alpha-linux,$(DEB_HOST_GNU_TYPE))
22   CFLAGS += -mieee
23 endif
24
25 CONFIGURE_FLAGS=--prefix=/usr --sysconfdir=/usr/share --datadir=/usr/share --libdir=/usr/lib/wireshark --disable-static --enable-warnings-as-errors=no --enable-setuid-install --with-plugins=/usr/lib/wireshark/plugins --with-lua=/usr/
26
27 configure: configure-stamp
28 configure-stamp: patch
29         dh_testdir
30
31         cp /usr/share/misc/config.guess /usr/share/misc/config.sub .
32         libtoolize --force --copy
33         -mkdir aclocal-missing
34         ./autogen.sh
35         CFLAGS="$(CFLAGS)" ./configure $(CONFIGURE_FLAGS)
36
37         touch configure-stamp
38
39 build: build-stamp
40 build-stamp: configure-stamp
41         $(MAKE)
42
43         touch build-stamp
44
45 patch: patch-stamp
46 patch-stamp:
47         dpatch apply-all
48
49
50 clean: unpatch-stamp
51         dh_testdir
52         dh_testroot
53         rm -f build-stamp configure-stamp
54
55         [ ! -f Makefile ] || $(MAKE) distclean 
56         rm -f rdps wireshark.1 tshark.1 wireshark-filter.4
57         rm -f conftest conftest.c
58         rm -f config.guess config.sub config.log
59         rm -f config.h.in config.h configure
60
61         dh_clean
62
63 unpatch: unpatch-stamp
64 unpatch-stamp:
65         dpatch deapply-all
66         rm -rf patch-stamp debian/patched
67
68 install: build
69         dh_testdir
70         dh_testroot
71         dh_clean -k
72         dh_installdirs
73
74         # Add here commands to install the files into debian/tmp
75         $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
76         mkdir -p $(CURDIR)/debian/tmp/usr/share/applications/
77         cp debian/wireshark.desktop $(CURDIR)/debian/tmp/usr/share/applications/
78         cp tools/idl2wrs $(CURDIR)/debian/tmp/usr/bin/
79         #cp debian/wireshark-root.desktop $(CURDIR)/debian/tmp/usr/share/applications/
80         mkdir -p $(CURDIR)/debian/tmp/usr/share/pixmaps/
81         cp image/hi48-app-wireshark.png $(CURDIR)/debian/tmp/usr/share/pixmaps/
82         cp image/wsicon32.xpm $(CURDIR)/debian/tmp/usr/share/pixmaps/
83         mkdir -p $(CURDIR)/debian/tmp/etc/wireshark/
84         mv $(CURDIR)/debian/tmp/usr/share/wireshark/init.lua \
85                 $(CURDIR)/debian/tmp/etc/wireshark/
86         ln -s /etc/wireshark/init.lua \
87                 $(CURDIR)/debian/tmp/usr/share/wireshark/init.lua
88         mkdir -p $(CURDIR)/debian/tmp/usr/lib/$(PYTHON_VERSION)/site-packages/
89         cp $(CURDIR)/tools/wireshark_be.py $(CURDIR)/tools/wireshark_gen.py \
90                         $(CURDIR)/debian/tmp/usr/lib/$(PYTHON_VERSION)/site-packages/
91         mkdir -p $(CURDIR)/debian/tmp/usr/include/wireshark/
92         for F in `cat debian/wireshark-dev.header-files`; do \
93                 cp --parents $$F $(CURDIR)/debian/tmp/usr/include/wireshark; \
94         done
95         -rm -rf $(CURDIR)/debian/tmp/usr/man
96         dh_installman
97
98         dh_movefiles
99         dh_pysupport
100         dh_installdocs
101         dh_installmenu
102         dh_installchangelogs NEWS
103
104 # Build architecture-independent files here.
105 binary-indep: install
106 # We have nothing to do by default.
107
108 check: install
109         # check all necessary headers are included
110         gcc -c debian/headers-check.c `pkg-config --cflags glib-2.0` -Idebian/wireshark-dev/usr/include/ -Idebian/wireshark-dev/usr/include/wireshark/ -o /dev/null
111
112 # Build architecture-dependent files here.
113 binary-arch: install check
114         dh_strip
115         dh_compress
116         dh_fixperms -Xdumpcap
117
118         dh_installdeb
119         LD_LIBRARY_PATH=/usr/lib/wireshark/:/usr/lib/libfakeroot/ dh_shlibdeps
120         dh_gencontrol
121         dh_md5sums
122         dh_builddeb
123
124 source diff:
125         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
126
127 binary: binary-indep binary-arch
128 .PHONY: build clean install check binary-indep binary-arch binary