summaryrefslogtreecommitdiffstats
path: root/dilos/core/tdepim/debian/rules
blob: afc29ebfff960939ec3141c654cf8ec2f39dc8ce (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/make -f

# Set LD_LIBRARY_PATH to the installed library directory to allow dh_shlibdeps to function
# Also include the main Trinity path
ifeq ("$(LD_LIBRARY_PATH)", "")
LD_LIBRARY_PATH=debian/tmp/usr/lib:debian/tmp/usr/lib/trinity
else
LD_LIBRARY_PATH += :debian/tmp/usr/lib:debian/tmp/usr/lib/trinity
endif
export LD_LIBRARY_PATH

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/cmake.mk
include debian/cdbs/debian-tde.mk

DEB_TIME64_API		= $(shell echo | cc $(dpkg-buildflags --get CPPFLAGS) -dM -E -x c++ - | grep -q "_TIME_BITS 64" && echo true || false)
ifeq ($(DEB_TIME64_API),true)
DEB_TIME64_SUFFIX	= t64
else
DEB_TIME64_SUFFIX	=
endif

DEB_KDE_APIDOX := yes

CPPFLAGS+= -D__dilos__

DEB_CMAKE_EXTRA_FLAGS := \
 -DLIB_SUFFIX="" \
 -DCMAKE_INSTALL_PREFIX="/usr" \
 -DCONFIG_INSTALL_DIR="/etc/trinity" \
 -DSYSCONF_INSTALL_DIR="/etc/trinity" \
 -DXDG_MENU_INSTALL_DIR="/etc/xdg/menus" \
 -DCMAKE_VERBOSE_MAKEFILE="ON" \
 -DCMAKE_SKIP_RPATH="OFF" \
 -DBUILD_ALL="ON" \
 -DWITH_ARTS="ON" \
 -DWITH_SASL="ON" \
 -DWITH_NEWDISTRLISTS="ON" \
 -DWITH_GNOKII="OFF" \
 -DWITH_EXCHANGE="ON" \
 -DWITH_EGROUPWARE="ON" \
 -DWITH_KOLAB="ON" \
 -DWITH_SLOX="ON" \
 -DWITH_GROUPWISE="ON" \
 -DWITH_FEATUREPLAN="ON" \
 -DWITH_GROUPDAV="ON" \
 -DWITH_BIRTHDAYS="ON" \
 -DWITH_NEWEXCHANGE="ON" \
 -DWITH_SCALIX="ON" \
 -DWITH_CALDAV="ON" \
 -DWITH_CARDDAV="ON" \
 -DWITH_INDEXLIB="ON" \
 -DWITH_XSCREENSAVER="ON" \
 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
 -DCMAKE_C_COMPILER=gcc \
 -DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)"

DEB_MAKE_CHECK_TARGET = check

DEB_DH_INSTALL_SOURCEDIR := $(DEB_DESTDIR)

DEB_INSTALL_DOCS_ALL :=

DEB_INSTALL_CHANGELOGS_ALL = $(shell for f in ChangeLog CHANGELOG CHANGES; do if test -s $(DEB_SRCDIR)/$(cdbs_curpkg)/$$f; then echo $(DEB_SRCDIR)/$(cdbs_curpkg)/$$f; break; fi; done)

shlibs_ver=4:3.5.7
DEB_DH_MAKESHLIBS_ARGS_libindex0-trinity := -V'libindex0-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libtdenetwork2-trinity := -V'libtdenetwork2-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libtdepim1a-trinity := -V'libtdepim1a-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libkgantt0-trinity := -V'libkgantt0-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libkleopatra1-trinity := -V'libkleopatra1-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libkmime2-trinity := -V'libkmime2-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libkpimexchange1-trinity := -V'libkpimexchange1-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libkpimidentities1-trinity := -V'libkpimidentities1-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libksieve0-trinity := -V'libksieve0-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libktnef1-trinity := -V'libktnef1-trinity (>= $(shlibs_ver))'
DEB_DH_MAKESHLIBS_ARGS_libmimelib1c2a-trinity := -V'libmimelib1c2a-trinity (>= $(shlibs_ver))'

# kontact-trinity starts fine without korganizer-trinity or kpilot-trinity dependencies
# specialdates-trinity is only in recommends to get the kaddressbook-trinity dependency there
kontact-trinity_recommends_plugins := korganizer specialdates
kontact-trinity_suggests_plugins := journal todo

DEB_DH_SHLIBDEPS_ARGS_kontact-trinity := \
	$(foreach p,$(kontact-trinity_recommends_plugins) $(kontact-trinity_suggests_plugins),-Xusr/lib/$(DEB_HOST_MULTIARCH)/trinity/libkontact_$(p)plugin.so) \
	-- -dRecommends \
	$(foreach p,$(kontact-trinity_recommends_plugins),debian/kontact-trinity/usr/lib/$(DEB_HOST_MULTIARCH)/trinity/libkontact_$(p)plugin.so) \
	-dSuggests \
	$(foreach p,$(kontact-trinity_suggests_plugins),debian/kontact-trinity/usr/lib/$(DEB_HOST_MULTIARCH)/trinity/libkontact_$(p)plugin.so) \
	-dDepends	# Since -u args go first in dpkg-shlibdeps call

test-shlibdeps:
	@echo $(DEB_DH_SHLIBDEPS_ARGS_kontact-trinity)

KDE_UPSTREAM_VERSION := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -e 's/\.dfsg.*//')
KDE_TARBALL := ../$(DEB_SOURCE_PACKAGE)-$(KDE_UPSTREAM_VERSION).tar.bz2
KDE_SOURCEDIR := dfsg-tmp/$(DEB_SOURCE_PACKAGE)-$(KDE_UPSTREAM_VERSION)
NEWDEB_SOURCEDIR := $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION)

DEB_DH_STRIP_ARGS := -Xlibindex.so.0.0.0 -Xlibgpgme++.so.0.4.0 \
-Xlibmimelib.so.1.0.1

post-patches::
	dh_testdir
ifeq ($(DEB_TIME64_API),true)
	# update library package name for TIME64 ABI
	ls -d debian/* | \
	grep -E "/libmimelib1c2a" | \
	grep -v "\.t64$$" | \
	while read a; do \
	    [ -d $$a ] || [ -f $$a.t64 ] || \
	    (cp -a $$a debian/libmimelib1$(DEB_TIME64_SUFFIX)$${a##*c2a} && mv $$a $$a.t64); \
	done
	ls -d debian/* | \
	grep -E "/libkleopatra1-" | \
	grep -v "\.t64$$" | \
	while read a; do \
	    [ -d $$a ] || [ -f $$a.t64 ] || \
	    (cp -a $$a debian/libkleopatra1$(DEB_TIME64_SUFFIX)-$${a##*-} && mv $$a $$a.t64); \
	done
	[ -f debian/control.t64 ] || \
	sed -i.t64 \
	    -e "s/^\\(Package: libmimelib1\\)c2a-trinity$$/\\1$(DEB_TIME64_SUFFIX)-trinity/" \
	    -e "s/^\\(Replaces\\|Breaks\\):\\(.*\\)\\(libmimelib1\\)c2a-trinity\\( \|$$\)/\\1:\\2\\3c2a-trinity, \\3$(DEB_TIME64_SUFFIX)-trinity\\4/" \
	    -e "s/\\(libmimelib1\\)c2a-trinity (=/\\1$(DEB_TIME64_SUFFIX)-trinity (=/" \
	    \
	    -e "s/^\\(Package: libkleopatra1\\)-trinity$$/\\1$(DEB_TIME64_SUFFIX)-trinity/" \
	    -e "s/^\\(Replaces\\|Breaks\\):\\(.*\\)\\(libkleopatra1\\)-trinity\\( \|$$\)/\\1:\\2\\3-trinity, \\3$(DEB_TIME64_SUFFIX)-trinity\\4/" \
	    -e "s/\\(libkleopatra1\\)-trinity (=/\\1$(DEB_TIME64_SUFFIX)-trinity (=/" \
	    debian/control
endif

clean::
	dh_testdir
	dh_clean

ifeq ($(DEB_TIME64_API),true)
	# revert library package name for TIME64 ABI
	ls -d debian/* | \
	grep -E "\.t64$$" | \
	while read a; do \
	    mv $$a $${a%.t64}; \
	done
	ls -d debian/* | \
	grep -E "/libmimelib1$(DEB_TIME64_SUFFIX)-" | \
	xargs -r rm
	ls -d debian/* | \
	grep -E "/libkleopatra1$(DEB_TIME64_SUFFIX)-" | \
	xargs -r rm
	[ ! -f debian/control.t64 ] || \
	mv debian/control.t64 debian/control
endif