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