summaryrefslogtreecommitdiff
path: root/debian/rules
blob: f31d5ecbcea5836af2c1e6b85a010f8555ea4801 (plain)
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
94
95
96
97
98
99
#!/usr/bin/make -f

# This needs to declared/run before including CDBS snippets
stem = $(DEB_SOURCE_PACKAGE)
major := $(shell grep -Po '^SET\b.\bCTPP_VERSION_MAJOR +\K\d+' CMakeLists.txt)
# TODO: drop v5 suffix when major version > 1
libpkgname = lib$(stem)-$(major)v5
debian/control:: debian/control.in
DEB_PHONY_RULES += debian/control.in
debian/control.in::
	sed -e 's/__LIBPKGNAME__/$(libpkgname)/g' <debian/control.in.in >debian/control.in

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

libname = lib$(stem)
devpkgname = lib$(stem)-dev
docpkgname = $(stem)-doc
utilspkg = $(stem)-utils

# Build Dependencies
CDBS_BUILD_DEPENDS +=, cmake

# Handle Upstream releases
DEB_UPSTREAM_URL = http://ctpp.havoc.ru/download/
DEB_UPSTREAM_TARBALL_MD5 = 1155b65e8ca8b844c631831e4a3e5644

# Upstream used flags
CXX_PARAMS = --param large-function-growth=5000 --param inline-unit-growth=600 -finline-limit=2000
CXX_WARN_FLAGS = -Wno-long-long -Wno-inline -finline-functions
CXXFLAGS += $(CXX_PARAMS) $(CXX_WARN_FLAGS)

# Install files for ctpp2-utils
DEB_DH_INSTALL_ARGS_$(utilspkg) = usr/bin/*
DEB_INSTALL_MANPAGES_$(utilspkg) = debian/tmp/usr/man/man1/*

# Install documentation
DEB_INSTALL_DOCS_$(stem)-doc += doc/html

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

# Disable libssl linking
DEB_CMAKE_NORMAL_ARGS += -DMD5_SUPPORT=0

# Drop -dbg package in favor of auto generated -dbgsym
DEB_DH_STRIP_ARGS = --dbgsym-migration="$(libpkgname)-dbg (<< 2.8.3-23~)"

# Upgrade Doxyfile, and use SVG graphics
DEB_COMPRESS_EXCLUDE_DEFAULT += .xhtml
common-configure-indep:: debian/stamp-doxyupgrade
debian/stamp-doxyupgrade:
	[ ! -f /usr/bin/doxygen ] || ( set -e; \
		cp ${DEB_SRCDIR}/Doxyfile ${DEB_SRCDIR}/Doxyfile.orig; \
		doxygen -u ${DEB_SRCDIR}/Doxyfile; \
		perl -i -pe 's/DOT_IMAGE_FORMAT\K.*/=svg/;s/HTML_FILE_EXTENSION\K.*/=.xhtml/' ${DEB_SRCDIR}/Doxyfile; \
	)
	touch $@
clean::
	[ ! -f ${DEB_SRCDIR}/Doxyfile.orig ] || \
		cp ${DEB_SRCDIR}/Doxyfile.orig ${DEB_SRCDIR}/Doxyfile
	rm -f ${DEB_SRCDIR}/Doxyfile.bak
	rm -f debian/stamp-doxyupgrade

# Build Documentation
common-build-indep:: debian/stamp-docs
debian/stamp-docs:
	[ ! -f /usr/bin/doxygen ] || doxygen ${DEB_SRCDIR}/Doxyfile
	touch $@
clean::
	rm -f debian/stamp-docs

# 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 > 2
CDBS_BUILD_DEPENDS +=, d-shlibs (>= 0.61~)
binary-post-install/$(libpkgname) binary-post-install/$(devpkgname):: debian/stamp-local-shlibs-$(libname)
debian/stamp-local-shlibs-$(libname): binary-install/$(libpkgname) binary-install/$(devpkgname)
	d-shlibmove --commit \
		--v5 \
		--devunversioned \
		$(if $(DEB_HOST_MULTIARCH),--multiarch) \
		--exclude-la \
		--override s/$(libname)-$(major)-dev/$(libname)-dev/ \
		--movedev "debian/tmp/usr/include/*" usr/include/ \
		debian/tmp/usr/lib/$(libname).so
	touch $@
clean::
	rm -f debian/stamp-local-shlibs-$(libname)

# Remove the jquery
binary-post-install/$(docpkgname)::
	find debian/$(docpkgname)/usr/share/doc/$(docpkgname)/html/ -name "*.md5" -exec rm -vf {} \;

# track symbols using pkgkde-symbolshelper
CDBS_BUILD_DEPENDS +=, pkg-kde-tools
include /usr/share/pkg-kde-tools/makefiles/1/cdbs/symbolshelper.mk