Rename the main executable to "wireshark", along with more conversions:
[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 export DH_COMPAT=3
10
11 include /usr/share/dpatch/dpatch.make 
12 DB2MAN=/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
13
14
15 DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
16 DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
17
18 PYTHON_VERSION=python2.3
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 idl2deb.1: idl2deb.dbk
26         xsltproc --nonet --novalid $(DB2MAN) $<
27
28 asn2deb.1: asn2deb.dbk
29         xsltproc --nonet --novalid $(DB2MAN) $<
30
31 configure: configure-stamp
32 configure-stamp: patch
33         dh_testdir
34
35         cp /usr/share/misc/config.guess /usr/share/misc/config.sub .
36         libtoolize --force --copy
37         autoconf
38         -mkdir aclocal-missing
39         (if [ ! -x ./configure ]; then \
40            ./autogen.sh --prefix=/usr --sysconfdir=/usr/share/ethereal --disable-static --disable-ssl --without-ucdsnmp --enable-gtk2 --libdir=/usr/lib/ethereal CFLAGS="$(CFLAGS)"; \
41         fi)
42
43         ./configure --prefix=/usr --sysconfdir=/usr/share/ethereal --disable-static --disable-ssl --without-ucdsnmp --enable-gtk2 --libdir=/usr/lib/ethereal CFLAGS="$(CFLAGS)"
44
45         touch configure-stamp
46
47 build: build-stamp idl2deb.1 asn2deb.1
48 build-stamp: configure-stamp
49         $(MAKE)
50
51         touch build-stamp
52
53 patch: patch-stamp
54 patch-stamp:
55         dpatch apply-all
56
57
58 clean: unpatch-stamp
59         dh_testdir
60         dh_testroot
61         rm -f build-stamp configure-stamp
62
63         cp /usr/share/misc/config.guess /usr/share/misc/config.sub .
64         -$(MAKE) distclean
65         rm -f rdps ethereal.1 tshark.1 idl2deb.1 wireshark-filter.4 asn2deb.1
66         rm -f conftest conftest.c
67         rm -f config.guess config.sub config.log
68
69         dh_clean
70
71 unpatch: unpatch-stamp
72 unpatch-stamp:
73         dpatch deapply-all
74         rm -rf patch-stamp debian/patched
75
76 # Build architecture-independent files here.
77 binary-indep: build
78 # We have nothing to do by default.
79
80 # Build architecture-dependent files here.
81 binary-arch: build
82         dh_testdir
83         dh_testroot
84         dh_clean -k
85         dh_installdirs
86
87         # Add here commands to install the files into debian/tmp
88         $(MAKE) install DESTDIR=`pwd`/debian/tmp
89         mkdir -p `pwd`/debian/tmp/usr/share/applications/
90         cp ethereal.desktop `pwd`/debian/tmp/usr/share/applications/
91         cp debian/wireshark-root.desktop `pwd`/debian/tmp/usr/share/applications/
92         mkdir -p `pwd`/debian/tmp/usr/share/pixmaps/
93         cp image/hi48-app-ethereal.png `pwd`/debian/tmp/usr/share/pixmaps/
94         cp image/eicon3d32.xpm `pwd`/debian/tmp/usr/share/pixmaps/
95         mkdir -p `pwd`/debian/tmp/usr/lib/$(PYTHON_VERSION)/site-packages/
96         install -m 755 `pwd`/idl2deb `pwd`/debian/tmp/usr/bin/
97         install -m 755 `pwd`/asn2deb `pwd`/debian/tmp/usr/bin/
98         cp `pwd`/ethereal_be.py `pwd`/ethereal_gen.py \
99                         `pwd`/debian/tmp/usr/lib/$(PYTHON_VERSION)/site-packages/
100         mkdir -p `pwd`/debian/tmp/usr/include/ethereal/
101         for F in `cat debian/wireshark-dev.header-files`; do \
102                 cp --parents $$F `pwd`/debian/tmp/usr/include/ethereal; \
103         done
104         # .a is no longer built; why was is used ?
105         #cp `pwd`/wiretap/libwiretap.a `pwd`/debian/tmp/usr/lib/
106         -rm -rf `pwd`/debian/tmp/usr/man
107         dh_installman
108
109         dh_movefiles
110         dh_installdocs
111         -rm debian/menu   # from upstream debian/ package
112         dh_installmenu
113         dh_installchangelogs NEWS
114         dh_strip
115         dh_compress
116         dh_fixperms
117
118         dh_installdeb
119         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 binary-indep binary-arch binary