summaryrefslogtreecommitdiff
path: root/debian/make_shlibs
blob: 7ac5495061a8273b46bc183c362b73eb20acc5cd (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
#! /bin/bash

set -e
umask 022

# this could be done with dpkg-parsechangelog -S, but that only works since
# dpkg 1.17, so we want to avoid this to enable backports
DEB_VERSION=`dpkg-parsechangelog |grep ^Version: | awk '{ print $2 }'`
DEB_HOST_MULTIARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH`


make_shlibs() {
	pkg=$1
	echo $pkg
	PKGDIR=debian/$pkg/DEBIAN

	# step 1:
	# - create symbols files:
	#   - we only want symbols for public libraries (so exclude private
	#   ones)
	#   - we want to fail if new symbols appear, which are not listed in
	#   the symbols file (dpkg-gensymbols -c4)
	# - create first part of the shlibs file:
	#   for public libraries, we want a weak dependency in the shlibs file
	dh_makeshlibs -p$pkg -V -X/usr/lib/${DEB_HOST_MULTIARCH}/samba -X/usr/lib/${DEB_HOST_MULTIARCH}/plugin -- -c4
	[ -e $PKGDIR/shlibs ] && mv $PKGDIR/shlibs $PKGDIR/shlibs.1

	# step 2:
	# - ignore the symbols file generated by this step (it might contain
	#   private symbols):
	#   - output to /dev/null (-O/dev/null)
	#   - don't print info about new symbols (-q)
	# - create second part of the shlibs file:
	#   for private libraries, we want a strict dependency in the shlibs
	#   file
	#   this step will generate a strict dependency for all libraries (also
	#   public ones), so afterwards, we will have to merge them
	dh_makeshlibs -p$pkg -V"$pkg (= ${DEB_VERSION})" -X/usr/lib/${DEB_HOST_MULTIARCH}/plugin -- -q -O/dev/null

	if [ -e $PKGDIR/shlibs ]
	then
		mv $PKGDIR/shlibs $PKGDIR/shlibs.2
		# output shlibs entries from the first file
		# output shlibs entries from the second file if they are not in the first file
		debian/merge_shlibs.pl $PKGDIR/shlibs.1 $PKGDIR/shlibs.2 > $PKGDIR/shlibs
	fi
	rm -f $PKGDIR/shlibs.1
	rm -f $PKGDIR/shlibs.2

}


for pkg in `dh_listpackages`
do
	make_shlibs $pkg
done