File: rules

package info (click to toggle)
golang-github-miekg-pkcs11 1.0.3%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 400 kB
  • sloc: makefile: 20; ansic: 19
file content (30 lines) | stat: -rwxr-xr-x 865 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

export DH_GOLANG_INSTALL_EXTRA := softhsm.conf softhsm2.conf test_data

%:
	dh $@ --builddirectory=_build --buildsystem=golang --with=golang

# Create token for unit tests in temporary directory

export SOFTHSM2_CONF := $(CURDIR)/debian/softhsm2.conf

$(SOFTHSM2_CONF):
	echo "directories.tokendir = $(CURDIR)/debian/tmp" > debian/softhsm2.conf
	echo "objectstore.backend = file" >> debian/softhsm2.conf
	echo "log.level = INFO" >> debian/softhsm2.conf

override_dh_auto_test: $(SOFTHSM2_CONF)
	mkdir -p debian/tmp
	softhsm2-util --init-token --slot 0  --label test --pin 1234 --so-pin 1234
	dh_auto_test
	rm -rf debian/tmp

override_dh_auto_install:
	cd _build/src/github.com/miekg/pkcs11/test_data && \
		find \( -name generation -or -name token.lock \) -delete
	dh_auto_install

override_dh_auto_clean:
	dh_auto_clean
	rm -f $(SOFTHSM2_CONF)