diff --git a/anda/system/xpadneo/anda.hcl b/anda/system/xpadneo/akmod/anda.hcl similarity index 52% rename from anda/system/xpadneo/anda.hcl rename to anda/system/xpadneo/akmod/anda.hcl index 522f0b2ff8..23ac0b839c 100644 --- a/anda/system/xpadneo/anda.hcl +++ b/anda/system/xpadneo/akmod/anda.hcl @@ -1,8 +1,9 @@ project pkg { rpm { - spec = "xpadneo.spec" + spec = "xpadneo-kmod.spec" } labels { mock = 1 + updbranch = 1 } } diff --git a/anda/system/xpadneo/akmod/update.rhai b/anda/system/xpadneo/akmod/update.rhai new file mode 100644 index 0000000000..e51de83ed3 --- /dev/null +++ b/anda/system/xpadneo/akmod/update.rhai @@ -0,0 +1,3 @@ +import "andax/bump_extras.rhai" as bump; + +rpm.version(bump::madoguchi("xpadneo-kmod-common", labels.branch)); diff --git a/anda/system/xpadneo/akmod/xpadneo-kmod.spec b/anda/system/xpadneo/akmod/xpadneo-kmod.spec new file mode 100644 index 0000000000..ecee2ac7b9 --- /dev/null +++ b/anda/system/xpadneo/akmod/xpadneo-kmod.spec @@ -0,0 +1,63 @@ +%global commit 8d20a23e38883f45c78f48c8574ac93945b4cb03 +%global date 20241224 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global ver 0.9.7 +%define buildforkernels akmod +%global debug_package %{nil} +%global real_name xpadneo + +Name: %{real_name}-kmod +Version: %{ver}^%{date}git.%{shortcommit} +Release: 2%{?dist} +Summary: Advanced Linux Driver for Xbox One Wireless Gamepad +License: GPL-3.0 +URL: https://atar-axis.github.io/xpadneo +Source0: https://github.com/atar-axis/xpadneo/archive/%{commit}.tar.gz#/xpadneo-%{shortcommit}.tar.gz +BuildRequires: kmodtool +BuildRequires: systemd-rpm-macros +Requires: bluez +Requires: bluez-tools +Requires: %{real_name}-kmod-common = %{?epoch:%{epoch}:}%{version} +Packager: ShinyGil + +%{expand:%(kmodtool --target %{_target_cpu} --repo terra --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } + +%description +Advanced Linux Driver for Xbox One Wireless Gamepad. + +%prep +%{?kmodtool_check} +kmodtool --target %{_target_cpu} --repo terra --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null + +%autosetup -p1 -n %{real_name}-%{commit} + +/usr/bin/sed -nE '/^BUILT_MODULE_NAME/{s@^.+"(.+)"@\1@; s|-|_|g; p}' hid-%{real_name}/dkms.conf.in > %{real_name}.conf + +for kernel_version in %{?kernel_versions}; do + mkdir _kmod_build_${kernel_version%%___*} + cp -fr hid-xpadneo/src/* _kmod_build_${kernel_version%%___*} +done + +%build +for kernel_version in %{?kernel_versions}; do + pushd _kmod_build_${kernel_version%%___*}/ + %make_build -C "${kernel_version##*___}" M=$(pwd) VERSION="v%{version}" modules + popd +done + +%install +install -Dm644 %{real_name}.conf -t %{buildroot}%{_modulesloaddir} + +for kernel_version in %{?kernel_versions}; do + mkdir -p %{buildroot}/%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ + install -p -m 0755 _kmod_build_${kernel_version%%___*}/*.ko \ + %{buildroot}/%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ +done +%{?akmod_install} + +%files +%{_modulesloaddir}/%{real_name}.conf + +%changelog +* Thu Feb 27 2025 ShinyGil +- Package refactoring for alternative DKMS package compatibility diff --git a/anda/system/xpadneo/dkms/anda.hcl b/anda/system/xpadneo/dkms/anda.hcl new file mode 100644 index 0000000000..99098cb318 --- /dev/null +++ b/anda/system/xpadneo/dkms/anda.hcl @@ -0,0 +1,10 @@ +project pkg { + arches = ["x86_64"] + rpm { + spec = "dkms-xpadneo.spec" + } + labels { + mock = 1 + updbranch = 1 + } +} diff --git a/anda/system/xpadneo/dkms/dkms-xpadneo.conf b/anda/system/xpadneo/dkms/dkms-xpadneo.conf new file mode 100644 index 0000000000..ecde0d0673 --- /dev/null +++ b/anda/system/xpadneo/dkms/dkms-xpadneo.conf @@ -0,0 +1,6 @@ +PACKAGE_NAME="xpadneo" +PACKAGE_VERSION="__VERSION_STRING" +AUTOINSTALL="yes" + +BUILT_MODULE_NAME[0]="hid-xpadneo" +DEST_MODULE_LOCATION[0]="/extra" diff --git a/anda/system/xpadneo/dkms/dkms-xpadneo.spec b/anda/system/xpadneo/dkms/dkms-xpadneo.spec new file mode 100644 index 0000000000..ebe5b99d24 --- /dev/null +++ b/anda/system/xpadneo/dkms/dkms-xpadneo.spec @@ -0,0 +1,67 @@ +%global commit 8d20a23e38883f45c78f48c8574ac93945b4cb03 +%global date 20241224 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global ver 0.9.7 +%global debug_package %{nil} +%global dkms_name xpadneo + +Name: dkms-%{dkms_name} +Version: %{ver}^%{date}git.%{shortcommit} +Release: 1%{?dist} +Summary: Advanced Linux Driver for Xbox One Wireless Gamepad +License: GPL-3.0 +URL: https://atar-axis.github.io/%{dkms_name} +Source0: https://github.com/atar-axis/%{dkms_name}/archive/%{commit}.tar.gz#/%{dkms_name}-%{shortcommit}.tar.gz +Source1: %{name}.conf +Source2: no-weak-modules.conf +BuildRequires: sed +Requires: bluez +Requires: bluez-tools +Requires: %{dkms_name}-kmod-common = %{?epoch:%{epoch}:}%{version} +Requires: dkms +BuildArch: noarch +Packager: ShinyGil + +%description +Advanced Linux Driver for Xbox One Wireless Gamepad. + +%prep +%autosetup -p1 -n %{dkms_name}-%{commit} + + +cp -f %{SOURCE1} hid-xpadneo/src/dkms.conf + +sed -i -e 's/__VERSION_STRING/%{version}/g' hid-xpadneo/src/dkms.conf +sed -i -e 's/$(VERSION)/v%{version}/g' hid-xpadneo/src/Makefile + +%build + +%install +# Create empty tree: +mkdir -p %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/ +cp -fr hid-xpadneo/src/* %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/ + +%if 0%{?fedora} +# Do not enable weak modules support in Fedora (no kABI): +install -Dpm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/dkms/%{dkms_name}.conf +%endif + +%post +dkms add -m %{dkms_name} -v %{version} -q --rpm_safe_upgrade || : +# Rebuild and make available for the currently running kernel: +dkms build -m %{dkms_name} -v %{version} -q || : +dkms install -m %{dkms_name} -v %{version} -q --force || : + +%preun +# Remove all versions from DKMS registry: +dkms remove -m %{dkms_name} -v %{version} -q --all --rpm_safe_upgrade || : + +%files +%{_usrsrc}/%{dkms_name}-%{version} +%if 0%{?fedora} +%{_sysconfdir}/dkms/%{dkms_name}.conf +%endif + +%changelog +* Thu Feb 27 2025 ShinyGil +- Initial package diff --git a/anda/system/xpadneo/dkms/no-weak-modules.conf b/anda/system/xpadneo/dkms/no-weak-modules.conf new file mode 100644 index 0000000000..24f6f95c96 --- /dev/null +++ b/anda/system/xpadneo/dkms/no-weak-modules.conf @@ -0,0 +1 @@ +NO_WEAK_MODULES="yes" diff --git a/anda/system/xpadneo/dkms/update.rhai b/anda/system/xpadneo/dkms/update.rhai new file mode 100644 index 0000000000..e51de83ed3 --- /dev/null +++ b/anda/system/xpadneo/dkms/update.rhai @@ -0,0 +1,3 @@ +import "andax/bump_extras.rhai" as bump; + +rpm.version(bump::madoguchi("xpadneo-kmod-common", labels.branch)); diff --git a/anda/system/xpadneo/kmod-common/anda.hcl b/anda/system/xpadneo/kmod-common/anda.hcl new file mode 100644 index 0000000000..353eb4917d --- /dev/null +++ b/anda/system/xpadneo/kmod-common/anda.hcl @@ -0,0 +1,10 @@ +project pkg { + arches = ["x86_64"] + rpm { + spec = "xpadneo-kmod-common.spec" + } + labels { + mock = 1 + nightly = 1 + } +} diff --git a/anda/system/xpadneo/io.github.xpadneo.metainfo.xml b/anda/system/xpadneo/kmod-common/io.github.xpadneo.metainfo.xml similarity index 100% rename from anda/system/xpadneo/io.github.xpadneo.metainfo.xml rename to anda/system/xpadneo/kmod-common/io.github.xpadneo.metainfo.xml diff --git a/anda/system/xpadneo/kmod-common/update.rhai b/anda/system/xpadneo/kmod-common/update.rhai new file mode 100644 index 0000000000..19b1642b6c --- /dev/null +++ b/anda/system/xpadneo/kmod-common/update.rhai @@ -0,0 +1,8 @@ +rpm.global("commit", gh_commit("atar-axis/xpadneo")); +if rpm.changed() { + rpm.release(); + rpm.global("commit_date", date()); + let ver = gh("atar-axis/xpadneo"); + ver.crop(1); + rpm.global("ver", ver); +} diff --git a/anda/system/xpadneo/kmod-common/xpadneo-kmod-common.spec b/anda/system/xpadneo/kmod-common/xpadneo-kmod-common.spec new file mode 100644 index 0000000000..e6433b9593 --- /dev/null +++ b/anda/system/xpadneo/kmod-common/xpadneo-kmod-common.spec @@ -0,0 +1,45 @@ +%global commit 8d20a23e38883f45c78f48c8574ac93945b4cb03 +%global date 20241224 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global ver 0.9.7 +%global real_name xpadneo + +Name: %{real_name}-kmod-common +Version: %{ver}^%{date}git.%{shortcommit} +Release: 1%{?dist} +Summary: Advanced Linux Driver for Xbox One Wireless Gamepad common files +License: GPL-3.0 +URL: https://atar-axis.github.io/%{real_name} +Source0: https://github.com/atar-axis/%{real_name}/archive/%{commit}.tar.gz#/%{real_name}-%{shortcommit}.tar.gz +Source1: io.github.xpadneo.metainfo.xml +BuildRequires: systemd-rpm-macros +Provides: %{real_name}-kmod-common = %{?epoch:%{epoch}:}%{version} +BuildArch: noarch +Packager: ShinyGil + +%description +Advanced Linux Driver for Xbox One Wireless Gamepad common files. + +%prep +%autosetup -p1 -n %{real_name}-%{commit} + +%install +# Aliases: +install -Dpm644 hid-%{real_name}/etc-modprobe.d/%{real_name}.conf -t %{buildroot}%{_modprobedir} + +# UDev rules: +install -Dpm644 hid-%{real_name}/etc-udev-rules.d/*.rules -t %{buildroot}%{_udevrulesdir}/ + +# Metadata +install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/metainfo/io.github.xpadneo.metainfo.xml + +%files +%license LICENSE +%doc docs/*.md +%{_modprobedir}/%{real_name}.conf +%{_udevrulesdir}/60-%{real_name}.rules +%{_udevrulesdir}/70-%{real_name}-disable-hidraw.rules +%{_datadir}/metainfo/io.github.xpadneo.metainfo.xml + +%changelog +%autochangelog diff --git a/anda/system/xpadneo/modules-load-d-xpadneo.conf b/anda/system/xpadneo/modules-load-d-xpadneo.conf deleted file mode 100644 index 9a5fd2d346..0000000000 --- a/anda/system/xpadneo/modules-load-d-xpadneo.conf +++ /dev/null @@ -1 +0,0 @@ -hid_xpadneo diff --git a/anda/system/xpadneo/update.rhai b/anda/system/xpadneo/update.rhai deleted file mode 100644 index 0a63919e92..0000000000 --- a/anda/system/xpadneo/update.rhai +++ /dev/null @@ -1 +0,0 @@ -rpm.version(gh("atar-axis/xpadneo")); diff --git a/anda/system/xpadneo/xpadneo.spec b/anda/system/xpadneo/xpadneo.spec deleted file mode 100644 index cb50fdef4b..0000000000 --- a/anda/system/xpadneo/xpadneo.spec +++ /dev/null @@ -1,103 +0,0 @@ -%if 0%{?fedora} -%global buildforkernels akmod -%global debug_package %{nil} -%endif - -Name: xpadneo -Version: 0.9.7 -Release: 1%?dist -Summary: Advanced Linux Driver for Xbox One Wireless Gamepad -Group: System Environment/Kernel -License: GPL-3.0 -URL: https://github.com/atar-axis/xpadneo -Source0: %url/archive/v%version/%name-%version.tar.gz -Source1: modules-load-d-xpadneo.conf -Source2: io.github.xpadneo.metainfo.xml - -%global srcname hid-%name - -BuildRequires: gcc -BuildRequires: make -BuildRequires: kmodtool -BuildRequires: systemd-rpm-macros - -Requires: bash -Requires: bluez bluez-tools - -Provides: %{name}-kmod-common = %{version}-%{release} -Requires: %{name}-kmod >= %{version} -Obsoletes: %{name} < 0.9.1-2 - -# kmodtool does its magic here -%{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } - -%description -Advanced Linux Driver for Xbox One Wireless Controller - -%package kmod -Summary: Kernel module (kmod) for %{name} -Requires: kernel-devel - -%description kmod -This is the first driver for the Xbox One Wireless Gamepad (which is shipped with the Xbox One S). - -%prep -# error out if there was something wrong with kmodtool -%{?kmodtool_check} - -# print kmodtool output for debugging purposes: -kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null - -%setup -q - -for kernel_version in %{?kernel_versions} ; do - cp -a hid-xpadneo/src _kmod_build_${kernel_version%%___*} -done - -%build -for kernel_version in %{?kernel_versions} ; do - make V=1 %{?_smp_mflags} -C ${kernel_version##*___} M=${PWD}/_kmod_build_${kernel_version%%___*} VERSION=v%{version} modules -done - -%install -for kernel_version in %{?kernel_versions}; do - mkdir -p %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ - install -D -m 755 _kmod_build_${kernel_version%%___*}/hid-xpadneo.ko %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ - chmod a+x %{buildroot}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/*.ko -done -%{?akmod_install} - -install -Dm644 hid-xpadneo/etc-modprobe.d/xpadneo.conf %{buildroot}%{_modprobedir}/60-xpadneo.conf -install -Dm644 %{SOURCE1} %{buildroot}%{_modulesloaddir}/xpadneo.conf -install -Dm644 hid-xpadneo/etc-udev-rules.d/60-xpadneo.rules %{buildroot}%{_udevrulesdir}/60-xpadneo.rules -install -Dm644 %{SOURCE2} %{buildroot}%{_datadir}/metainfo/io.github.xpadneo.metainfo.xml - -%files -%doc NEWS.md docs/README.md docs/CONFIGURATION.md -%license LICENSE -%{_modprobedir}/60-xpadneo.conf -%{_modulesloaddir}/xpadneo.conf -%{_udevrulesdir}/60-xpadneo.rules -%{_datadir}/metainfo/io.github.xpadneo.metainfo.xml - -%changelog -* Wed Oct 12 2022 Jan Drögehoff - 0.9.5-1 -- Update to 0.9.5 - -* Mon Jul 04 2022 Jan Drögehoff - 0.9.4-1 -- Update to 0.9.4 - -* Sun May 29 2022 Jan Drögehoff - 0.9.2-1 -- Update to 0.9.2 - -* Thu Jun 17 2021 Jan Drögehoff - 0.9.1-2 -- Move from DKMS to Akmods - -* Fri May 21 2021 Jan Drögehoff - 0.9.1-1 -- Update to 0.9.1 - -* Mon Dec 28 21:58:05 CET 2020 Jan Drögehoff - 0.9-2 -- remove configure script - -* Mon Dec 28 21:01:47 CET 2020 Jan Drögehoff - 0.9-1 -- Initial Spec