0 | 0 |
#!/usr/bin/make -f
|
1 | 1 |
# -*- makefile -*-
|
2 | |
# Sample debian/rules that uses debhelper.
|
3 | |
# This file was originally written by Joey Hess and Craig Small.
|
4 | |
# As a special exception, when this file is copied by dh-make into a
|
5 | |
# dh-make output file, you may use that output file without restriction.
|
6 | |
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
7 | 2 |
|
8 | 3 |
# Uncomment this to turn on verbose mode.
|
9 | 4 |
#export DH_VERBOSE=1
|
|
18 | 13 |
VER_MINOR=$(shell grep ^VERSION_MINOR configure.in|cut -d= -f2)
|
19 | 14 |
VER_PATCH=$(shell grep ^VERSION_PATCH configure.in|cut -d= -f2|cut -dr -f1)
|
20 | 15 |
VER=$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)
|
|
16 |
|
21 | 17 |
ifeq (..,$(VER))
|
22 | 18 |
$(error configure.in not found or version cannot be guessed)
|
23 | 19 |
else
|
24 | 20 |
$(info Guessed geos version is $(VER))
|
25 | 21 |
endif
|
26 | 22 |
|
27 | |
CFLAGS = -Wall -g
|
28 | 23 |
CXX = g++ -fpermissive
|
29 | 24 |
|
30 | |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
31 | |
CFLAGS += -O0
|
32 | |
else
|
33 | |
CFLAGS += -O2
|
34 | |
endif
|
35 | |
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
36 | |
INSTALL_PROGRAM += -s
|
37 | |
endif
|
38 | 25 |
# catch both armel and armhf
|
39 | 26 |
ifneq (,$(findstring arm-linux-gnueabi,$(DEB_HOST_GNU_TYPE)))
|
40 | 27 |
CONFFLAGS += --disable-inline
|
41 | 28 |
endif
|
42 | 29 |
|
43 | 30 |
debian/control:
|
44 | |
@sed -e 's/@VERSION@/$(VER)/' debian/control.in >$@
|
|
31 |
@sed -e 's/@VERSION@/$(VER)/' debian/control.in >$@
|
45 | 32 |
|
46 | |
config.status: debian/control configure
|
47 | |
dh_testdir
|
48 | |
# Add here commands to configure the package.
|
49 | |
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
|
50 | |
mv config.sub config.sub.bak
|
51 | |
cp -f /usr/share/misc/config.sub config.sub
|
52 | |
endif
|
53 | |
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
|
54 | |
mv config.guess config.guess.bak
|
55 | |
cp -f /usr/share/misc/config.guess config.guess
|
56 | |
endif
|
57 | |
CXX="$(CXX)" CFLAGS="$(CFLAGS)" ./configure \
|
58 | |
--host=$(DEB_HOST_GNU_TYPE) \
|
59 | |
--build=$(DEB_BUILD_GNU_TYPE) \
|
60 | |
--enable-ruby \
|
61 | |
--prefix=/usr \
|
62 | |
--mandir=\$${prefix}/share/man \
|
63 | |
--infodir=\$${prefix}/share/info $(CONFFLAGS)
|
|
33 |
%:
|
|
34 |
dh $@ --with autoreconf
|
|
35 |
|
|
36 |
override_dh_clean:
|
|
37 |
dh_clean
|
|
38 |
|
|
39 |
rm -f debian/libgeos-$(VER).install debian/libgeos-$(VER).dirs debian/libgeos++-dev.install
|
|
40 |
|
|
41 |
override_dh_auto_configure: debian/control
|
|
42 |
dh_auto_configure -- \
|
|
43 |
--host=$(DEB_HOST_GNU_TYPE) \
|
|
44 |
--build=$(DEB_BUILD_GNU_TYPE) \
|
|
45 |
--enable-ruby \
|
|
46 |
--mandir=\$${prefix}/share/man \
|
|
47 |
--infodir=\$${prefix}/share/info \
|
|
48 |
$(CONFFLAGS) \
|
|
49 |
CXX="$(CXX)" \
|
|
50 |
$(shell dpkg-buildflags --export=configure)
|
|
51 |
|
64 | 52 |
cp debian/libgeos-c++.install debian/libgeos-$(VER).install
|
65 | 53 |
cp debian/libgeos-c++.dirs debian/libgeos-$(VER).dirs
|
66 | 54 |
|
67 | |
#Architecture
|
68 | |
build: build-arch build-indep
|
|
55 |
override_dh_auto_build-arch:
|
|
56 |
dh_auto_build --arch
|
69 | 57 |
|
70 | |
build-arch: build-arch-stamp
|
71 | |
build-arch-stamp: config.status
|
72 | |
# Add here commands to compile the arch part of the package.
|
73 | |
CXX="$(CXX)" CFLAGS="$(CFLAGS)" $(MAKE)
|
74 | |
touch $@
|
|
58 |
override_dh_auto_build-indep:
|
|
59 |
$(MAKE) -C doc doxygen-html
|
75 | 60 |
|
76 | |
build-indep: build-indep-stamp
|
77 | |
build-indep-stamp: config.status
|
78 | |
# Add here commands to compile the indep part of the package.
|
79 | |
$(MAKE) -C doc doxygen-html
|
80 | |
touch $@
|
|
61 |
override_dh_install-arch:
|
|
62 |
# add C++ headers to C++ dev package install file
|
|
63 |
cp debian/libgeos++-dev.install.in debian/libgeos++-dev.install
|
|
64 |
find debian/tmp/usr/include/geos -name "*.h" -a ! -name "export.h" | sed -e 's/^debian\/tmp\///' >>debian/libgeos++-dev.install
|
81 | 65 |
|
82 | |
clean:
|
83 | |
dh_testdir
|
84 | |
dh_testroot
|
85 | |
[ ! -f Makefile ] || $(MAKE) distclean
|
86 | |
[ -f config.sub.bak ] && mv config.sub.bak config.sub || true
|
87 | |
[ -f config.guess.bak ] && mv config.guess.bak config.guess || true
|
88 | |
dh_clean
|
89 | |
rm -f debian/libgeos-$(VER).install debian/libgeos-$(VER).dirs debian/libgeos++-dev.install
|
|
66 |
dh_install --same-arch
|
90 | 67 |
|
91 | |
install: install-indep install-arch
|
92 | |
install-indep:
|
93 | |
dh_testdir
|
94 | |
dh_testroot
|
95 | |
dh_prep -i
|
96 | |
dh_installdirs -i
|
|
68 |
# remove the library from the -dev package
|
|
69 |
rm -f $(CURDIR)/debian/libgeos-dev/usr/lib/libgeos-*.so
|
|
70 |
|
|
71 |
override_dh_install-indep:
|
97 | 72 |
dh_install -i
|
98 | |
# debian/libgeos-doc
|
|
73 |
|
99 | 74 |
# Install doxygen html files
|
100 | 75 |
install -m 644 doc/doxygen_docs/html/* debian/libgeos-doc/usr/share/doc/libgeos-doc/html
|
|
76 |
|
101 | 77 |
# Install example program source
|
102 | 78 |
install -m 644 doc/example.cpp debian/libgeos-doc/usr/share/doc/libgeos-doc/examples
|
103 | 79 |
install -m 644 debian/Makefile.example debian/libgeos-doc/usr/share/doc/libgeos-doc/examples/Makefile
|
104 | 80 |
|
105 | |
install-arch:
|
106 | |
dh_testdir
|
107 | |
dh_testroot
|
108 | |
dh_prep -s
|
109 | |
dh_installdirs -s
|
110 | |
# Add here commands to install the arch part of the package into
|
111 | |
# debian/tmp.
|
112 | |
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
|
113 | |
|
114 | |
# add C++ headers to C++ dev package install file
|
115 | |
cp debian/libgeos++-dev.install.in debian/libgeos++-dev.install
|
116 | |
find debian/tmp/usr/include/geos -name "*.h" -a ! -name "export.h" | sed -e 's/^debian\/tmp\///' >>debian/libgeos++-dev.install
|
117 | |
|
118 | |
dh_install -s --sourcedir=debian/tmp
|
|
81 |
override_dh_installman:
|
119 | 82 |
dh_installman -plibgeos-dev debian/geos-config.1
|
120 | |
# remove the library from the -dev package
|
121 | |
rm -f $(CURDIR)/debian/libgeos-dev/usr/lib/libgeos-*.so
|
122 | 83 |
|
123 | |
# Must not depend on anything. This is to be called by
|
124 | |
# binary-arch/binary-indep
|
125 | |
# in another 'make' thread.
|
126 | |
binary-common:
|
127 | |
dh_testdir
|
128 | |
dh_testroot
|
129 | |
dh_installchangelogs
|
130 | |
dh_installdocs
|
131 | |
dh_installexamples
|
132 | |
dh_installman
|
133 | |
dh_link
|
|
84 |
override_dh_strip:
|
134 | 85 |
dh_strip --dbg-package=libgeos-dbg
|
135 | |
dh_compress
|
136 | |
dh_fixperms
|
|
86 |
|
|
87 |
override_dh_makeshlibs:
|
137 | 88 |
dh_makeshlibs -V
|
138 | |
dh_installdeb
|
139 | |
dh_shlibdeps
|
|
89 |
|
|
90 |
override_dh_gencontrol:
|
140 | 91 |
for i in $$(grep ^Package: debian/control|cut -d' ' -f2); do \
|
141 | |
echo "geos:Version=$(VER)" >> $$i.substvars; \
|
|
92 |
echo "geos:Version=$(VER)" >> $$i.substvars; \
|
142 | 93 |
done
|
|
94 |
|
143 | 95 |
dh_gencontrol
|
144 | |
dh_md5sums
|
145 | |
dh_builddeb
|
146 | 96 |
|
147 | |
# Build architecture independant packages using the common target.
|
148 | |
binary-indep: build-indep install-indep
|
149 | |
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
|
150 | |
|
151 | |
# Build architecture dependant packages using the common target.
|
152 | |
binary-arch: build-arch install-arch
|
153 | |
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
|
154 | |
|
155 | |
binary: binary-indep binary-arch
|
156 | |
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch debian/control
|