File: rules

package info (click to toggle)
tinyssh 20230101-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,244 kB
  • sloc: ansic: 12,106; sh: 1,168; python: 479; makefile: 42
file content (46 lines) | stat: -rwxr-xr-x 1,589 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# crossbuild
ifneq  ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
include /usr/share/dpkg/buildtools.mk
endif

override_dh_installsystemd:
	dh_installsystemd -ptinysshd tinysshd@.service
	dh_installsystemd -ptinysshd tinysshd.socket

override_dh_auto_install:
	echo >/dev/null

override_dh_auto_configure:
	# disable some case tests, to allow reproducible build
	( cd tinyssh-tests; [ -f opentest.c.orig ] || ( mv opentest.c opentest.c.orig; ln -s emptytest.c opentest.c; ) )
	( cd tinyssh-tests; [ -f dropuidgidtest.c.orig ] || ( mv dropuidgidtest.c dropuidgidtest.c.orig; ln -s emptytest.c dropuidgidtest.c; ) )
	( cd tinyssh-tests; [ -f subprocess_authtest.c.orig ] || ( mv subprocess_authtest.c subprocess_authtest.c.orig; ln -s emptytest.c subprocess_authtest.c; ) )
	# backup files
	[ -f 'conf-cc.orig' ] || cp 'conf-cc' 'conf-cc.orig'
	[ -f 'conf-ar.orig' ] || cp 'conf-ar' 'conf-ar.orig'
	echo '$(CC)' > conf-cc
	echo '$(AR)' > conf-ar

override_dh_auto_build:
ifneq  ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
	make cross-compile || { cat build/log; exit 1; }
else
	dh_auto_build || { cat build/log; exit 1; }
endif

override_dh_auto_clean:
	dh_auto_clean
	mv -f 'tinyssh-tests/opentest.c.orig' 'tinyssh-tests/opentest.c' || :
	mv -f 'tinyssh-tests/dropuidgidtest.c.orig' 'tinyssh-tests/dropuidgidtest.c' || :
	mv -f 'tinyssh-tests/subprocess_authtest.c.orig' 'tinyssh-tests/subprocess_authtest.c' || :
	mv -f 'conf-cc.orig' 'conf-cc' || :
	mv -f 'conf-ar.orig' 'conf-ar' || :

%:
	dh $@