diff options
author | Furkan Kardame | 2024-02-18 21:43:09 +0300 |
---|---|---|
committer | Furkan Kardame | 2024-02-18 21:43:09 +0300 |
commit | 495ac5a7b196125d1e432d18ed81d00d1c2b8816 (patch) | |
tree | cc9120cf59f330952dd0da02490ddac03d425918 | |
download | aur-495ac5a7b196125d1e432d18ed81d00d1c2b8816.tar.gz |
init pkg
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | PKGBUILD | 46 | ||||
-rw-r--r-- | cammus-ff-dkms.install | 11 | ||||
-rw-r--r-- | cammus.rules | 13 | ||||
-rw-r--r-- | cp5-pedal.sh | 9 |
5 files changed, 98 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..1e03d420d956 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = cammus-ff-dkms + pkgdesc = Enable Force Feedback for Cammus C5 Direct Drive Wheel + pkgver = r28.2a2be93 + pkgrel = 2 + url = https://github.com/spikerguy/cammus-ff + install = cammus-ff-dkms.install + arch = any + license = GPL2 + makedepends = git + makedepends = joyutils + depends = dkms + source = cammus-ff::git+https://github.com/spikerguy/cammus-ff.git#branch=master + source = cammus.rules + source = cp5-pedal.sh + b2sums = SKIP + b2sums = 2f2982dea2cd2ec565ed59175188660da96a0bda68808270b0d78b85ac6860d6d11f11dabaa6cd653f0753a1ff502065cc504ecf4c5c1417008cbe6b6be3c02d + b2sums = ec4dfd2fd6872ff16bd73fcf01e78d3e54413f3da6fcf5c0e0c686cec6e0eee0f302ee63d25bbd2e67622e3d85605ad48e6fae212037297b5b8483fd693859aa + +pkgname = cammus-ff-dkms diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..26b2328d3635 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Furkan Kardame <tech@fkardame.com> +pkgname=cammus-ff-dkms +_pkgname="${pkgname%-*}" +pkgver=r28.2a2be93 +pkgrel=2 +pkgdesc='Enable Force Feedback for Cammus C5 Direct Drive Wheel' +arch=(any) +url="https://github.com/spikerguy/${_pkgname}" +license=(GPL2) +depends=(dkms) +install=${pkgname}.install +makedepends=(git joyutils) +source=("$_pkgname::git+${url}.git#branch=master" + 'cammus.rules' + 'cp5-pedal.sh') +b2sums=('SKIP' + '2f2982dea2cd2ec565ed59175188660da96a0bda68808270b0d78b85ac6860d6d11f11dabaa6cd653f0753a1ff502065cc504ecf4c5c1417008cbe6b6be3c02d' + 'ec4dfd2fd6872ff16bd73fcf01e78d3e54413f3da6fcf5c0e0c686cec6e0eee0f302ee63d25bbd2e67622e3d85605ad48e6fae212037297b5b8483fd693859aa') + +prepare() { + local src + for src in "${source[@]}"; do + src="${src%%::*}" + src="${src##*/)}" + [[ $src = *.patch ]] || continue + echo -e "Applying patch: \\033[1;36m$src\\033[0m" + patch -Np1 < "$srcdir/$src" + done +} + +pkgver() { + cd "$srcdir"/"$_pkgname" + # Git, tags available + # printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')" + # Git, no tags available + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +package() { + install -Dm 0644 -T cammus.rules "${pkgdir}/usr/lib/udev/rules.d/99-cammus.rules" + install -Dm 0755 cp5-pedal.sh -t "${pkgdir}/usr/bin/" + cd "$srcdir"/"$_pkgname" + mkdir -p "$pkgdir/usr/src/$_pkgname-$pkgver" + cp -r . "$pkgdir/usr/src/$_pkgname-$pkgver" + +} diff --git a/cammus-ff-dkms.install b/cammus-ff-dkms.install new file mode 100644 index 000000000000..2ea69e6ab83c --- /dev/null +++ b/cammus-ff-dkms.install @@ -0,0 +1,11 @@ +post_install() { + dkms install "cammus-ff/0.0.1" +} + +post_upgrade() { + post_install +} + +pre_remove() { + dkms remove "cammus-ff/0.0.1" --all +} diff --git a/cammus.rules b/cammus.rules new file mode 100644 index 000000000000..46f09aaee6c0 --- /dev/null +++ b/cammus.rules @@ -0,0 +1,13 @@ +### Dumping all subsystems for now until further test + +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3416", ATTRS{idProduct}=="1018", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1", ENV{ID_CLASS}="joystick", TAG+="uaccess" +SUBSYSTEM=="input", ATTRS{idVendor}=="3416", ATTRS{idProduct}=="1018", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1", ENV{ID_CLASS}="joystick", TAG+="uaccess" +SUBSYSTEM=="event", ATTRS{idVendor}=="3416", ATTRS{idProduct}=="1018", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1", ENV{ID_CLASS}="joystick", TAG+="uaccess" +SUBSYSTEM=="js", ATTRS{idVendor}=="3416", ATTRS{idProduct}=="1018", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1", ENV{ID_CLASS}="joystick", TAG+="uaccess" + +### Calibrate pedals axis for jsdev #TODO +#ACTION=="add", KERNEL=="js[0-9]*", ENV{ID_VENDOR_ID}=="3416", ENV{ID_MODEL_ID}=="1018", RUN+="/usr/bin/jscal -u 3,1,2,3,0 -s 3,1,0,3056,3056,-517200,-516703,1,0,1423,1423,377269,377269,0,0 /dev/input/js%n" + +### Calibrate pedals axis for evdev +ACTION=="add", ENV{ID_VENDOR_ID}=="3416", ENV{ID_MODEL_ID}=="1018", RUN+="/usr/bin/cp5-pedal.sh" + diff --git a/cp5-pedal.sh b/cp5-pedal.sh new file mode 100644 index 000000000000..ea103157f6ea --- /dev/null +++ b/cp5-pedal.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +### Use these for older version firmware +#evdev-joystick --e /dev/input/by-id/usb-CAMMUS006_CAMMUS_CP5_PEDALS_4975237D3448-event-if00 --d 0 --minimum 1995 --maximum 4095 --axis 1 +#evdev-joystick --e /dev/input/by-id/usb-CAMMUS006_CAMMUS_CP5_PEDALS_4975237D3448-event-if00 --d 0 --minimum 0 --maximum 2930 --axis 2 + +### Use these for firmware 9 and above +evdev-joystick --e /dev/input/by-id/usb-CAMMUS006_CAMMUS_CP5_PEDALS_4975237D3448-event-if00 --d 0 --minimum 0 --maximum 4095 --axis 1 +evdev-joystick --e /dev/input/by-id/usb-CAMMUS006_CAMMUS_CP5_PEDALS_4975237D3448-event-if00 --d 0 --minimum 0 --maximum 2930 --axis 2 |