Frederic Peters <fpeters@debian.org>:
[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.3
17
18 # Enable IEEE-conformant floating point math on alphas (not the default)
19 ifeq (alpha-linux,$(DEB_HOST_GNU_TYPE))
20   CFLAGS += -mieee
21 endif
22
23 idl2deb.1: idl2deb.dbk
24         xsltproc --nonet --novalid $(DB2MAN) $<
25
26 asn2deb.1: asn2deb.dbk
27         xsltproc --nonet --novalid $(DB2MAN) $<
28
29
30 CONFIGURE_FLAGS=--prefix=/usr --sysconfdir=/usr/share/wireshark --datadir=/usr/share/wireshark --disable-static --disable-ssl --without-ucdsnmp --enable-gtk2 --libdir=/usr/lib/wireshark CFLAGS="$(CFLAGS)";
31
32 configure: configure-stamp
33 configure-stamp: patch
34         dh_testdir
35
36         cp /usr/share/misc/config.guess /usr/share/misc/config.sub .
37         libtoolize --force --copy
38         autoheader
39         autoconf
40         -mkdir aclocal-missing
41         (if [ ! -x ./configure ]; then \
42            ./autogen.sh $(CONFIGURE_FLAGS) CFLAGS="$(CFLAGS)"; \
43         fi)
44
45         ./configure $(CONFIGURE_FLAGS) CFLAGS="$(CFLAGS)"
46
47         touch configure-stamp
48
49 build: build-stamp idl2deb.1 asn2deb.1
50 build-stamp: configure-stamp
51         $(MAKE)
52
53         touch build-stamp
54
55 patch: patch-stamp
56 patch-stamp:
57         dpatch apply-all
58
59
60 clean: unpatch-stamp
61         dh_testdir
62         dh_testroot
63         rm -f build-stamp configure-stamp
64
65         -$(MAKE) distclean
66         rm -f rdps wireshark.1 tshark.1 idl2deb.1 wireshark-filter.4 asn2deb.1
67         rm -f conftest conftest.c
68         rm -f config.guess config.sub config.log
69         rm -f config.h.in config.h configure
70
71         dh_clean
72
73 unpatch: unpatch-stamp
74 unpatch-stamp:
75         dpatch deapply-all
76         rm -rf patch-stamp debian/patched
77
78 # Build architecture-independent files here.
79 binary-indep: build
80 # We have nothing to do by default.
81
82 # Build architecture-dependent files here.
83 binary-arch: build
84         dh_testdir
85         dh_testroot
86         dh_clean -k
87         dh_installdirs
88
89         # Add here commands to install the files into debian/tmp
90         $(MAKE) install DESTDIR=`pwd`/debian/tmp
91         mkdir -p `pwd`/debian/tmp/usr/share/applications/
92         cp wireshark.desktop `pwd`/debian/tmp/usr/share/applications/
93         cp tools/idl2wrs.sh `pwd`/debian/tmp/usr/bin/
94         cp debian/wireshark-root.desktop `pwd`/debian/tmp/usr/share/applications/
95         mkdir -p `pwd`/debian/tmp/usr/share/pixmaps/
96         cp image/hi48-app-wireshark.png `pwd`/debian/tmp/usr/share/pixmaps/
97         cp image/wsicon32.xpm `pwd`/debian/tmp/usr/share/pixmaps/
98         mkdir -p `pwd`/debian/tmp/usr/lib/$(PYTHON_VERSION)/site-packages/
99         install -m 755 `pwd`/idl2deb `pwd`/debian/tmp/usr/bin/
100         install -m 755 `pwd`/asn2deb `pwd`/debian/tmp/usr/bin/
101         cp `pwd`/tools/wireshark_be.py `pwd`/tools/wireshark_gen.py \
102                         `pwd`/debian/tmp/usr/lib/$(PYTHON_VERSION)/site-packages/
103         mkdir -p `pwd`/debian/tmp/usr/include/wireshark/
104         for F in `cat debian/wireshark-dev.header-files`; do \
105                 cp --parents $$F `pwd`/debian/tmp/usr/include/wireshark; \
106         done
107         # .a is no longer built; why was is used ?
108         #cp `pwd`/wiretap/libwiretap.a `pwd`/debian/tmp/usr/lib/
109         -rm -rf `pwd`/debian/tmp/usr/man
110         dh_installman
111
112         dh_movefiles
113         dh_installdocs
114         -rm debian/menu   # from upstream debian/ package
115         dh_installmenu
116         dh_installchangelogs NEWS
117         dh_strip
118         dh_compress
119         dh_fixperms
120
121         dh_installdeb
122         dh_shlibdeps
123         dh_gencontrol
124         dh_md5sums
125         dh_builddeb
126
127 source diff:                                                                  
128         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
129
130 binary: binary-indep binary-arch
131 .PHONY: build clean binary-indep binary-arch binary