File: rules

package info (click to toggle)
arb 6.0.6-8
  • links: PTS, VCS
  • area: non-free
  • in suites: sid, trixie
  • size: 66,204 kB
  • sloc: ansic: 394,911; cpp: 250,290; makefile: 19,644; sh: 15,879; perl: 10,473; fortran: 6,019; ruby: 683; xml: 503; python: 53; awk: 32
file content (129 lines) | stat: -rwxr-xr-x 4,225 bytes parent folder | download
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
#!/usr/bin/make -f
# debian/rules for arb using quilt

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/default.mk
pkgcom=$(DEB_SOURCE)-common
pkgdoc=$(DEB_SOURCE)-doc
common=debian/$(pkgcom)

ARBHOME=$(CURDIR)

BITARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
ifeq ($(BITARCH),64)
    ARB_64:=1
else
    ARB_64:=0
endif

LD_LIBRARY_PATH := $(ARBHOME)/lib:$(LD_LIBRARY_PATH)
PATH := $(ARBHOME)/bin:$(PATH)
LC_ALL := C

export ARBHOME LD_LIBRARY_PATH PATH LC_ALL
export DEB_CXXFLAGS_MAINT_APPEND=-std=c++98

# Workarounds to multiple build failures with gcc 14 in arb, which would
# require extensive rewrite to fix properly, notably the implicit
# function declarations that would normally be fixed with proper header
# files.
export DEB_CFLAGS_MAINT_APPEND=\
	-Wno-error=implicit-int \
	-Wno-error=implicit-function-declaration

%:
	dh $@

config.makefile: config.makefile.template
	# ARB's build system is configured with config.makefile. This file is
	# created on the first run of make from config.makefile.template. We
	# just use sed here to set the desired parameters:
	sed -e 's/DEVELOPER := ANY/DEVELOPER := RELEASE/;'\
            -e 's/ARB_64 := 1/ARB_64 := $(ARB_64)/;'\
            -e 's/# DEBIAN := 1/DEBIAN := 1/;' \
             config.makefile.template > config.makefile

override_dh_auto_build:
	dh_auto_build -- all

override_dh_auto_configure: config.makefile

override_dh_auto_clean: config.makefile
	# config.makefile is required to run make clean, hence the dependency
	# on ..._auto_configure.
	$(MAKE) clean
	rm config.makefile
	# ARB does not have "distclean" or "realclean". Remove some leftovers:
	rm -f UNIT_TESTER/Makefile.setup.local
	find -name \*.log -a ! -name phyml-manual.log -print0 | xargs -0 rm -f
	rm -f TEMPLATES/arb_build.h

override_dh_install:
	# ARB has no "install" target. It has "tarfile_quick", though, which
	# creates a tarball for distribution. We build this and unpack it
	# into debian/tmp so that dh_install can pick up the files.
	make tarfile_quick
	rm -rf debian/tmp
	mkdir debian/tmp
	tar -C debian/tmp -xzf arb.tgz
	rm -rf debian/tmp-dev
	mkdir debian/tmp-dev
	tar -C debian/tmp-dev -xzf arb-dev.tgz
	rm arb.tgz arb-dev.tgz

	# remove some files we don't need in the package:
	rm -rf debian/tmp/lib/addlibs # external libs are packages
	rm  -f debian/tmp/lib/arb_tcp_org.dat # managed in etc
	rm  -f debian/tmp/lib/GPL.txt # included in copyright
	rm  -f debian/tmp/lib/Makefile # spurious in upstream
	rm  -f debian/tmp/arb_install.sh # no installer needed
	rm  -f debian/tmp/arb_INSTALL.txt
	rm  -f debian/tmp/arb_OS_X_MacPorts.txt
	rm  -f debian/tmp/arb_OS_X.txt
	rm  -f debian/tmp/arb_UBUNTU.txt

	dh_install --list-missing

	# the check is needed to make sure it will not fail when doing binary-arch only builds
	if [ -e debian/$(pkgcom)/usr/lib/arb/SH/arb_create_debian_conffile ] ; then \
	    # Move SH/README :to docs \
	    cp -a SH/README debian/$(pkgcom)/usr/share/doc/arb/README_SH ; \
	    # Fix permission of scripts \
	    chmod a+x debian/$(pkgcom)/usr/lib/arb/SH/arb_create_debian_conffile ; \
	    chmod a+x debian/$(pkgcom)/usr/lib/arb/lib/macro.head ; \
	fi

override_dh_strip:
	# Fix rpath issue (once libarb is installed)
	if [ -e debian/libarb/usr/lib/arb/lib/ARB.so ] ; then \
	    chrpath --delete debian/libarb/usr/lib/arb/lib/ARB.so ; \
	fi
	dh_strip
	find debian/libarb-dev -name \*.a -print0 | \
	    xargs -0 -n 1 strip --strip-unneeded \
	                        --remove-section=.comment

override_dh_installchangelogs:
	dh_installchangelogs arb_CHANGES.txt

override_dh_shlibdeps:
	dh_shlibdeps -a -l debian/libarb/usr/lib

override_dh_fixperms:
	dh_fixperms
	-chmod 0644 debian/arb-common/etc/arb/submit/*
	-chmod 0644 debian/libarb-dev/usr/include/arb/xml.hxx
	-chmod 0755 debian/arb-common/usr/lib/arb/lib/macro.head

override_dh_link:
	dh_link
	rm -f debian/arb-common/etc/arb/inputMasks/format.readme
	dh_link -parb-common /usr/lib/arb/lib/help/input_mask_format.hlp /etc/arb/inputMasks/format.readme

# To update po files as recommended in po-debconf(7)
debian/po/templates.pot: debian/arb-common.templates
	@debconf-updatepo