Move include files in debian packge into 'senf' subdirectory
[senf.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 debian_build=1
13 export debian_build
14
15 CFLAGS = -Wall -g
16
17 CONCURRENCY_LEVEL ?= 1
18
19 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
20         CFLAGS += -O0
21 else
22         CFLAGS += -O2
23 endif
24
25 # shared library versions, option 1
26 #version=2.0.5
27 #major=2
28 # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
29 #version=`ls src/.libs/lib*.so.* | \
30 # awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
31 #major=`ls src/.libs/lib*.so.* | \
32 # awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
33
34 destdir=$(CURDIR)/debian/tmp
35
36 configure: configure-stamp
37 configure-stamp:
38         dh_testdir
39 #       # Add here commands to configure the package.
40         rm -f Doxyfile.local SConfig
41 #       If needed, we could create new 'Doxyfile.local' and/or 'SConfig' files here.
42 #       We don't remove them in 'clean' to allow building a source package from an 
43 #       individually configured svn working copy.
44         touch configure-stamp
45
46 build: build-stamp
47 build-stamp: configure-stamp 
48         dh_testdir
49 #       # Add here commands to compile the package.
50         scons -j $(CONCURRENCY_LEVEL) final=1
51         scons -j $(CONCURRENCY_LEVEL) all_docs final=1
52         touch $@
53
54 clean:
55         dh_testdir
56         dh_testroot
57         rm -f build-stamp configure-stamp
58 #       # Add here commands to clean up after the build process.
59         -scons -c all
60         dh_clean
61
62 install: build
63         dh_testdir
64         dh_testroot
65         dh_clean -k 
66         dh_installdirs
67 #       # Add here commands to install the package into debian/tmp
68         scons  install_all final=1\
69                 PREFIX='$(destdir)/usr' \
70                 DOCINSTALLDIR='$$PREFIX/share/doc/libsenf-doc'
71 #       We need to install the example sourcecode
72         find Examples \( -name "*.hh" -o -name "*.cc" \) -printf "%P\n" | \
73                 while read src; do \
74                         dir="$(destdir)/usr/share/doc/libsenf-doc/examples/$$(dirname "$$src")"; \
75                         mkdir -p "$$dir"; \
76                         cp "Examples/$$src" "$$dir"; \
77                 done
78
79 # Build architecture-independent files here.
80 binary-indep: build install
81 # We have nothing to do by default.
82
83 # Build architecture-dependent files here.
84 binary-arch: build install
85         dh_testdir
86         dh_testroot
87         dh_installchangelogs 
88         dh_installdocs
89         dh_installexamples
90         dh_install
91 #       dh_installmenu
92 #       dh_installdebconf       
93 #       dh_installlogrotate
94 #       dh_installemacsen
95 #       dh_installpam
96 #       dh_installmime
97 #       dh_installinit
98 #       dh_installcron
99 #       dh_installinfo
100         dh_installman
101         dh_link
102         dh_strip
103         dh_compress
104         dh_fixperms
105 #       dh_perl
106 #       dh_python
107 #       dh_makeshlibs
108         dh_installdeb
109         dh_shlibdeps
110         dh_gencontrol
111         dh_md5sums
112         dh_builddeb
113
114 binary: binary-indep binary-arch
115 .PHONY: build clean binary-indep binary-arch binary install configure