File: rules

package info (click to toggle)
fapolicyd 1.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,060 kB
  • sloc: ansic: 10,446; makefile: 206; sh: 132; python: 26
file content (45 lines) | stat: -rwxr-xr-x 1,292 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
39
40
41
42
43
44
45
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
  CC=$(DEB_HOST_GNU_TYPE)-gcc
else
  CC=gcc
endif

DEB_BUILD_MAINT_OPTIONS := hardening=+all
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

LD_SO_PATH := $(shell readelf -e /usr/bin/dash | grep Requesting | sed 's/.$$//' | rev | cut -d" " -f1 | rev)

%:
	dh $@ --with autoreconf --exclude=.la

override_dh_auto_configure:
	dh_auto_configure -- \
		--without-rpm \
		--with-deb \
		--with-audit \
		--with-systemdsystemunitdir=/usr/lib/systemd/system


# override_dh_installinit:
override_dh_installsystemd:
	dh_installsystemd --no-enable --no-start

override_dh_install:
	# generate rules for python
	sed -i "s/%python3_path%/`readlink -f /usr/bin/python3 | \
		sed 's/\//\\\\\//g'`/g" \
		$(CURDIR)/debian/fapolicyd/usr/share/fapolicyd/sample-rules/*.rules
	# Detect run time linker directly from dash
	sed -i "s|%ld_so_path%|`realpath $(LD_SO_PATH)`|g" \
		$(CURDIR)/debian/fapolicyd/usr/share/fapolicyd/sample-rules/*.rules

	dh_install

	rm -rf $(CURDIR)/debian/fapolicyd/usr/lib/*/*.la
	rm -rf $(CURDIR)/debian/fapolicyd/usr/lib/*/*.a
	rm -rf $(CURDIR)/debian/fapolicyd/etc/bash_completion.d
	find $(CURDIR)/debian/fapolicyd -type d -empty -delete