f12218cbc4d13f38bde7dd7eaf6d62c03cebbb71
[external/libiri.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 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 LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
30
31 config.status: 
32         dh_testdir
33         # Add here commands to configure the package.
34         CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./autogen.sh --prefix=$(PREFIX) 
35
36 build: build-stamp
37
38 build-stamp:  config.status
39         dh_testdir
40 #       mkdir -p autotools
41 #       libtoolize --force || exit 1
42 #       aclocal -I autotools || exit 1
43 #       autoheader || exit 1
44 #       automake --add-missing --copy || exit 1
45 #       autoconf || exit 1
46
47         # Add here commands to compile the package.
48         $(MAKE)
49         #docbook-to-man debian/ncurses.sgml > ncurses.1
50
51         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
52                 cat $$f > $${f%.in}; \
53                 sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
54                 sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
55         done
56
57         touch $@
58
59 clean:
60         dh_testdir
61         dh_testroot
62         rm -f build-stamp 
63
64         # Add here commands to clean up after the build process.
65         -$(MAKE) distclean
66 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
67         cp -f /usr/share/misc/config.sub config.sub
68 endif
69 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
70         cp -f /usr/share/misc/config.guess config.guess
71 endif
72
73         for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
74                 rm -f $${f%.in}; \
75         done
76
77         dh_clean 
78
79 install: build
80         dh_testdir
81         dh_testroot
82         dh_clean -k 
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_installchangelogs 
98         dh_installdocs
99         dh_installexamples
100         dh_install --sourcedir=debian/tmp
101 #       dh_installmenu
102 #       dh_installdebconf       
103 #       dh_installlogrotate
104 #       dh_installemacsen
105 #       dh_installpam
106 #       dh_installmime
107 #       dh_python
108 #       dh_installinit
109 #       dh_installcron
110 #       dh_installinfo
111         dh_installman
112         dh_link
113         dh_strip
114         dh_compress
115         dh_fixperms
116 #       dh_perl
117         dh_makeshlibs
118         dh_installdeb
119         dh_shlibdeps
120         dh_gencontrol
121         dh_md5sums
122         dh_builddeb
123
124 binary: binary-indep binary-arch
125 .PHONY: build clean binary-indep binary-arch binary install