Name libsemanage2
Description SELinux policy management library
Version 3.5-1build5
Package Base libsemanage
Homepage https://selinuxproject.org
Maintainers ['Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>']
Contributors ['Laurent Bigonville <bigon@debian.org>', 'Russell Coker <russell@coker.com.au>']
Distro-repo https://git.launchpad.net/ubuntu/+source/libsemanage/tree/?h=ubuntu/noble
Sources ['https://git.launchpad.net/ubuntu/+source/libsemanage/plain/debian/patches/../?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/libsemanage/plain/debian/patches/disable-expand-check.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/libsemanage/plain/debian/patches/fix_tests.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/libsemanage/plain/debian/patches/semigrate-store.patch?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/libsemanage/plain/debian/patches/series?h=ubuntu/noble', 'https://git.launchpad.net/ubuntu/+source/libsemanage2/plain/debian/watch?h=ubuntu/noble']
Dependencies ['libaudit1', 'libbz2-1.0', 'libc6', 'libselinux1', 'libsemanage-common', 'libsepol2']
Optional-Dependencies []
Build-Dependencies ['bison', 'debhelper-compat', 'dh-sequence-python3 <!nopython>', 'dh-sequence-ruby <!noruby>', 'file', 'flex', 'gem2deb', 'libaudit-dev', 'libbz2-dev', 'libcunit1-dev <!nocheck>', 'libpython3-all-dev <!nopython>', 'libselinux1-dev', 'libsepol-dev', 'pkg-config', 'python3-all-dev', 'secilc', 'swig <!nopython> <!noruby>']
Provides []
Builddate
Architecture amd64
Distro-Version noble
Licenses []
Hash 56102dcbd410416d03c5ffb80958f54ac63936f4d9eb3f6a98964e680a82ce37
#!/usr/bin/make -f
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/architecture.mk
# for cross compilation
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
export CC := $(DEB_HOST_GNU_TYPE)-gcc
export PKG_CONFIG := $(DEB_HOST_GNU_TYPE)-pkg-config
export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__$(DEB_HOST_MULTIARCH)
define ruby_env
  RUBYLIB=/usr/lib/$(DEB_HOST_MULTIARCH)/ruby-crossbuild/$$($(1) -e "puts RbConfig::CONFIG['ruby_version']")
endef
else
define ruby_env
endef
endif

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    MAKEFLAGS += -j$(NUMJOBS)
endif

DOPACKAGES = $(shell dh_listpackages)

ifneq ($(filter python3-semanage,$(DOPACKAGES)),)
PY3VERSIONS = $(shell py3versions -rv)
endif
ifneq ($(filter ruby-semanage,$(DOPACKAGES)),)
RUBY_VERSIONS := $(shell dh_ruby --print-supported)
endif

# Upstream recommends using this flag
export DEB_CFLAGS_MAINT_APPEND = -fno-semantic-interposition
# The build system doesn't use CPPFLAGS, pass them to CFLAGS to enable the
# missing (hardening) flags. Also enable Wall and Wextra to spot basic irregularities.
export DEB_CFLAGS_MAINT_APPEND += $(shell dpkg-buildflags --get CPPFLAGS) -Wall -Wextra

%:
	dh $@

override_dh_auto_build:
	$(MAKE) all

ifneq ($(filter python3-semanage,$(DOPACKAGES)),)
	set -e; for version in $(PY3VERSIONS); do        \
	  $(MAKE) pywrap PYTHON=python$$version PYLIBS=; \
	done;
endif
ifneq ($(filter ruby-semanage,$(DOPACKAGES)),)
	set -e; for version in $(RUBY_VERSIONS); do      \
	  $(call ruby_env,$$version) \
	  $(MAKE) -C src rubywrap RUBY=$$version; \
	done;
endif

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

ifneq ($(filter python3-semanage,$(DOPACKAGES)),)
	set -e; for version in $(PY3VERSIONS); do        \
	  $(MAKE) install-pywrap PYTHON=python$$version DESTDIR="${CURDIR}/debian/tmp" DEB_PYTHON_INSTALL_LAYOUT=deb; \
	done;
endif
ifneq ($(filter ruby-semanage,$(DOPACKAGES)),)
	set -e; for version in $(RUBY_VERSIONS); do      \
	  $(call ruby_env,$$version) \
	  $(MAKE) -C src install-rubywrap RUBY=$$version DESTDIR="${CURDIR}/debian/tmp"; \
	done;
endif

override_dh_auto_clean:
	dh_auto_clean
ifneq ($(filter python3-semanage,$(DOPACKAGES)),)
	set -e; for version in $(PY3VERSIONS); do         \
	  $(MAKE) clean PYTHON=python$$version;  \
	done;
endif
ifneq ($(filter ruby-semanage,$(DOPACKAGES)),)
	set -e; for version in $(RUBY_VERSIONS); do      \
	  $(call ruby_env,$$version) \
	  $(MAKE) clean RUBY=$$version; \
	done;
endif

override_dh_fixperms:
	dh_fixperms
ifneq ($(filter python3-semanage,$(DOPACKAGES)),)
	chmod -x ${CURDIR}/debian/python3-semanage/usr/lib/python*/*-packages/semanage.py
endif