Skip to content

Commit

Permalink
xpadneo, installer: Fix usage of ETC_PREFIX
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Krakow <[email protected]>
  • Loading branch information
kakra committed Dec 24, 2024
1 parent 1f552b4 commit 37b94fd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
DKMS ?= : SKIPPING dkms
endif

ETC_PREFIX ?= $(PREFIX)/etc
ETC_PREFIX ?= /etc

all: build

Expand All @@ -21,7 +21,7 @@ help:
@echo
@echo "Variables:"
@echo "PREFIX Install files into this prefix"
@echo "ETC_PREFIX Install etc files into this prefix (defaults to \$PREFIX/etc)"
@echo "ETC_PREFIX Install etc files relative to the prefix (defaults to /etc)"
@echo
@echo "Using PREFIX requires handling dkms commands in your package script."

Expand All @@ -36,14 +36,15 @@ build: VERSION
$(MAKE) VERSION="$(shell cat VERSION)" -C hid-xpadneo dkms.conf

install: build
mkdir -p $(PREFIX)/etc/modprobe.d $(PREFIX)/etc/udev/rules.d
install -D -m 0644 -t $(PREFIX)/etc/modprobe.d $(MODPROBE_CONFS:%=hid-xpadneo/etc-modprobe.d/%)
install -D -m 0644 -t $(PREFIX)/etc/udev/rules.d $(UDEV_RULES:%=hid-xpadneo/etc-udev-rules.d/%)
mkdir -p $(PREFIX)$(ETC_PREFIX)/modprobe.d $(PREFIX)$(ETC_PREFIX)/udev/rules.d
install -D -m 0644 -t $(PREFIX)$(ETC_PREFIX)/modprobe.d $(MODPROBE_CONFS:%=hid-xpadneo/etc-modprobe.d/%)
install -D -m 0644 -t $(PREFIX)$(ETC_PREFIX)/udev/rules.d $(UDEV_RULES:%=hid-xpadneo/etc-udev-rules.d/%)
$(DKMS) add hid-xpadneo

uninstall: VERSION
$(DKMS) remove "hid-xpadneo/$(shell cat VERSION)" --all
rm -Rf "$(PREFIX)/usr/src/hid-xpadneo-$(shell cat VERSION)"
rm -f $(PREFIX)$(UDEV_RULES:%=$(ETC_PREFIX)/udev/rules.d/%)
rm -f $(PREFIX)$(MODPROBE_CONFS:%=$(ETC_PREFIX)/modprobe.d/%)
rmdir --ignore-fail-on-non-empty -p $(PREFIX)/etc/modprobe.d $(PREFIX)/etc/udev/rules.d
rm -f $(UDEV_RULES:%=$(PREFIX)$(ETC_PREFIX)/udev/rules.d/%)
rm -f $(MODPROBE_CONFS:%=$(PREFIX)$(ETC_PREFIX)/modprobe.d/%)
rmdir --ignore-fail-on-non-empty -p $(PREFIX)$(ETC_PREFIX)/modprobe.d $(PREFIX)$(ETC_PREFIX)/udev/rules.d

0 comments on commit 37b94fd

Please sign in to comment.