Codebase list geos / debian/3.5.1-3 debian / rules
debian/3.5.1-3

Tree @debian/3.5.1-3 (Download .tar.gz)

rules @debian/3.5.1-3raw · history · blame

#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# Verbose test output
export VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# testrunner fails on some architectures
DEB_BUILD_ARCH      ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

# Guessing geos version, which is required for C++ binding support
VER_MAJOR=$(shell grep ^VERSION_MAJOR configure.*|cut -d= -f2)
VER_MINOR=$(shell grep ^VERSION_MINOR configure.*|cut -d= -f2)
VER_PATCH=$(shell grep ^VERSION_PATCH configure.*|cut -d= -f2|cut -dr -f1)
VER=$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)

ifeq (..,$(VER))
$(error configure.ac/configure.in not found or version cannot be guessed)
else
$(info Guessed geos version is $(VER))
endif

CXX = g++ -fpermissive

# catch both armel and armhf 
ifneq (,$(findstring arm-linux-gnueabi,$(DEB_HOST_GNU_TYPE)))
       CONFFLAGS += --disable-inline
endif

debian/control: 
	@sed -e 's/@VERSION@/$(VER)/' debian/control.in >$@

%:
	dh $@ --with autoreconf,pkgkde_symbolshelper --parallel

override_dh_clean:
	dh_clean debian/libgeos++-dev.install

override_dh_auto_configure: debian/control
	dh_auto_configure -- \
		--host=$(DEB_HOST_GNU_TYPE) \
        	--build=$(DEB_BUILD_GNU_TYPE) \
        	--enable-ruby \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		$(CONFFLAGS) \
		CXX="$(CXX)" \
		$(shell dpkg-buildflags --export=configure)

override_dh_auto_build-arch:
	dh_auto_build --arch

override_dh_auto_build-indep:
	$(MAKE) -C doc doxygen-html

override_dh_auto_test:
	dh_auto_test || echo "Ignoring test failures"

override_dh_install-arch:
	# add C++ headers to C++ dev package install file
	cp debian/libgeos++-dev.install.in debian/libgeos++-dev.install
	find debian/tmp/usr/include/geos -name "*.h" -a ! -name "export.h" | sed -e 's/^debian\/tmp\///' >>debian/libgeos++-dev.install

	# Don't install geos.h & .inl files
	rm -f debian/tmp/usr/include/geos.h
	find debian/tmp/usr/include/geos -name "*.inl" -delete

	# Remove .la files
	find debian/tmp/usr/lib -name '*.la' -delete

	# Remove static library for Ruby
	rm -f debian/tmp/usr/lib/*/ruby/*/*/*.a

	dh_install -a --list-missing

	# remove the library from the -dev package
	rm -f $(CURDIR)/debian/libgeos-dev/usr/lib/*/libgeos-*.so

override_dh_install-indep:
	dh_install -i

	# Install doxygen html files
	install -m 644 doc/doxygen_docs/html/* debian/libgeos-doc/usr/share/doc/libgeos-doc/html

	# Install example program source
	install -m 644 doc/example.cpp debian/libgeos-doc/usr/share/doc/libgeos-doc/examples
	install -m 644 debian/Makefile.example debian/libgeos-doc/usr/share/doc/libgeos-doc/examples/Makefile

	# Remove embedded jquery.js in favor of libjs-jquery
	rm -f debian/libgeos-doc/usr/share/doc/libgeos-doc/html/jquery.js

override_dh_installman:
	dh_installman -plibgeos-dev debian/geos-config.1

override_dh_strip:
	dh_strip --dbg-package=libgeos-dbg

override_dh_makeshlibs:
	dh_makeshlibs -- -v$(VER) -c0