upload tizen1.0 source
[framework/appfw/slp-pkgmgr.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 BUILDDIR = $(CURDIR)/cmake_tmp
13
14 CFLAGS ?= -Wall -g
15 CXXFLAGS ?=  -Wall -g
16 LDFLAGS ?= 
17 PREFIX ?= /usr
18 DATADIR ?= /opt
19
20 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
21         CFLAGS += -O0
22         CXXFLAGS += -O0
23 else
24         CFLAGS += -O2
25         CXXFLAGS += -O2
26 endif
27
28 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
29
30 configure: configure-stamp
31 configure-stamp:
32         dh_testdir
33         # Add here commands to configure the package.
34         mkdir -p $(BUILDDIR)    
35         cd $(BUILDDIR) && CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX)
36
37         touch configure-stamp
38
39 build: build-stamp
40
41 build-stamp: configure-stamp 
42         dh_testdir
43 # Add here commands to compile the package. 
44         cd $(BUILDDIR) && $(MAKE)
45
46         #docbook-to-man debian/wavplayer.sgml > wavplayer.1
47
48         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
49                 cat $$f > $${f%.in}; \
50                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
51                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
52         done
53
54
55         touch $@
56
57 clean:
58         dh_testdir
59         dh_testroot
60         rm -f build-stamp configure-stamp
61
62         # Add here commands to clean up after the build process.
63         -$(MAKE) clean
64         rm -rf CMakeCache.txt
65         rm -rf CMakeFiles
66         rm -rf cmake_install.cmake
67         rm -rf Makefile
68         rm -rf install_manifest.txt
69         rm -rf *.so
70         rm -rf *.pc
71
72         rm -rf $(BUILDDIR)
73
74         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
75                 rm -f $${f%.in}; \
76         done
77
78         dh_clean
79
80 install: build
81         dh_testdir
82         dh_testroot
83         dh_clean -k 
84         dh_installdirs
85
86         # Add here commands to install the package into debian/wavplayer.
87         cd $(BUILDDIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
88 #       mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/
89 #       ln -s ../init.d/ss-serverd $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S40ss-server
90
91
92 # Build architecture-independent files here.
93 binary-indep: build install
94 # We have nothing to do by default.
95
96 # Build architecture-dependent files here.
97 binary-arch: build install
98         dh_testdir
99         dh_testroot
100         dh_installchangelogs 
101         dh_installdocs
102         dh_installexamples
103         dh_install --sourcedir=debian/tmp
104 #       dh_installmenu
105 #       dh_installdebconf       
106 #       dh_installlogrotate
107 #       dh_installemacsen
108 #       dh_installpam
109 #       dh_installmime
110 #       dh_python
111 #       dh_installinit
112 #       dh_installcron
113 #       dh_installinfo
114         dh_installman
115         dh_link
116 #       dh_strip
117         dh_strip --dbg-package=pkgmgr-server-dbg
118         dh_compress
119         dh_fixperms
120 #       dh_perl
121         dh_makeshlibs
122         dh_installdeb
123         dh_shlibdeps
124         dh_gencontrol
125         dh_md5sums
126         dh_builddeb
127
128 binary: binary-indep binary-arch
129 .PHONY: build clean binary-indep binary-arch binary install configure