rename Apache-2.0 to LICENSE
[apps/agl-service-unicens.git] / conf.d / packaging / debian.rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Uncomment this to turn on verbose mode.
4 export DH_VERBOSE=1
5
6 # These are used for cross-compiling and for saving the configure script
7 # from having to guess our platform (since we know it already)
8 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
9 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
10
11
12 CFLAGS = -Wall -g
13
14 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
15        CFLAGS += -O0
16 else
17        CFLAGS += -O2
18 endif
19 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
20        INSTALL_PROGRAM += -s
21 endif
22
23 configure: configure-stamp
24 configure-stamp:
25         dh_testdir
26         #
27         touch configure-stamp
28
29 build: build-stamp
30 build-stamp: configure-stamp
31         dh_testdir
32         mkdir -p build
33         cd build;cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=/opt/AGL/UNICENS-agent -DCMAKE_INSTALL_LIBDIR:PATH=lib/$(DEB_HOST_MULTIARCH);$(MAKE)
34         #
35         touch build-stamp
36
37 clean:
38         #dh_testdir
39         dh_testroot
40         rm -f configure-stamp build-stamp
41         [ ! -f Makefile ] || $(MAKE) distclean
42         #dh_clean
43
44 install: build
45         dh_testdir
46         dh_testroot
47         dh_prep
48         dh_installdirs
49         # Add here commands to install the package into debian/tmp
50         mkdir -p debian/tmp/opt/AGL/UNICENS-agent;cd build;make populate;cp -r package/* ../debian/tmp/opt/AGL/UNICENS-agent/
51         mkdir -p debian/tmp/etc/profile.d
52         echo '#----------  AGL UNICENS-agent options Start ---------" '  > debian/tmp/etc/profile.d/AGL_UNICENS-agent.sh
53         echo '# Object: AGL cmake option for  binder/bindings'  >> debian/tmp/etc/profile.d/AGL_UNICENS-agent.sh
54         echo 'export LD_LIBRARY_PATH=/opt/AGL/UNICENS-agent/lib/$(DEB_HOST_MULTIARCH):$$LD_LIBRARY_PATH'  >> debian/tmp/etc/profile.d/AGL_UNICENS-agent.sh
55         echo 'export LIBRARY_PATH=/opt/AGL/UNICENS-agent/lib/$(DEB_HOST_MULTIARCH):$$LIBRARY_PATH'  >> debian/tmp/etc/profile.d/AGL_UNICENS-agent.sh
56         echo 'export PATH=/opt/AGL/UNICENS-agent/bin:$$PATH'  >> debian/tmp/etc/profile.d/AGL_UNICENS-agent.sh
57         echo '#----------  AGL options End ---------'  >> debian/tmp/etc/profile.d/AGL_UNICENS-agent.sh
58         # Move all files in their corresponding package
59         dh_install --list-missing -s --sourcedir=debian/tmp
60         # empty dependency_libs in .la files
61         #sed -i "/dependency_libs/ s/'.*'/''/" `find debian/ -name '*.la'`
62
63 # Build architecture-independent files here.
64 binary-indep: build install
65 # We have nothing to do by default.
66
67 # Build architecture-dependent files here.
68 binary-arch: build install
69         dh_testdir
70         dh_testroot
71         dh_installchangelogs
72         dh_installdocs
73         dh_installexamples
74         dh_installman
75         dh_link
76         dh_strip
77         dh_compress
78         dh_fixperms
79         dh_makeshlibs -V
80         dh_installdeb
81         dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
82         dh_gencontrol
83         dh_md5sums
84         dh_builddeb
85
86 binary: binary-indep binary-arch
87 .PHONY: build clean binary-indep binary-arch binary install