Support `make install` on non-busybox systems

Instead on using `cp`, `chown`, `chmod`, and `mkdir`, now use
`install`. This has the nice side-effects that the setuid bit is
correctly preserved on systems using GNU coreutils instead of busybox
and that the access rights are not changed in the build directory.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
master
Frank Oltmanns 4 years ago committed by Maarten van Gompel
parent 9346bf6e15
commit 371d3cdd52
  1. 34
      Makefile

@ -33,37 +33,25 @@ clean:
rm programs/sxmo_setpineled programs/sxmo_screenlock programs/sxmo_setpinebacklight programs/sxmo_megiaudioroute programs/sxmo_vibratepine rm programs/sxmo_setpineled programs/sxmo_screenlock programs/sxmo_setpinebacklight programs/sxmo_megiaudioroute programs/sxmo_vibratepine
install: $(PROGRAMS) install: $(PROGRAMS)
mkdir -p $(PREFIX)/usr/share/sxmo cd configs && find . -type f -exec install -D -m 0644 "{}" "$(PREFIX)/usr/share/sxmo/{}" \; && cd ..
cp -r configs/* $(PREFIX)/usr/share/sxmo
# Configs # Configs
mkdir -p $(PREFIX)/etc/alsa/conf.d/ install -D -m 0644 -t $(PREFIX)/etc/alsa/conf.d/ configs/alsa/alsa_sxmo_enable_dmix.conf
cp configs/alsa/alsa_sxmo_enable_dmix.conf $(PREFIX)/etc/alsa/conf.d/
mkdir -p $(PREFIX)/etc/polkit-1/rules.d install -D -m 0644 -t $(PREFIX)/etc/polkit-1/rules.d/ configs/polkit/*.rules
cp configs/polkit/*.rules $(PREFIX)/etc/polkit-1/rules.d/
mkdir -p $(PREFIX)/etc/udev/rules.d install -D -m 0644 -t $(PREFIX)/etc/udev/rules.d/ configs/udev/*.rules
cp configs/udev/*.rules $(PREFIX)/etc/udev/rules.d/
mkdir -p $(PREFIX)/usr/share/applications/ install -D -m 0644 -t $(PREFIX)/usr/share/applications/ configs/xdg/mimeapps.list
cp configs/xdg/mimeapps.list $(PREFIX)/usr/share/applications/
# Bin # Bin
mkdir -p $(PREFIX)/usr/bin install -D -t $(PREFIX)/usr/bin scripts/*/*
cp scripts/*/* $(PREFIX)/usr/bin
chown root programs/sxmo_setpineled install -D -o root -m 4755 programs/sxmo_setpineled $(PREFIX)/usr/bin/
chmod u+s programs/sxmo_setpineled
cp programs/sxmo_setpineled $(PREFIX)/usr/bin
chown root programs/sxmo_setpinebacklight install -D -o root -m 4755 programs/sxmo_setpinebacklight $(PREFIX)/usr/bin/
chmod u+s programs/sxmo_setpinebacklight
cp programs/sxmo_setpinebacklight $(PREFIX)/usr/bin
chown root programs/sxmo_screenlock install -D -o root -m 4755 programs/sxmo_screenlock $(PREFIX)/usr/bin/
chmod u+s programs/sxmo_screenlock
cp programs/sxmo_screenlock $(PREFIX)/usr/bin
cp programs/sxmo_megiaudioroute $(PREFIX)/usr/bin install -D programs/sxmo_megiaudioroute $(PREFIX)/usr/bin/
cp programs/sxmo_vibratepine $(PREFIX)/usr/bin install -D programs/sxmo_vibratepine $(PREFIX)/usr/bin/

Loading…
Cancel
Save