upload source
[pkgs/d/drm-trusted.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
13 # These are used for cross-compiling and for saving the configure script
14 # from having to guess our platform (since we know it already)
15 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
16 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
17
18 CFLAGS ?= -Wall -g
19 CFLAGS += -fPIC
20 CXXFLAGS ?= -Wall -g
21 CXXFLAGS += -fPIC
22
23 PREFIX ?= /usr
24 DATADIR ?= /opt
25
26 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
27         CFLAGS += -O0
28         CXXFLAGS += -O0
29 else
30         CFLAGS += -O2
31         CXXFLAGS += -O2
32 endif
33
34 LDFLAGS += --rpath=$(PREFIX)/lib -Wl,--as-needed
35
36 configure: configure-stamp
37 configure-stamp:
38         dh_testdir
39         # Add here commands to configure the package.
40         CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake . -DCMAKE_INSTALL_PREFIX=$(PREFIX)
41         touch configure-stamp
42
43 build: build-stamp
44
45 build-stamp:  configure-stamp
46         dh_testdir
47
48         # Add here commands to compile the package.
49         $(MAKE)
50         #docbook-to-man debian/ncurses.sgml > ncurses.1
51
52         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
53                 cat $$f > $${f%.in}; \
54                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
55                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
56         done
57
58         touch $@
59
60 clean:
61         dh_testdir
62         dh_testroot
63         rm -f build-stamp configure-stamp
64
65         # Add here commands to clean up after the build process.
66         -$(MAKE) clean
67         rm -rf CMakeCache.txt
68         rm -rf CMakeFiles
69         rm -rf cmake_install.cmake
70         rm -rf Makefile
71         rm -rf install_manifest.txt
72         rm -rf *.pc
73
74         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
75                 rm -f $${f%.in}; \
76         done
77         dh_clean
78
79 install: build
80         dh_testdir
81         dh_testroot
82         dh_prep
83         dh_installdirs
84
85         # Add here commands to install the package into debian/ncurses.
86         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
87
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_installexamples
98         dh_install --sourcedir=debian/tmp
99 #       dh_installmenu
100 #       dh_installdebconf
101 #       dh_installlogrotate
102 #       dh_installemacsen
103 #       dh_installpam
104 #       dh_installmime
105 #       dh_python
106 #       dh_installinit
107 #       dh_installcron
108 #       dh_installinfo
109         dh_installman
110         dh_link
111         #dh_strip                                #before
112         dh_strip --dbg-package=drm-trusted-0-dbg #after
113         dh_compress
114         dh_fixperms
115 #       dh_perl
116         dh_makeshlibs
117         dh_installdeb
118         dh_shlibdeps
119         dh_gencontrol
120         dh_md5sums
121         dh_builddeb
122
123 binary: binary-indep binary-arch
124 .PHONY: build clean binary-indep binary-arch binary install