hello world pkg
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/results_xpadneo-dkms/
|
||||||
|
/v*.tar.gz
|
||||||
|
/xpadneo-dkms-*.rpm
|
||||||
14
.vscode/settings.json
vendored
Normal file
14
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"akmods",
|
||||||
|
"autorelease",
|
||||||
|
"autosetup",
|
||||||
|
"buildroot",
|
||||||
|
"copr",
|
||||||
|
"dkms",
|
||||||
|
"hidraw",
|
||||||
|
"noarch",
|
||||||
|
"preun",
|
||||||
|
"xpadneo"
|
||||||
|
]
|
||||||
|
}
|
||||||
12
01-do-not-run-dkms-in-build.patch
Normal file
12
01-do-not-run-dkms-in-build.patch
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
--- install.sh.orig 2025-12-08 00:50:25.991113912 -0600
|
||||||
|
+++ install.sh 2025-12-08 00:51:00.612573764 -0600
|
||||||
|
@@ -22,9 +22,6 @@
|
||||||
|
mkdir -p "/usr/src/hid-xpadneo-${VERSION}"
|
||||||
|
cp --recursive "${V[@]}" hid-xpadneo/. "/usr/src/hid-xpadneo-${VERSION}/."
|
||||||
|
|
||||||
|
- echo "* installing module (using DKMS)"
|
||||||
|
- dkms install "${V[*]}" "hid-xpadneo/${VERSION}" --force || cat_dkms_make_log
|
||||||
|
-
|
||||||
|
else
|
||||||
|
|
||||||
|
echo "already installed!"
|
||||||
13
02-do-not-require-superuser.patch
Normal file
13
02-do-not-require-superuser.patch
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
--- lib/installer.sh.orig 2025-12-08 01:20:46.405846992 -0600
|
||||||
|
+++ lib/installer.sh 2025-12-08 01:21:01.287338783 -0600
|
||||||
|
@@ -1,10 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
-if [ ${EUID} -ne 0 ]; then
|
||||||
|
- echo >&2 "ERROR: You most probably need superuser privileges to use this script, please run me via sudo!"
|
||||||
|
- exit 3
|
||||||
|
-fi
|
||||||
|
-
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true)
|
||||||
|
|
||||||
50
03-remove-unnecessary-install-deps.patch
Normal file
50
03-remove-unnecessary-install-deps.patch
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
--- lib/installer.sh.orig 2025-12-08 01:43:38.693876124 -0600
|
||||||
|
+++ lib/installer.sh 2025-12-08 01:48:50.958815391 -0600
|
||||||
|
@@ -1,16 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
-# shellcheck disable=SC2034
|
||||||
|
-GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || true)
|
||||||
|
-
|
||||||
|
__version() {
|
||||||
|
- git describe --tags --dirty 2>/dev/null || sed -re's/v?(.*)/v\1/' "$(dirname "${BASH_SOURCE[0]}")/../VERSION" || {
|
||||||
|
- echo >&2 "ERROR: If you install from a git repository, you may need to run"
|
||||||
|
- echo >&2 "ERROR: sudo git config --global --add safe.directory \$PWD"
|
||||||
|
- echo >&2 "ERROR: to trust this git checkout for the root user."
|
||||||
|
- echo >&2 "ERROR: See https://github.com/atar-axis/xpadneo/issues/346"
|
||||||
|
- exit 3
|
||||||
|
- }
|
||||||
|
+ sed -re's/v?(.*)/v\1/' "$(dirname "${BASH_SOURCE[0]}")/../VERSION"
|
||||||
|
}
|
||||||
|
|
||||||
|
__version_lte() {
|
||||||
|
@@ -20,28 +11,4 @@
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
VERSION=$(__version)
|
||||||
|
|
||||||
|
-DKMS_BIN=$(type -p dkms)
|
||||||
|
-
|
||||||
|
-# shellcheck disable=SC2086
|
||||||
|
-: ${DKMS_BIN:?Please install dkms to continue}
|
||||||
|
-
|
||||||
|
-get_dkms_versions_installed() {
|
||||||
|
- ${DKMS_BIN} status 2>/dev/null | tr -s ':,/ ' ' ' | awk -- '$1 == "hid-xpadneo" { print $2 }' | sort -nu
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-get_upstream_version_latest() {
|
||||||
|
- curl -sI "https://github.com/atar-axis/xpadneo/releases/latest" | \
|
||||||
|
- awk -- 'BEGIN{IGNORECASE=1} /^location:/ { n = split($2, v, /\//); print v[n]; exit }' | \
|
||||||
|
- tr -d '[:space:]'
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-cat_dkms_make_log() {
|
||||||
|
- local last_error=$?
|
||||||
|
- if [ -n "${V[*]}" ]; then
|
||||||
|
- cat "/var/lib/dkms/hid-xpadneo/${VERSION}/build/make.log" || true
|
||||||
|
- fi
|
||||||
|
- exit ${last_error}
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-# shellcheck disable=SC2034
|
||||||
|
-mapfile -t INSTALLED < <(get_dkms_versions_installed)
|
||||||
|
+INSTALLED=()
|
||||||
13
04-install-to-build-root.patch
Normal file
13
04-install-to-build-root.patch
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
--- install.sh.orig 2025-12-08 01:53:37.575818886 -0600
|
||||||
|
+++ install.sh 2025-12-08 01:54:17.862963305 -0600
|
||||||
|
@@ -19,8 +19,8 @@
|
||||||
|
|
||||||
|
# TODO: Works around https://github.com/dell/dkms/issues/177 for DKMS 3
|
||||||
|
echo "* adding hid-xpadneo-${VERSION} folder to /usr/src"
|
||||||
|
- mkdir -p "/usr/src/hid-xpadneo-${VERSION}"
|
||||||
|
- cp --recursive "${V[@]}" hid-xpadneo/. "/usr/src/hid-xpadneo-${VERSION}/."
|
||||||
|
+ mkdir -p "$RPM_BUILD_ROOT/usr/src/hid-xpadneo-${VERSION}"
|
||||||
|
+ cp --recursive "${V[@]}" hid-xpadneo/. "$RPM_BUILD_ROOT/usr/src/hid-xpadneo-${VERSION}/."
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
24
LICENSE
Normal file
24
LICENSE
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
BSD 2-Clause License
|
||||||
|
|
||||||
|
Copyright (c) 2025, Nicola Clark
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
18
README.md
Normal file
18
README.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# xpadneo-dkms
|
||||||
|
|
||||||
|
[xpadneo](https://github.com/atar-axis/xpadneo) package for Fedora-based
|
||||||
|
distributions using DKMS recompilation.
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
|
The `akmods` package in Fedora requires `grub2`, which I do not have installed
|
||||||
|
(my bootloader is managed externally.) This prevents me from using the
|
||||||
|
`akmods`-based Copr package.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This code is licensed under the [BSD-2-Clause license](LICENSE), which contains
|
||||||
|
restrictions concerning the retention of a copyright notice when redistributing
|
||||||
|
the code. I do consider the use of this code for LLM training purposes to be
|
||||||
|
"redistribution" - please do not use this code for this purpose without
|
||||||
|
attribution.
|
||||||
53
xpadneo-dkms.spec
Normal file
53
xpadneo-dkms.spec
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
Name: xpadneo-dkms
|
||||||
|
Version: 0.9.8
|
||||||
|
Release: %autorelease
|
||||||
|
Summary: Advanced driver for Xbox wireless controllers
|
||||||
|
License: GPL-3.0-only
|
||||||
|
URL: https://github.com/atar-axis/xpadneo
|
||||||
|
Source: https://github.com/atar-axis/xpadneo/archive/refs/tags/v%{version}.tar.gz
|
||||||
|
|
||||||
|
Patch: 01-do-not-run-dkms-in-build.patch
|
||||||
|
Patch: 02-do-not-require-superuser.patch
|
||||||
|
Patch: 03-remove-unnecessary-install-deps.patch
|
||||||
|
Patch: 04-install-to-build-root.patch
|
||||||
|
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
Requires: dkms
|
||||||
|
Requires: gcc
|
||||||
|
Requires: kernel-devel
|
||||||
|
|
||||||
|
%define dkms_mod hid-xpadneo/v%{version}
|
||||||
|
%define dkms_dir %{_prefix}/src/hid-xpadneo-v%{version}
|
||||||
|
|
||||||
|
%description
|
||||||
|
xpadneo package for Fedora-based distributions using DKMS recompilation.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n xpadneo-%{version} -p 0
|
||||||
|
|
||||||
|
%install
|
||||||
|
./install.sh
|
||||||
|
rm %{buildroot}%{dkms_dir}/dkms.conf.in
|
||||||
|
rm %{buildroot}%{dkms_dir}/src/.editorconfig
|
||||||
|
|
||||||
|
%post
|
||||||
|
dkms install --rpm_safe_upgrade %{dkms_mod}
|
||||||
|
|
||||||
|
%preun
|
||||||
|
dkms remove --rpm_safe_upgrade %{dkms_mod}
|
||||||
|
|
||||||
|
%files
|
||||||
|
%{dkms_dir}/etc-modprobe.d/xpadneo.conf
|
||||||
|
%{dkms_dir}/etc-udev-rules.d/60-xpadneo.rules
|
||||||
|
%{dkms_dir}/etc-udev-rules.d/70-xpadneo-disable-hidraw.rules
|
||||||
|
%{dkms_dir}/src/Makefile
|
||||||
|
%{dkms_dir}/src/hid-ids.h
|
||||||
|
%{dkms_dir}/src/hid-xpadneo.c
|
||||||
|
%{dkms_dir}/src/xpadneo.h
|
||||||
|
%{dkms_dir}/Makefile
|
||||||
|
%{dkms_dir}/dkms.conf
|
||||||
|
%{dkms_dir}/dkms.post_install
|
||||||
|
%{dkms_dir}/dkms.post_remove
|
||||||
|
%doc docs/README.md
|
||||||
|
%license LICENSE
|
||||||
Reference in New Issue
Block a user