Git init
[pkgs/e/elektra.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 -fno-short-enums -DSQLFS_BACKEND -DTUNNING_ELEKTRA_0_7 -fpic
19 LDFLAGS = 
20 PREFIX ?= /usr
21 DATADIR ?= /opt
22
23 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
24         CFLAGS += -O0
25 else
26         CFLAGS += -O2
27 endif
28
29
30 configure: 
31         touch $(CURDIR)/config.rpath
32         autoheader
33         libtoolize --ltdl --copy --force
34         aclocal -Im4 -Ilibltdl
35         autoconf
36         automake --add-missing --copy --force
37
38 config.status: configure
39         dh_testdir
40         # Add here commands to configure the package.
41         ./configure --prefix=$(PREFIX) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" --without-docbook --enable-cpp=no --enable-hosts=no --without-libltdl --enable-shared=no
42
43
44 build: build-stamp
45
46 build-stamp:  config.status
47         dh_testdir
48
49         # Add here commands to compile the package.
50         $(MAKE)
51         #docbook-to-man debian/elektra.sgml > elektra.1
52
53         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
54                 cat $$f > $${f%.in}; \
55                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
56                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
57         done
58
59         touch $@
60
61 clean:
62         dh_testdir
63         dh_testroot
64         rm -f build-stamp 
65
66         # Add here commands to clean up after the build process.
67         -$(MAKE) distclean
68 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
69         cp -f /usr/share/misc/config.sub config.sub
70 endif
71 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
72         cp -f /usr/share/misc/config.guess config.guess
73 endif
74
75         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
76                 rm -f $${f%.in}; \
77         done
78
79 #       rm -f /usr/include/ltdl.*
80 #       rm -f /usr/lib/libltdl.*
81
82         -rm configure
83         -rm config.status *.stamp
84
85         dh_clean 
86
87 install: build
88         dh_testdir
89         dh_testroot
90         dh_clean -k 
91         dh_installdirs
92
93         # Add here commands to install the package into debian/tmp.
94         $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
95
96
97 # Build architecture-independent files here.
98 binary-indep: build install
99 # We have nothing to do by default.
100
101 # Build architecture-dependent files here.
102 binary-arch: build install
103         dh_testdir
104         dh_testroot
105         dh_install --sourcedir=debian/tmp
106         dh_installman
107         dh_link
108         dh_strip --dbg-package=libelektra-dbg
109         dh_compress
110         dh_fixperms
111         dh_makeshlibs
112         dh_installdeb
113         dh_shlibdeps
114         dh_gencontrol
115         dh_md5sums
116         dh_builddeb
117
118 binary: binary-indep binary-arch
119 .PHONY: build clean binary-indep binary-arch binary install