Initialize Tizen 2.3
[framework/system/oma-dm-agent.git] / debian / rules
1 #!/usr/bin/make -f
2
3 ## DO NOT MODIFY THIS AREA : BEGIN
4
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
7
8 # $(PKGDIR) is a package build directory to create a final .deb package .
9 #include debian/control.slp
10
11 PKGDIR = debian/PKG
12 ifneq (,$(filter ide,$(DEB_BUILD_OPTIONS)))
13 DESTDIR = .
14 else
15 DESTDIR = ..
16 endif
17 CONTROLFILE = debian/control.slp
18 CONTROLFILE_SRC = debian/control
19
20 CFLAGS = -Wall -g
21
22 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
23         CFLAGS += -O0
24 else
25         CFLAGS += -O2
26 endif
27
28 build: pre-build configure
29         # Add here commands to compile the package.
30         $(MAKE)
31
32 configure: 
33         cmake . -DCMAKE_INSTALL_PREFIX=${AppInstallPath} -DCMAKE_PROJECT=${Source}
34         rm -rf CMakeFiles/CompilerIdC*
35 #       sed 's/^Package:.*$$/Package: $(Package)/' $(CONTROLFILE_SRC) > $(CONTROLFILE_SRC).tmp ; mv -f $(CONTROLFILE_SRC).tmp $(CONTROLFILE_SRC)
36
37 clean: 
38         # Add here commands to clean up before the build process.
39         # debian clean
40         -$(MAKE) clean
41
42         -find . -name "CMakeFiles" -exec rm -rf {} \;
43         -find . -name "CMakeCache.txt" -exec rm -rf {} \;
44         -find . -name "Makefile" -exec rm -rf {} \;
45         -find . -name "cmake_install.cmake" -exec rm -rf {} \;
46         -find . -name "install_manifest.txt" -exec rm -rf {} \;
47         -find . -name "*.pc" -exec rm -rf {} \;
48         -find . -name "*.so" -exec rm -rf {} \;
49         
50         -rm -rf $(PKGDIR)
51
52         dh_clean
53
54 install: build pre-install
55         rm -rf $(PKGDIR)
56         mkdir $(PKGDIR)
57
58         # Add here commands to install the package into $(PKGDIR).
59         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
60
61         mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/init.d
62         install -c $(CURDIR)/syncmldm_mgr $(CURDIR)/debian/tmp/etc/rc.d/init.d
63
64         mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc3.d
65         ln -s ../init.d/syncmldm_mgr $(CURDIR)/debian/tmp/etc/rc.d/rc3.d/S91oma-dm-agent
66
67         mkdir -p $(CURDIR)/debian/tmp/etc/rc.d/rc5.d
68         ln -s ../init.d/syncmldm_mgr $(CURDIR)/debian/tmp/etc/rc.d/rc5.d/S91oma-dm-agent
69
70 # Build architecture-dependent files here.
71 binary: install pre-binary
72         dh_testdir
73         dh_testroot
74         #dh_installchangelogs
75         dh_installdocs
76         dh_installexamples
77         dh_install --sourcedir=debian/tmp
78         dh_link
79         dh_strip --dbg-package=oma-dm-agent
80         dh_compress
81         dh_fixperms
82         dh_makeshlibs
83         dh_installdeb
84         dh_shlibdeps
85         dh_gencontrol
86         dh_md5sums
87         dh_builddeb
88
89 .PHONY: build clean install binary 
90 ## DO NOT MODIFY THIS AREA : END
91
92 ## DO NOT MODIFY OR DELETE TARGET.
93 pre-build:
94         # Add here commands to execute before the build process.
95
96 pre-install:
97         # Add here commands to execute before installing the binaries into $(PKGDIR).
98
99 pre-binary:
100         # Add here commands to execute before creating a package.
101
102