void-packages/srcpkgs/acpi_call-dkms/patches/dkms_conf_from_outside.patch

70 lines
1.8 KiB
Diff

From 4b14040db865034eb4aa215efd212307a9c60167 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com>
Date: Sun, 18 Jul 2021 18:16:13 -0300
Subject: [PATCH] Allow dkms.conf to be used outside of the repository
Add a Makefile target that turns the dkms.conf.in template into a
dkms.conf file that has all the necessary informantion to be installed
directly on a system.
All the dkms-* targets need to depend on the dkms.conf file, now.
---
.gitignore | 1 +
Makefile | 11 +++++++----
dkms.conf => dkms.conf.in | 2 +-
3 files changed, 9 insertions(+), 5 deletions(-)
rename dkms.conf => dkms.conf.in (84%)
diff --git a/.gitignore b/.gitignore
index a73e5d1..9f39b24 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@ MANIFEST
Module.symvers
debian/tmp/*
modules.order
+dkms.conf
diff --git a/Makefile b/Makefile
index 269b43f..0094f7e 100644
--- a/Makefile
+++ b/Makefile
@@ -17,16 +17,19 @@ load:
-/sbin/rmmod acpi_call
/sbin/insmod acpi_call.ko
-dkms-add:
+dkms.conf: dkms.conf.in
+ sed "s/@@VERSION@@/$(VERSION)/" $^ > $@
+
+dkms-add: dkms.conf
/usr/sbin/dkms add $(CURDIR)
-dkms-build:
+dkms-build: dkms.conf
/usr/sbin/dkms build acpi_call/$(VERSION)
-dkms-install:
+dkms-install: dkms.conf
/usr/sbin/dkms install acpi_call/$(VERSION)
-dkms-remove:
+dkms-remove: dkms.conf
/usr/sbin/dkms remove acpi_call/$(VERSION) --all
modprobe-install:
diff --git a/dkms.conf b/dkms.conf.in
similarity index 84%
rename from dkms.conf
rename to dkms.conf.in
index 780fb50..b927370 100644
--- a/dkms.conf
+++ b/dkms.conf.in
@@ -1,5 +1,5 @@
PACKAGE_NAME="acpi_call"
-PACKAGE_VERSION="$(cat VERSION)"
+PACKAGE_VERSION="@@VERSION@@"
MAKE="KDIR=/lib/modules/${kernelver}/build make"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="acpi_call"