File: rules

package info (click to toggle)
intel-microcode 3.20161104.1~deb8u1~bpo7%2B1
  • links: PTS, VCS
  • area: non-free
  • in suites: wheezy-backports
  • size: 9,664 kB
  • sloc: sh: 155; makefile: 130
file content (89 lines) | stat: -rwxr-xr-x 2,235 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
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
# debian/rules for intel-microcode
# Copyright (C) 2011,2012 by Henrique de Moraes Holschuh
# Published under the GNU GPL license version 2 or any later versions

PACKAGE := intel-microcode
DEBDIR  := $(CURDIR)/debian
PKGDIR  := $(DEBDIR)/$(PACKAGE)

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

export PATH := $(PATH):/sbin:/usr/sbin
IUCODE_TOOL := iucode_tool

# DebHelper control
export DH_ALWAYS_EXCLUDE=CVS:.svn:.git

ifneq (,$(filter amd64 x32,$(DEB_HOST_ARCH)))
IUCODE_FILE := intel-microcode-64.bin
else
IUCODE_FILE := intel-microcode.bin
endif

# Work around Debian bug #688794
INITRAMFS_NAME := $(subst -,_,$(subst +,_,$(subst .,_,$(PACKAGE))))

build-indep:

build-arch: build
build:
	dh_testdir
	$(MAKE)

clean:
	dh_testdir
	dh_testroot
	$(MAKE) clean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	# split microcode pack
	$(IUCODE_TOOL) -q --write-firmware="$(PKGDIR)/lib/firmware/intel-ucode" $(IUCODE_FILE)

	# apply best-effort blacklist
	if [ -r debian/ucode-blacklist.txt ] ; then \
		cat debian/ucode-blacklist.txt | while read -r fn crap ; do \
			if [ -r "$(PKGDIR)/lib/firmware/intel-ucode/$${fn}" ] ; then \
				mv "$(PKGDIR)/lib/firmware/intel-ucode/$${fn}" "$(PKGDIR)/lib/firmware/intel-ucode/$${fn}.initramfs" ;\
				echo "Renaming blacklisted microcode $${fn}" ; \
			fi ; \
		done ; \
	fi

	mkdir -p "$(PKGDIR)/usr/share/initramfs-tools/hooks"
	install -m 755 "$(DEBDIR)/initramfs.hook" \
		"$(PKGDIR)/usr/share/initramfs-tools/hooks/$(INITRAMFS_NAME)"
	mkdir -p "$(PKGDIR)/etc/kernel/preinst.d"
	install -m 755 "$(DEBDIR)/$(PACKAGE).kpreinst" \
		"$(PKGDIR)/etc/kernel/preinst.d/$(PACKAGE)"

	# We have a /etc/default file, but no initscript
	install -m 644 "$(DEBDIR)/$(PACKAGE).default" "$(PKGDIR)/etc/default/$(PACKAGE)"

	# modprobe.d blacklist
	install -m 644 "$(DEBDIR)/$(PACKAGE).modprobe-blacklist" "$(PKGDIR)/etc/modprobe.d/$(PACKAGE)-blacklist.conf"

binary: install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs changelog
	dh_lintian
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-indep:

binary-arch: binary

.PHONY: build clean binary install binary-arch binary-indep