apply FSL(Flora Software License)
[apps/home/libug-worldclock-efl.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 PREFIX ?= /opt/ug
13 LIBDIR ?= /opt/ug/lib
14 DATADIR ?= /opt/ug/res
15
16 CFLAGS ?= -fPIC -Wall -g
17
18 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
19         CFLAGS += -O0
20 else
21         CFLAGS += -O2
22 endif
23
24 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--hash-style=both
25
26 BUILD_TMP_DIR   ?= cmake_build_tmp
27 CMAKE_BUILD_DIR ?= $(CURDIR)/$(BUILD_TMP_DIR)
28
29 configure: configure-stamp
30 configure-stamp:
31         dh_testdir
32         # Add here commands to configure the package.
33         mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
34         CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake $(CURDIR) -DCMAKE_INSTALL_PREFIX=$(PREFIX)
35         touch $(CMAKE_BUILD_DIR)/configure-stamp
36
37 build: build-stamp
38
39 build-stamp: configure-stamp 
40         dh_testdir
41
42         # Add here commands to compile the package.
43         $(MAKE) -C $(CMAKE_BUILD_DIR)
44         #docbook-to-man debian/worldclock.sgml > worldclock.1
45
46         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
47                 cat $$f > $${f%.in}; \
48                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
49                 sed -i -e "s#@LIBDIR@#$(LIBDIR)#g" $${f%.in}; \
50                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
51         done
52
53         touch $(CMAKE_BUILD_DIR)/$@
54
55 clean:
56         dh_testdir
57         dh_testroot
58         rm -f $(CMAKE_BUILD_DIR)/build-stamp $(CMAKE_BUILD_DIR)/configure-stamp
59
60         # Add here commands to clean up after the build process.
61         mkdir -p $(CMAKE_BUILD_DIR)
62         -$(MAKE) -C $(CMAKE_BUILD_DIR) clean
63         rm -rf $(CMAKE_BUILD_DIR)
64         find -name CMakeCache.txt | xargs rm -rf
65         find -name CMakeFiles | xargs rm -rf
66         find -name cmake_install.cmake | xargs rm -rf
67         find -name Makefile | xargs rm -rf
68         find -name install_manifest.txt | xargs rm -rf
69         find -name *.so | xargs rm -rf
70         find -name *.edj | xargs rm -rf
71         find -name *.desktop | xargs rm -rf
72         find -name *.pc | xargs rm -rf
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/tmp.
87         $(MAKE) -C $(CMAKE_BUILD_DIR) DESTDIR=$(CURDIR)/debian/tmp install
88
89
90 # Build architecture-independent files here.
91 binary-indep: build install
92 # We have nothing to do by default.
93
94 # Build architecture-dependent files here.
95 binary-arch: build install
96         dh_testdir
97         dh_testroot
98 #       dh_installchangelogs 
99 #       dh_installdocs
100         dh_installexamples
101         dh_install --sourcedir=debian/tmp
102 #       dh_installmenu
103 #       dh_installdebconf       
104 #       dh_installlogrotate
105 #       dh_installemacsen
106 #       dh_installpam
107 #       dh_installmime
108 #       dh_python
109 #       dh_installinit
110 #       dh_installcron
111 #       dh_installinfo
112         dh_installman
113         dh_link
114 #       dh_strip
115         dh_strip --dbg-package=libug-worldclock-efl-dbg
116         dh_compress
117         dh_fixperms
118 #       dh_perl
119         dh_makeshlibs
120         dh_installdeb
121         dh_shlibdeps
122         dh_gencontrol
123         dh_md5sums
124         dh_builddeb
125
126 binary: binary-indep binary-arch
127 .PHONY: build clean binary-indep binary-arch binary install configure