install: have ./_install.sh for packaging

This commit is contained in:
John Gebbie 2023-01-31 12:26:10 +00:00
parent 8dd7d72f35
commit 9682b408ab
2 changed files with 13 additions and 5 deletions

8
_install.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
# ./_install.sh [DESTDIR] [BINDIR]
mkdir -p "$1/${2:-usr/local/bin}" || exit
cp -v dotoolc dotoold "$1/${2:-usr/local/bin}" || exit
mkdir -p "$1/usr/share/X11/xorg.conf.d" || exit
cp -v 50-dotool.conf "$1/usr/share/X11/xorg.conf.d" || exit
mkdir -p "$1/etc/sway/config.d" || exit
cp -v dotool.sway "$1/etc/sway/config.d/dotool" || exit

View file

@ -3,11 +3,11 @@
: "${DOTOOL_VERSION=$(git describe --long --abbrev=12 --tags --dirty 2>/dev/null || echo 1.1)}" : "${DOTOOL_VERSION=$(git describe --long --abbrev=12 --tags --dirty 2>/dev/null || echo 1.1)}"
go build -ldflags "-X main.Version=$DOTOOL_VERSION" || exit go build -ldflags "-X main.Version=$DOTOOL_VERSION" || exit
mkdir -p "$1/${2:-usr/local/bin}" || exit mkdir -p "$1/${2:-usr/local/bin}" || exit
cp -v dotool dotoolc dotoold "$1/${2:-usr/local/bin}" || exit cp -v dotool "$1/${2:-usr/local/bin}" || exit
mkdir -p "$1/etc/udev/rules.d" || exit mkdir -p "$1/etc/udev/rules.d" || exit
cp -v 80-dotool.rules "$1/etc/udev/rules.d" || exit cp -v 80-dotool.rules "$1/etc/udev/rules.d" || exit
mkdir -p "$1/usr/share/X11/xorg.conf.d" || exit ./_install.sh "$1" "$2" || exit
cp -v 50-dotool.conf "$1/usr/share/X11/xorg.conf.d" || exit
mkdir -p "$1/etc/sway/config.d" || exit # Make the new/updated udev rule effective
cp -v dotool.sway "$1/etc/sway/config.d/dotool" || exit udevadm control --reload
udevadm trigger udevadm trigger