debian swirl logo

Back to the packages list editorconfig-core

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2013 Vasudev Kamath 
# Copyright © 2013 Jonas Smedegaard 
# Description: Main Debian packaging script for EditorConfig core
#
# 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 .

debian/control:: debian/control.in
DEB_PHONY_RULES += debian/control.in
debian/control.in::
		sed -e 's/__LIBPKGNAME__/$(libpkg)/g' debian/control.in

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/class/cmake.mk

stem = editorconfig
major = $(firstword $(subst .,$(space), $(DEB_UPSTREAM_VERSION)))
lib = lib$(stem)
libpkg = $(lib)$(major)
devpkg = $(lib)-dev
utilspkg = $(stem)
docpkg = $(stem)-doc

# Upstream tarball handling
DEB_UPSTREAM_URL = https://github.com/editorconfig/editorconfig-core/archive
DEB_UPSTREAM_TARBALL_BASENAME = v$(DEB_UPSTREAM_TARBALL_VERSION)
DEB_UPSTREAM_TARBALL_MD5 = 70107f17246188953c65766217e5261a

# Build Depends
CDBS_BUILD_DEPENDS += , cmake, d-shlibs, doxygen

# Depends
CDBS_DEPENDS_$(docpkg) += , libjs-jquery

# enable installation of HTML docs
DEB_CMAKE_NORMAL_ARGS += -DINSTALL_HTML_DOC=ON

# use standard LDFLAGS
DEB_CMAKE_NORMAL_ARGS += -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}"

# Supress optional build dependencies
CDBS_BUILD_DEPENDS_rules_upstream_tarball = 
CDBS_BUILD_DEPENDS_rules_utils_copyright_check = 

# Multiarch quirks (should ideally be resolved automagically)
CDBS_BUILD_DEPENDS_rules_debhelper_buildinfo = 
CDBS_BUILD_DEPENDS_rules_buildcore_pkgrel = 
CDBS_PREDEPENDS = $(if $(DEB_HOST_MULTIARCH),multiarch-support)


# install editorconfig binaries, man pages and docs
DEB_DH_INSTALL_ARGS_$(utilspkg) = usr/bin
DEB_INSTALL_MANPAGES_$(utilspkg) = debian/tmp/usr/share/man/man1/editorconfig.1 debian/tmp/usr/share/man/man3/editorconfig-format.3
DEB_DH_LINK_$(utilspkg) = /usr/share/man/man1/editorconfig.1.gz /usr/share/man/man1/editorconfig-$(DEB_UPSTREAM_VERSION).1.gz
DEB_DH_INSTALL_ARGS_$(docpkg) = usr/share/doc/editorconfig-doc/html/
DEB_DH_LINK_$(docpkg) = /usr/share/javascript/jquery/jquery.js /usr/share/doc/$(docpkg)/html/jquery.js

# Let d-shlibs calculate development package dependencies
#  and handle shared library install
binary-post-install/$(libpkg) binary-post-install/$(devpkg):: debian/stamp-local-shlibs-$(lib)
debian/stamp-local-shlibs-$(lib): binary-install/$(libpkg) binary-install/$(devpkg)
		d-shlibmove --commit \
			--devunversioned \
			--multiarch \
			--exclude-la \
			--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)

binary-post-install/$(docpkg)::
		rm -f debian/$(docpkg)/usr/share/doc/$(docpkg)/html/jquery.js

Builds:

editorconfig
coding style indenter for all editors - commandline tools
editorconfig-doc
coding style indenter across editors - documentation
libeditorconfig0
coding style indenter across editors - library
libeditorconfig0-dbg
coding style indenter across editors - debugging symbols
libeditorconfig-dev
coding style indenter across editors - development files