Skip to content

Commit

Permalink
try to get PKGBUILD working
Browse files Browse the repository at this point in the history
  • Loading branch information
antonilol committed Nov 4, 2021
1 parent f010278 commit 4f1aac0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 5 additions & 2 deletions PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
# Maintainer: Antoni Spaanderman <56turtle56@gmail.com>

pkgname=simple-usb-automount
pkgver=1.0.0
pkgver=1.0.1
pkgrel=1
arch=('any')
url=https://github.com/antonilol/simple-usb-automount
license=('MIT')
source=("simple-usb-automount::git+$url#tag=v$pkgver")
md5sums=('SKIP')

package() {
./install
cd "$pkgname"
mkdir -p "$pkgdir"/{usr/local/bin,etc/{systemd/system,udev/rules.d}}
./install rw "$pkgdir"
}


12 changes: 7 additions & 5 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

cd files

echo "args: $@" >&2 # debug

# the user id (uid) to send the notification to (with notify-send)
UID_NOTIFICATION="1000"

cp 99-simple-usb-automount.rules /etc/udev/rules.d/
cp 99-simple-usb-automount.rules "$2"/etc/udev/rules.d/

if [[ "$1" == "ro" ]]; then
sed 's/mntopts="/&ro,/' simple-usb-automount > /usr/local/bin/simple-usb-automount
sed 's/mntopts="/&ro,/' simple-usb-automount > "$2"/usr/local/bin/simple-usb-automount
else
cp simple-usb-automount /usr/local/bin/
cp simple-usb-automount "$2"/usr/local/bin/
fi
chmod +x /usr/local/bin/simple-usb-automount
chmod +x "$2"/usr/local/bin/simple-usb-automount

sed "s/{UID}/$UID_NOTIFICATION/; s/{USER}/$(getent passwd "$UID_NOTIFICATION" | cut -d: -f1)/" simple-usb-automount@.service > /etc/systemd/system/simple-usb-automount@.service
sed "s/{UID}/$UID_NOTIFICATION/; s/{USER}/$(getent passwd "$UID_NOTIFICATION" | cut -d: -f1)/" simple-usb-automount@.service > "$2"/etc/systemd/system/simple-usb-automount@.service

systemctl daemon-reload

Expand Down

0 comments on commit 4f1aac0

Please sign in to comment.