File: rules

package info (click to toggle)
golang-github-miekg-pkcs11 0.0~git20160602.0.8f7ddbc-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 512 kB
  • ctags: 2,176
  • sloc: ansic: 1,876; makefile: 22
file content (38 lines) | stat: -rwxr-xr-x 1,139 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
31
32
33
34
35
36
37
38
#!/usr/bin/make -f

# we need our test artifacts too
export DH_GOLANG_INSTALL_ALL := 1

# github.com/miekg/pkcs11/test requires more test parameters
export DH_GOLANG_EXCLUDES := github.com/miekg/pkcs11/test

MODULE_DIR = debian/golang-github-miekg-pkcs11-dev/usr/share/gocode/src/github.com/miekg/pkcs11

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

override_dh_auto_install:
	dh_auto_install
	# Remove extra license file copied by DH_GOLANG_INSTALL_ALL
	rm -f $(MODULE_DIR)/LICENSE
	# Remove tests & related non-reproducible output
	rm -f $(MODULE_DIR)/hsm.db rm -f $(MODULE_DIR)/*_test.db

# 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_clean:
	dh_auto_clean
	rm -f $(SOFTHSM2_CONF)