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 92 93
|
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2013, 2015, 2017 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 grep -Po '\bpugixml VERSION +\K\d+' 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/dpkg/architecture.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
# resolve experimental release
EXP_RELEASE = $(filter experimental% UNRELEASED,$(DEB_SUITE))
# relax symbols check when targeting experimental
export DPKG_GENSYMBOLS_CHECK_LEVEL=$(if $(EXP_RELEASE),0,1)
# Build the shared library
DEB_CMAKE_EXTRA_FLAGS += -DCMAKE_INSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) -DBUILD_SHARED_AND_STATIC_LIBS=ON -DUSE_VERSIONED_LIBDIR=OFF
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
DEB_CMAKE_EXTRA_FLAGS += -DBUILD_TESTS=1
endif
# We need this to build the package
CDBS_BUILD_DEPENDS +=, cmake
# Docs installation
DEB_INSTALL_DOCS_$(pkg-doc) += docs/images docs/manual.html docs/quickstart.html
# Install examples
DEB_INSTALL_EXAMPLES_$(pkg-dev) += docs/samples
# Drop -dbg package in favor of auto generated -dbgsym
DEB_DH_STRIP_ARGS = --dbgsym-migration="$(pkg-lib)-dbg (<< 1.8.1-3~)"
# 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/ \
--movedev "debian/tmp/usr/lib/*/cmake/pugixml/*" \
/usr/lib/$(DEB_HOST_MULTIARCH)/cmake/pugixml \
--movedev "debian/tmp/usr/lib/*/pkgconfig/*" \
/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
debian/tmp/usr/lib/*/$(lib).so
touch $@
clean::
rm -f debian/stamp-local-shlibs-$(lib)
# track symbols using pkgkde-symbolshelper
CDBS_BUILD_DEPENDS +=, pkg-kde-tools
include /usr/share/pkg-kde-tools/makefiles/1/cdbs/symbolshelper.mk
|