#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 upstreamversion=$(shell dpkg-parsechangelog | grep Version | head -1 | sed -e 's/Version: //g' -e 's/-[A-Za-z0-9+\.]*$$//g') versionh=$(shell echo $(upstreamversion) | sed -e 's/\.[^.]*$$//') versiont=$(shell echo $(upstreamversion) | sed -e 's/^.*\.//') nextupstreamversion=$(shell echo $(versionh).$$(expr $(versiont) + 1)) # API version apiver=$(shell perl -nE 'print $$1 if m{^AC_SUBST\S\[GOFFICE_API_VER\],\s*\[([\d.]+)\]};' configure.in) # ABI major version somajor=$(shell perl -nE 'print $$1 if m{^m4_define\S\[goffice_version_major\],\s*\[(\d+)\]};' configure.in) # The base library name pruntime=libgoffice-$(apiver)-$(somajor) pcommon=$(pruntime)-common pdevel=libgoffice-$(apiver)-dev pdbg=libgoffice-$(apiver)-dbg # 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) CFLAGS += -Wall -g # Ensure the build aborts when there are still references to undefined # symbols. LDFLAGS += -Wl,-z,defs # Make the linker work a bit harder so dynamic loading can be done faster LDFLAGS += -Wl,-O1 # Make the linker only include actual dependencies on libraries, rather than # for all libraries specified in the link line. LDFLAGS += -Wl,--as-needed # Make the linker find the X libraries LDFLAGS += -L/usr/X11R6/lib confflags := -v \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info \ --with-html-dir=\$${prefix}/share/doc/$(pdevel)/html # FHS locations confflags += --prefix=/usr \ --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info \ --datadir=\$${prefix}/share \ --libdir=\$${prefix}/lib # Compiler, language dialect confflags += --disable-iso-c \ --enable-compile-warnings=maximum \ --disable-silent-rules # Features confflags += --enable-static --enable-gtk-doc %: dh $@ --parallel --with autoreconf override_dh_autoreconf: dh_autoreconf --as-needed # Generate a .pot file cd po && intltool-update -p override_dh_auto_configure: $(info I: library-name=$(pruntime)) $(if $(wildcard debian/$(pruntime).install),,$(error Packaging files are not set up for base library name $(pruntime).)) dh_auto_configure -- $(confflags) override_dh_auto_install: dh_auto_install --destdir=$(CURDIR)/debian/tmp # Removing *.la files find $(CURDIR)/debian -name '*.la' -delete -printf 'removed %p\n' override_dh_install: dh_install --sourcedir=debian/tmp -Xindex.sgml # Remove files from the main package that belong to a more # specialist package while read l ; do \ $(RM) -rv debian/$(pruntime)/$$l ; \ done < debian/$(pcommon).install # Wipe empty dirs if any find $(CURDIR)/debian -type d -empty -delete -printf 'removed %p\n' override_dh_installdocs: dh_installdocs -p$(pdbg) --link-doc=$(pruntime) dh_installdocs dh_buildinfo -N$(pdbg) override_dh_gencontrol: dh_gencontrol -v -- -VUpstream-Version=$(upstreamversion) override_dh_makeshlibs: # "-Xplugins" to avoid generation of symbols for plugins dh_makeshlibs -V -Xplugins override_dh_strip: dh_strip --dbg-package=$(pdbg)