-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrules
executable file
·45 lines (38 loc) · 1018 Bytes
/
rules
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
DRIVER_NAME := lo
VERSION := $(shell dpkg-parsechangelog | grep '^Version:' | cut -d' ' -f2 | cut -d- -f1 | cut -d\: -f2)
PKG_NAME := multi-loopback
PKG_kernel_src := $(PKG_NAME)-dkms
ARCH := $(shell dpkg --print-architecture)
ifeq ($(ARCH),amd64)
ARCH_SUFFIX=x86_64
else
ARCH_SUFFIX=i386
endif
%:
dh "$@"
# we don't actually build/clean the source here, it's dkms
override_dh_auto_clean:
override_dh_auto_build:
override_dh_auto_install:
# just create .install files from templates.
for i in dkms.conf \
$(PKG_kernel_src).install \
$(PKG_kernel_src).postinst \
$(PKG_kernel_src).prerm; do \
sed \
-e "s|#PKG_NAME#|$(PKG_NAME)|" \
-e "s|#DRIVER_NAME#|$(DRIVER_NAME)|" \
-e "s|#VERSION#|$(VERSION)|" \
-e "s|#ARCH#|$(ARCH_SUFFIX)|" \
debian/$$i.in > debian/$$i; \
done
override_dh_clean:
dh_clean
for i in dkms.conf \
$(PKG_kernel_src).install \
$(PKG_kernel_src).postinst \
$(PKG_kernel_src).prerm \
$(PKG_kernel_src); do \
rm -f debian/$$i; \
done