File: rules

package info (click to toggle)
libsemanage 2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,724 kB
  • ctags: 1,647
  • sloc: ansic: 15,320; python: 1,153; yacc: 455; makefile: 270; lex: 78; sh: 14
file content (89 lines) | stat: -rwxr-xr-x 2,979 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
#!/usr/bin/make -f
#export DH_VERBOSE=1

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

ifeq ($(DEB_STAGE),stage1)
export DH_OPTIONS += -Nruby-semanage -Npython-semanage -Npython3-semanage
else
PYVERSIONS = $(shell pyversions -rv)
PY3VERSIONS = $(shell py3versions -rv)
RUBY_VERSIONS := $(shell dh_ruby --print-supported)
endif

# The build system doesn't use CPPFLAGS, pass them to CFLAGS to enable the
# missing (hardening) flags.
export DEB_CFLAGS_MAINT_APPEND = $(shell dpkg-buildflags --get CPPFLAGS)

%:
ifeq ($(DEB_STAGE),stage1)
	dh $@
else
	dh $@ --with python2 --with ruby --with python3
endif

override_dh_auto_build:
	$(MAKE) all LIBBASE="lib/${DEB_HOST_MULTIARCH}" SELINUXEXECDIR="usr/lib/selinux"

ifneq ($(DEB_STAGE),stage1)
	for version in $(PYVERSIONS); do              \
	  $(MAKE) pywrap PYTHON=python$$version  \
	    PYPREFIX=python-$$version;  \
	done;
	for version in $(PY3VERSIONS); do              \
	  $(MAKE) pywrap PYTHON=python$$version  \
	    PYPREFIX=python-$$version;  \
	done;

	for version in $(RUBY_VERSIONS); do              \
	  RUBY_HDRDIR=$$($$version -e 'print RbConfig::CONFIG["rubyhdrdir"]'); \
	  RUBY_ARCH_HDRDIR=$$($$version -e 'print RbConfig::CONFIG["rubyarchhdrdir"]'); \
	  RUBY_VERSION=$$($$version -e 'print RbConfig::CONFIG["ruby_version"]'); \
	  $(MAKE) -C src rubywrap RUBY=$$version RUBYLIBVER=$$RUBY_VERSION \
	    RUBYINC="-I$$RUBY_HDRDIR -I$$RUBY_ARCH_HDRDIR"; \
	done;
endif

override_dh_auto_install:
	$(MAKE) install DESTDIR="${CURDIR}/debian/tmp" \
	  LIBDIR="${CURDIR}/debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}" \
	  SHLIBDIR="${CURDIR}/debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}" \
	  SELINUXEXECDIR="${CURDIR}/debian/tmp/usr/lib/selinux"

ifneq ($(DEB_STAGE),stage1)
	for version in $(PYVERSIONS); do              \
	  $(MAKE) install-pywrap PYTHON=python$$version  \
	    DESTDIR="${CURDIR}/debian/tmp" \
	    PYPREFIX=python-$$version;  \
	done;
	for version in $(PY3VERSIONS); do              \
	  $(MAKE) install-pywrap PYTHON=python$$version  \
	    DESTDIR="${CURDIR}/debian/tmp" \
	    PYPREFIX=python-$$version;  \
	done;

	for version in $(RUBY_VERSIONS); do              \
	  RUBY_VENDOR_ARCHLIB=$$($$version -e 'print RbConfig::CONFIG["vendorarchdir"]'); \
	  RUBY_VERSION=$$($$version -e 'print RbConfig::CONFIG["ruby_version"]'); \
	  $(MAKE) -C src install-rubywrap RUBY=$$version RUBYLIBVER=$$RUBY_VERSION DESTDIR="${CURDIR}/debian/tmp" \
	      RUBYINSTALL="${CURDIR}/debian/tmp/$$RUBY_VENDOR_ARCHLIB"; \
	done;
endif

override_dh_auto_clean:
ifneq ($(DEB_STAGE),stage1)
	for version in $(PYVERSIONS); do              \
	  $(MAKE) clean PYTHON=python$$version;  \
	done;
endif

override_dh_install:
	dh_install --list-missing

override_dh_fixperms:
	dh_fixperms
	-chmod -x ${CURDIR}/debian/python-semanage/usr/lib/python*/*-packages/semanage.py
	-chmod -x ${CURDIR}/debian/python3-semanage/usr/lib/python*/*-packages/semanage.py

override_dh_auto_test:
	$(MAKE) test || true