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