upload tizen1.0 source
[framework/web/wrt-plugins-common.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 PACKAGE_VERSION ?= $(shell dpkg-parsechangelog | sed -n 's/^Version: // p')
10 PREFIX ?= /usr
11 CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build
12 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--hash-style=both -Wl,--version-script=$(CURDIR)/wrt-plugins-common.map
13
14 ifeq (,$(findstring no,$(DPL_LOGS)))
15         DPL_LOGS_STATUS = "ON"
16 else
17         DPL_LOGS_STATUS = "OFF"
18 endif
19
20 configure-stamp:
21                 dh_testdir
22                 # Add here commands to configure the package.
23                         mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
24                 CFLAGS= cmake ${SRCDIR}  \
25                         LDFLAGS="$(LDFLAGS)" \
26                         -DCMAKE_INSTALL_PREFIX="${PREFIX}"      \
27                         -DDPL_LOG=$(DPL_LOGS_STATUS)            \
28                         -DCMAKE_PROJECT_VERSION="$(PACKAGE_VERSION)" ..
29 build: build-stamp
30
31 build-stamp:  configure-stamp
32         dh_testdir
33
34         # Add here commands to compile the package.
35         cd $(CMAKE_BUILD_DIR) && $(MAKE) -j4
36         #docbook-to-man debian/ncurses.sgml > ncurses.1
37
38         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
39                 cat $$f > $${f%.in}; \
40                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
41         done
42
43         touch $@
44
45 clean:
46         dh_testdir
47         dh_testroot
48         rm -f build-stamp configure-stamp
49         rm -rf $(CMAKE_BUILD_DIR)
50 #       -$(MAKE) distclean
51         ./clean.sh
52
53 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
54         cp -f /usr/share/misc/config.sub config.sub
55 endif
56 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
57         cp -f /usr/share/misc/config.guess config.guess
58 endif
59
60         for f in `find $(CURDIR)/ -name "*.pc"`; do \
61                 rm -f $${f%.pc}; \
62         done
63
64         dh_clean
65
66 install: build
67         dh_testdir
68         dh_testroot
69         dh_clean -k
70         dh_installdirs
71
72         # Add here commands to install the package into debian/ncurses.
73         cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
74
75 # Build architecture-independent files here.
76 binary-indep: build install
77 # We have nothing to do by default.
78
79 # Build architecture-dependent files here.
80 binary-arch: build install
81         dh_testdir
82         dh_testroot
83         dh_installchangelogs
84         dh_installdocs
85         dh_installexamples
86         dh_install --sourcedir=debian/tmp
87 #       dh_installmenu
88 #       dh_installdebconf
89 #       dh_installlogrotate
90 #       dh_installemacsen
91 #       dh_installpam
92 #       dh_installmime
93 #       dh_python
94 #       dh_installinit
95 #       dh_installcron
96 #       dh_installinfo
97         dh_installman
98         dh_link
99         dh_strip --dbg-package=wrt-plugins-common-dbg
100         dh_compress
101         dh_fixperms
102 #       dh_perl
103         dh_makeshlibs
104         dh_installdeb
105         dh_shlibdeps
106         dh_gencontrol
107         dh_md5sums
108         dh_builddeb
109
110 binary: binary-indep binary-arch
111 .PHONY: build clean binary-indep binary-arch binary install