File: rules

package info (click to toggle)
fwupdate 8-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 472 kB
  • ctags: 308
  • sloc: ansic: 3,114; makefile: 318; sh: 152
file content (64 lines) | stat: -rwxr-xr-x 2,134 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
#!/usr/bin/make -f
# -*- makefile -*-
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
EFIDIR ?= $(shell dpkg-vendor --query vendor | awk '{ print tolower($$0) }')
PODATE := $(shell dpkg-parsechangelog --show-field Date | xargs -0 date --utc "+%Y-%m-%d %H:%M%z" --date)

SB_PACKAGE :=
ifeq (yes,$(shell dpkg-vendor --derives-from Ubuntu && echo yes))
SB_PACKAGE := 1
deb_version	:= $(shell dpkg-parsechangelog | sed -ne "s/^Version: \(.*\)/\1/p")
tar_name	:= fwupdate_$(deb_version)_$(DEB_HOST_ARCH).tar.gz
endif

buildroot	:= debian/tmp


%:
	dh $@

override_dh_auto_build:
	dh_auto_build -- libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
			 libexecdir=\$${prefix}lib/ \
			 datadir=/var/cache/ \
			 localedir=/usr/share/locale/ \
			 GNUEFIDIR=\$${prefix}/lib \
			 EFIDIR=$(EFIDIR)
	sed 's,#EFIDIR#,$(EFIDIR),' \
		debian/fwupdate.postrm.in > debian/fwupdate.postrm
	sed 's,#EFIDIR#,$(EFIDIR),' \
		debian/fwupdate.postinst.in > debian/fwupdate.postinst

	# This is to satisfy https://wiki.debian.org/ReproducibleBuilds
	sed -i 's,POT-Creation-Date:.*,POT-Creation-Date: $(PODATE)\\n",' \
		linux/libfwup.po
	sed -i 's,POT-Creation-Date:.*,POT-Creation-Date: $(PODATE)\\n",' \
		linux/fwupdate.po

override_dh_auto_install:
	dh_auto_install -- libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
			   libexecdir=\$${prefix}lib/ \
			   datadir=/var/cache/ \
			   localedir=/usr/share/locale/ \
			   GNUEFIDIR=\$${prefix}/lib \
			   EFIDIR=$(EFIDIR)
	chmod -x ${buildroot}/boot/efi/EFI/$(EFIDIR)/*.efi
	cp debian/scripts/install.in   ${buildroot}/usr/lib/fwupdate/install
	sed -i 's,#EFIDIR#,$(EFIDIR),' ${buildroot}/usr/lib/fwupdate/install

override_dh_auto_clean:
	dh_auto_clean -- EFIDIR=$(EFIDIR)
ifneq (,$(SB_PACKAGE))
		rm -rf debian/fwupdate-images
endif

override_dh_builddeb:
	dh_builddeb -- -Zxz
ifneq (,$(SB_PACKAGE))
		mkdir -p debian/fwupdate-images/$(deb_version)
		cp efi/fwup*.efi debian/fwupdate-images/$(deb_version)
		echo $(deb_version) \
			> debian/fwupdate-images/$(deb_version)/version
			cd debian/fwupdate-images && tar czvf ../../../$(tar_name) .
			dpkg-distaddfile $(tar_name) raw-uefi -
endif