tizen beta release
[framework/connectivity/wpasupplicant.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12
13 # These are used for cross-compiling and for saving the configure script
14 # from having to guess our platform (since we know it already)
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 CFLAGS ?= -Wall -g
19 LDFLAGS ?=
20 PREFIX ?= /usr
21 DATADIR ?= /opt
22
23 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24         CFLAGS += -O0
25 else
26         CFLAGS += -O2
27 endif
28
29 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
30 CONFIG := debian/slp.config
31 #WPAGUI = wpa_gui-qt4
32
33 config.status: configure
34         dh_testdir
35         # Add here commands to configure the package.
36         CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --prefix=$(PREFIX) 
37
38 build: build-stamp
39 build-stamp:
40         dh_testdir
41
42         # wpa_supplicant
43         cp -v $(CONFIG) wpa_supplicant/.config
44         CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) -C wpa_supplicant all
45
46         # wpa_gui
47         #$(MAKE) -C wpa_supplicant $(WPAGUI)
48
49         # manpages
50         #$(MAKE) -C wpa_supplicant/doc/docbook man
51
52         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
53                 cat $$f > $${f%.in}; \
54                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
55                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
56         done
57
58         touch $@
59
60 clean:
61         dh_testdir
62         dh_testroot
63
64         $(MAKE) -C wpa_supplicant clean
65
66         #if [ -f wpa_supplicant/$(WPAGUI)/Makefile ]; then \
67         #       $(MAKE) -C wpa_supplicant/$(WPAGUI) distclean ; \
68         #fi
69
70         #$(MAKE) -C wpa_supplicant/doc/docbook clean
71
72         dh_clean wpa_supplicant/.config build-stamp install-stamp
73
74         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
75                 rm -f $${f%.in}; \
76         done
77
78 install: build
79         dh_testdir
80         dh_testroot
81         dh_clean -k 
82         dh_installdirs
83         dh_install
84
85         # Add here commands to install the package into debian/ncurses.
86         #$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
87
88         # ifupdown
89         #install --mode=755 -D debian/ifupdown/ifupdown.sh \
90         #       debian/wpasupplicant/etc/wpa_supplicant/ifupdown.sh
91         #install --mode=755 -D debian/ifupdown/functions.sh \
92         #       debian/wpasupplicant/etc/wpa_supplicant/functions.sh
93         #install --mode=755 -D debian/ifupdown/action_wpa.sh \
94         #       debian/wpasupplicant/etc/wpa_supplicant/action_wpa.sh
95
96         # wpa_action
97         #install --mode=755 -D debian/ifupdown/wpa_action.sh \
98         #       debian/wpasupplicant/sbin/wpa_action
99
100         # D-Bus
101         install --mode=644 -D wpa_supplicant/dbus/dbus-wpa_supplicant.conf \
102                 debian/wpasupplicant/$(PREFIX)/etc/dbus-1/system.d/wpa_supplicant.conf
103         install --mode=644 -D wpa_supplicant/dbus/fi.epitest.hostap.WPASupplicant.service \
104                 debian/wpasupplicant/$(PREFIX)/share/dbus-1/services/fi.epitest.hostap.WPASupplicant.service
105         install --mode=644 -D wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service \
106                 debian/wpasupplicant/$(PREFIX)/share/dbus-1/services/fi.w1.wpa_supplicant1.service
107
108         # sanitise the example configuration
109         mkdir -p debian/wpasupplicant/$(PREFIX)/share/doc/wpasupplicant
110         sed 's/^\([^#]\+=.*\|}\)/#\1/' < wpa_supplicant/wpa_supplicant.conf \
111                 > debian/wpasupplicant/$(PREFIX)/share/doc/wpasupplicant/README.wpa_supplicant.conf
112
113
114
115 # Build architecture-independent files here.
116 binary-indep: build install
117 # We have nothing to do by default.
118
119 # Build architecture-dependent files here.
120 binary-arch: build install
121         dh_testdir
122         dh_testroot
123 #       dh_installchangelogs 
124 #       dh_installdocs
125 #       dh_installexamples
126 #       dh_install --sourcedir=debian/tmp
127 #       dh_installmenu
128 #       dh_installdebconf       
129 #       dh_installlogrotate
130 #       dh_installemacsen
131 #       dh_installpam
132 #       dh_installmime
133 #       dh_python
134 #       dh_installinit
135 #       dh_installcron
136 #       dh_installinfo
137 #       dh_installman
138         dh_link
139         dh_strip -a --dbg-package=wpasupplicant-dbg
140         dh_compress
141         dh_fixperms
142 #       dh_perl
143         dh_makeshlibs
144         dh_installdeb
145         dh_shlibdeps
146         dh_gencontrol
147         dh_md5sums
148         dh_builddeb
149
150 binary: binary-indep binary-arch
151 .PHONY: build clean binary-indep binary-arch binary install