summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Luna2018-01-09 21:42:47 -0600
committerChristopher Luna2018-01-09 21:42:47 -0600
commitf866e551997f745ea994ab109223d24bcafd3634 (patch)
treea3db0197176d23519dd41af81a689bb34f623c97
downloadaur-f866e551997f745ea994ab109223d24bcafd3634.tar.gz
First commit
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD33
-rw-r--r--moltengamepad.install49
3 files changed, 97 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b7d29ff92054
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = moltengamepad
+ pkgdesc = Flexible Linux input device translator, geared for gamepads
+ pkgver = 1.1.0
+ pkgrel = 1
+ url = https://github.com/jgeumlek/MoltenGamepad
+ install = moltengamepad.install
+ arch = x86_64
+ license = MIT
+ depends = scraw
+ depends = scrawpp
+ source = https://github.com/jgeumlek/MoltenGamepad/archive/6fd48a49a9ddb0b509b10f6e79ff3da3a49e925d.zip
+ md5sums = 80bcf71ebb0d0ea757e3089ac9bfc231
+
+pkgname = moltengamepad
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..aab017cab079
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,33 @@
+# Contributor: chrisl echo archlinux@c2h0r1i2s4t5o6p7h8e9r-l3u4n1a.com|sed 's/[0-9]//g'
+
+pkgname="moltengamepad"
+pkgver=1.1.0
+pkgrel=1
+pkgdesc="Flexible Linux input device translator, geared for gamepads"
+url="https://github.com/jgeumlek/MoltenGamepad"
+arch=('x86_64')
+_commit="6fd48a49a9ddb0b509b10f6e79ff3da3a49e925d"
+license=('MIT')
+source=("https://github.com/jgeumlek/MoltenGamepad/archive/${_commit}.zip")
+md5sums=('80bcf71ebb0d0ea757e3089ac9bfc231')
+depends=('scraw' 'scrawpp')
+install="moltengamepad.install"
+
+build() {
+ cd "MoltenGamepad-${_commit}"
+ sed -i '3 s/^#//' Makefile
+ sed -i '5 s/^#//' Makefile
+ sed -i '11 s|/usr/local/bin/|/usr/bin/|' installation/systemuser/systemd.service
+ make || return 1
+}
+
+package() {
+ cd "MoltenGamepad-${_commit}"
+ mkdir -p $pkgdir/usr/bin/
+ mkdir -p $pkgdir/usr/lib/systemd/system/
+ install -Dm755 moltengamepad $pkgdir/usr/bin/moltengamepad
+ install -Dm644 installation/systemuser/systemd.service $pkgdir/usr/lib/systemd/system/moltengamepad.service
+ install -Dm644 installation/systemuser/udev.rules "$pkgdir"/usr/lib/udev/rules.d/72-moltengamepad.rules
+ install -Dm644 installation/systemuser/tmpfiles.conf "$pkgdir"/usr/lib/tmpfiles.d/moltengamepad.conf
+ install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/license
+}
diff --git a/moltengamepad.install b/moltengamepad.install
new file mode 100644
index 000000000000..3fc59b7a572a
--- /dev/null
+++ b/moltengamepad.install
@@ -0,0 +1,49 @@
+# This install script is based on the installation/systemuser/install.sh script from moltengamepad
+
+post_install() {
+ if [ -z "`grep "^gamepad:" /etc/group`" ]; then
+ groupadd gamepad
+ fi
+ if [ -n "`grep "^gamepad:" /etc/passwd`" ]; then
+ useradd -r -s /bin/false -c "gamepad user" gamepad
+ gpasswd -a gamepad gamepad
+ fi
+
+ udevadm control --reload
+ systemd-tmpfiles --create
+
+ # Reload uinput to get its new permissions.
+ rmmod uinput
+ modprobe uinput
+
+ # Try to detect a case where "TAG-=uaccess" is not supported.
+ # This work-around uses "last_rule" which can lead to surprising behavior when writing other udev rules.
+ # As a courtesy, alert the user in case they have interest in writing udev rules later.
+ UDEV_VERSION=$(udevadm --version)
+ if [[ "$?" -ne "0" ]]; then
+ UDEV_VERSION=""
+ echo "Could not detect udev version. If the version is less than 217, the uaccess tag cannot be removed."
+ fi
+
+ if [[ "$UDEV_VERSION" != "" && "$UDEV_VERSION" -ge "217" ]]; then
+ echo "Detected version of udev that supports removing tags."
+ echo ""
+ fi
+
+ if [[ "$UDEV_VERSION" != "" && "$UDEV_VERSION" -lt "217" ]]; then
+ echo "An old version of udev was detected! This version does not support removing the uaccess tag."
+ echo ""
+ fi
+
+ if [[ "$UDEV_VERSION" == "" || "$UDEV_VERSION" -lt "217" ]]; then
+ echo "If the uaccess tag is not removed, then hiding the original device nodes may fail in certain situations."
+ echo "To remedy this, please comment out the following line in /lib/udev/rules.d/70-uaccess.rules"
+ echo -e '\tSUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="?*", TAG+="uaccess"'
+ echo ""
+ echo "A modified version can be placed at /etc/udev/rules.d/70-uaccess.rules to shadow the original file in /lib/."
+ echo ""
+ fi
+
+ # Tell the user we're done and what to do next.
+ echo "Start/enable the moltengamepad service"
+}