tizen beta release
[framework/multimedia/audio-session-manager.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_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
16 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
17 DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
18 DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_GNU_OS)
19
20 CFLAGS ?= -Wall -g
21 LDFLAGS ?= 
22 PREFIX ?= /usr
23 DATADIR ?= /opt
24
25 CFLAGS += -fPIC
26
27 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
28         CFLAGS += -O0 -DMM_DEBUG_FLAG
29 else
30         CFLAGS += -O2 -DMM_DEBUG_FLAG
31 endif
32
33
34 # architecture is not arm
35 ifneq (, $(findstring arm, $(DEB_HOST_ARCH)))
36         # do something here for arm architecture
37         # do something here
38         OPTION= --enable-security
39 else
40         OPTION= --enable-security
41 endif
42
43 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--hash-style=both -Wl,--as-needed
44
45 config.status: configure
46         dh_testdir
47         # Add here commands to configure the package.
48         dh_buildinfo generate cat
49         ./autogen.sh
50         CFLAGS="$(CFLAGS) -fvisibility=hidden -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\"" LDFLAGS="$(LDFLAGS)" ./configure --prefix=$(PREFIX) $(OPTION)
51
52 build: build-stamp
53
54 build-stamp:  config.status
55         dh_testdir
56
57         # Add here commands to compile the package.
58         $(MAKE)
59         #docbook-to-man debian/ncurses.sgml > ncurses.1
60
61         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
62                 cat $$f > $${f%.in}; \
63                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
64                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
65         done
66
67         touch $@
68
69 clean:
70         dh_testdir
71         dh_testroot
72         rm -f build-stamp 
73
74         # Add here commands to clean up after the build process.
75         -$(MAKE) distclean
76 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
77         cp -f /usr/share/misc/config.sub config.sub
78 endif
79 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
80         cp -f /usr/share/misc/config.guess config.guess
81 endif
82
83         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
84                 rm -f $${f%.in}; \
85         done
86
87         dh_clean 
88
89 install: build
90         dh_testdir
91         dh_testroot
92         dh_clean -k 
93         dh_installdirs -s
94
95         # Add here commands to install the package into debian/ncurses.
96         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
97         mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/
98         ln -s ../init.d/audiosessionmanager $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S30audiosessionmanager
99         mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc4.d/
100         ln -s ../init.d/audiosessionmanager $(CURDIR)/debian/tmp/etc/rc.d/rc4.d/S30audiosessionmanager
101
102
103 # Build architecture-independent files here.
104 binary-indep: build install
105 # We have nothing to do by default.
106
107 # Build architecture-dependent files here.
108 binary-arch: build install
109         dh_testdir
110         dh_testroot
111         dh_installchangelogs -s
112         dh_installdocs
113         dh_buildinfo install
114         dh_installexamples
115         dh_install -s --list-missing --sourcedir=debian/tmp
116 #       dh_installmenu
117 #       dh_installdebconf       
118 #       dh_installlogrotate
119 #       dh_installemacsen
120 #       dh_installpam
121 #       dh_installmime
122 #       dh_python
123 #       dh_installinit
124 #       dh_installcron
125 #       dh_installinfo
126         dh_installman
127         dh_link -s
128         dh_strip -s --dbg-package=libaudiosessionmgr-0-dbg
129         dh_compress -s
130         dh_fixperms -s
131 #       dh_perl
132         dh_makeshlibs -s
133         dh_installdeb -s
134         dh_shlibdeps -s
135         dh_gencontrol -s
136         dh_md5sums -s
137         dh_builddeb -s
138
139 binary: binary-indep binary-arch
140 .PHONY: build clean binary-indep binary-arch binary install