f1921e0322aecf04929245d564d7d1e9f30f5953
[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 local_config.hh
41         scons prepare
42 #       If needed, we could create new files 'Doxyfile.local',
43 #       'SConfig' and/or 'local_config.hh' here.  We don't remove them
44 #       in 'clean' to allow building a source package from an
45 #       individually configured svn working copy. (The files are ignored
46 #       by dpkg-buildpackge because of appropriate -I arguments provided 
47 #       by 'scons deb' and 'scons debsrc'
48         touch configure-stamp
49
50 build: build-stamp
51 build-stamp: configure-stamp 
52         dh_testdir
53 #       # Add here commands to compile the package.
54         scons -j $(CONCURRENCY_LEVEL) default all_docs final=1
55         scons linklint
56         scons fixlinks
57         touch $@
58
59 clean:
60         dh_testdir
61         dh_testroot
62         rm -f build-stamp configure-stamp
63 #       # Add here commands to clean up after the build process.
64         -scons -c all
65         dh_clean
66
67 install: build
68         dh_testdir
69         dh_testroot
70         dh_clean -k 
71         dh_installdirs
72 #       # Add here commands to install the package into debian/tmp
73         scons install_all final=1 \
74                 PREFIX='$(destdir)/usr' \
75                 DOCINSTALLDIR='$$PREFIX/share/doc/libsenf-doc' \
76                 INCLUDEINSTALLDIR='$$PREFIX/include/senf' 
77 #       We need to install the example sourcecode
78         find Examples \( -name "*.hh" -o -name "*.cc" \) -printf "%P\n" | \
79                 while read src; do \
80                         dir="$(destdir)/usr/share/doc/libsenf-doc/examples/$$(dirname "$$src")"; \
81                         mkdir -p "$$dir"; \
82                         cp "Examples/$$src" "$$dir"; \
83                 done
84
85 # Build architecture-independent files here.
86 binary-indep: build install
87 # We have nothing to do by default.
88
89 # Build architecture-dependent files here.
90 binary-arch: build install
91         dh_testdir
92         dh_testroot
93         dh_installchangelogs 
94         dh_installdocs
95         dh_installexamples
96         dh_install
97 #       dh_installmenu
98 #       dh_installdebconf       
99 #       dh_installlogrotate
100 #       dh_installemacsen
101 #       dh_installpam
102 #       dh_installmime
103 #       dh_installinit
104 #       dh_installcron
105 #       dh_installinfo
106         dh_installman
107         dh_link
108         dh_strip
109         dh_compress
110         dh_fixperms
111 #       dh_perl
112 #       dh_python
113 #       dh_makeshlibs
114         dh_installdeb
115         dh_shlibdeps
116         dh_gencontrol
117         dh_md5sums
118         dh_builddeb
119
120 binary: binary-indep binary-arch
121 .PHONY: build clean binary-indep binary-arch binary install configure