1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2013, 2015 Jonas Smedegaard <dr@jones.dk>
# Copyright © 2013-2015 Vasudev Kamath <kamathvasudev@gmail.com>
# Description: Main Debian packaging script for pugixml
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This needs to declared/run before including CDBS snippets
stem = $(DEB_SOURCE_PACKAGE)
major := $(shell perl -ne '/\bSOVERSION +(\d+)/ and print $$1' scripts/CMakeLists.txt)
lib = lib$(stem)
# TODO: drop v5 suffix when major version > 1
pkg-lib = lib$(stem)$(major)v5
debian/control:: debian/control.in
DEB_PHONY_RULES += debina/control.in
debian/control.in::
sed \
-e 's/__PKG-LIB__/$(pkg-lib)/g' \
<debian/control.in.in \
>debian/control.in
include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/cmake.mk
include /usr/share/cdbs/1/rules/debhelper.mk
pkg-dev = lib$(stem)-dev
pkg-doc = $(stem)-doc
pkg-dbg = $(pkg-lib)-dbg
# Handle upstream release
DEB_UPSTREAM_URL = https://github.com/zeux/pugixml/archive
DEB_UPSTREAM_TARBALL_BASENAME = v$(DEB_UPSTREAM_TARBALL_VERSION)
# Build-depend unversioned on debhelper
# TODO: Drop when adopted in cdbs
CDBS_BUILD_DEPENDS_rules_debhelper_v9 = debhelper
# Skip checking some images (in addition to the defaults)
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^(docs/images/.*\.png|debian/(changelog|copyright(|_hints|_newhints)))$
# Build the shared library
DEB_CMAKE_EXTRA_FLAGS += -DBUILD_SHARED_LIBS=1
# We need this to build the package
CDBS_BUILD_DEPENDS +=, cmake, pkg-kde-tools
# Fix the cmake invocation path
DEB_SRCDIR = scripts
# Docs installation
DEB_INSTALL_DOCS_$(pkg-doc) += docs/images docs/manual.html docs/quickstart.html
# Install examples
DEB_INSTALL_EXAMPLES_$(pkg-dev) += docs/samples
# Use only upstream version for dpkg-gensymbols
DEB_DH_MAKESHLIBS_ARGS_$(pkg-lib) += -- -v$(DEB_UPSTREAM_VERSION)
# Let d-shlibs calculate development package dependencies
# and handle shared library install
# * Recent version needed for v5 option
# TODO: drop v5 option when major version > 1
CDBS_BUILD_DEPENDS +=, d-shlibs (>= 0.61~)
binary-post-install/$(pkg-lib) binary-post-install/$(pkg-dev):: \
debian/stamp-local-shlibs-$(lib)
debian/stamp-local-shlibs-$(lib): \
binary-install/$(pkg-lib) binary-install/$(pkg-dev)
d-shlibmove --commit \
--devunversioned \
--exclude-la \
--multiarch \
--v5 \
--override s/$(lib)$(major)-dev/$(lib)-dev/ \
--movedev "debian/tmp/usr/include/*" usr/include/ \
debian/tmp/usr/lib/$(lib).so
touch $@
clean::
rm -f debian/stamp-local-shlibs-$(lib)
|