mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 09:01:55 +00:00
refactor(xpadneo, xone): Fix potential installation issues and improve UX (#3785)
* Kmod-common subpackaging and more * Update xpadneo.spec Signed-off-by: Gilver <rockgrub@disroot.org> * Shouldn't need to be Mock Signed-off-by: Gilver <rockgrub@disroot.org> * Shouldn't need to be Mock either Signed-off-by: Gilver <rockgrub@disroot.org> * Make this dep on the thing it needs to work please Signed-off-by: Gilver <rockgrub@disroot.org> * NOT THAT Signed-off-by: Gilver <rockgrub@disroot.org> * THIS one Signed-off-by: Gilver <rockgrub@disroot.org> * Requires Signed-off-by: Gilver <rockgrub@disroot.org> * Conflicts Signed-off-by: Gilver <rockgrub@disroot.org> * Deps Signed-off-by: Gilver <rockgrub@disroot.org> * More deps Signed-off-by: Gilver <rockgrub@disroot.org> * ? Signed-off-by: Gilver <rockgrub@disroot.org> * ?? Signed-off-by: Gilver <rockgrub@disroot.org> * Ah Signed-off-by: Gilver <rockgrub@disroot.org> * Wheeee Signed-off-by: Gilver <rockgrub@disroot.org> * Better... Signed-off-by: Gilver <rockgrub@disroot.org> * Yeeeahhh Signed-off-by: Gilver <rockgrub@disroot.org> * Update dkms-xpadneo.spec Signed-off-by: Gilver <rockgrub@disroot.org> * Update xpadneo-kmod.spec Signed-off-by: Gilver <rockgrub@disroot.org> * Fixup those deps * Fix update scripts * Macrooooo --------- Signed-off-by: Gilver <rockgrub@disroot.org>
This commit is contained in:
@@ -4,6 +4,5 @@ project pkg {
|
||||
}
|
||||
labels {
|
||||
mock = 1
|
||||
updbranch = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
let c = sh("cat anda/system/xone/kmod-common/xone-kmod-common.spec | grep '%global commit' | sed -E 's/.+commit //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
let c = sh("cat anda/system/xone/kmod-common/xone.spec | grep '%global commit' | sed -E 's/.+commit //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
c.pop();
|
||||
rpm.global("commit", c);
|
||||
if rpm.changed() {
|
||||
rpm.release();
|
||||
let d = sh("cat anda/system/xone/kmod-common/xone-kmod-common.spec | grep '%global date' | sed -E 's/.+date //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
let d = sh("cat anda/system/xone/kmod-common/xone.spec | grep '%global commit_date' | sed -E 's/.+commit_date //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
d.pop();
|
||||
rpm.global("date", d);
|
||||
let v = sh("cat anda/system/xone/kmod-common/xone-kmod-common.spec | grep '%global ver' | sed -E 's/.+ver //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
rpm.global("commit_date", d);
|
||||
let v = sh("cat anda/system/xone/kmod-common/xone.spec | grep '%global ver' | sed -E 's/.+ver //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
v.pop();
|
||||
rpm.global("ver", v);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,24 @@
|
||||
%global commit 6b9d59aed71f6de543c481c33df4705d4a590a31
|
||||
%global date 20241223
|
||||
%global commit_date 20241223
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global ver 0.3
|
||||
%define buildforkernels akmod
|
||||
%global debug_package %{nil}
|
||||
%global real_name xone
|
||||
%global modulename xone
|
||||
|
||||
Name: %{real_name}-kmod
|
||||
Version: %{ver}^%{date}git.%{shortcommit}
|
||||
Name: %{modulename}-kmod
|
||||
Version: %{ver}^%{commit_date}git.%{shortcommit}
|
||||
Release: 1%?dist
|
||||
Summary: Linux kernel driver for Xbox One and Xbox Series X|S accessories
|
||||
License: GPL-2.0-or-later
|
||||
URL: https://github.com/dlundqvist/xone
|
||||
Source0: %{url}/archive/%{commit}.tar.gz#/xone-%{shortcommit}.tar.gz
|
||||
Source0: %{url}/archive/%{commit}.tar.gz#/%{modulename}-%{shortcommit}.tar.gz
|
||||
BuildRequires: kmodtool
|
||||
BuildRequires: systemd-rpm-macros
|
||||
Requires: %{real_name}-kmod-common = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: %{modulename} = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: %{modulename}-akmod-modules = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: akmods
|
||||
Conflicts: dkms-%{modulename}
|
||||
Packager: Gilver E. <rockgrub@disroot.org>
|
||||
|
||||
%{expand:%(kmodtool --target %{_target_cpu} --repo terra --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
|
||||
@@ -27,9 +30,7 @@ Linux kernel driver for Xbox One and Xbox Series X|S accessories.
|
||||
%{?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}' dkms.conf > %{real_name}.conf
|
||||
%autosetup -p1 -n %{modulename}-%{commit}
|
||||
|
||||
find . -type f -name '*.c' -exec sed -i "s/#VERSION#/%{version}/" {} \;
|
||||
|
||||
@@ -46,8 +47,6 @@ for kernel_version in %{?kernel_versions}; do
|
||||
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 \
|
||||
@@ -55,9 +54,6 @@ for kernel_version in %{?kernel_versions}; do
|
||||
done
|
||||
%{?akmod_install}
|
||||
|
||||
%files
|
||||
%{_modulesloaddir}/%{real_name}.conf
|
||||
|
||||
%changelog
|
||||
* Thu Feb 27 2025 Gilver E. <rockgrub@disroot.org>
|
||||
- Initial package
|
||||
|
||||
@@ -5,6 +5,5 @@ project pkg {
|
||||
}
|
||||
labels {
|
||||
mock = 1
|
||||
updbranch = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
%global commit 6b9d59aed71f6de543c481c33df4705d4a590a31
|
||||
%global date 20241223
|
||||
%global commit_date 20241223
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global ver 0.3
|
||||
%global debug_package %{nil}
|
||||
%global dkms_name xone
|
||||
%global modulename xone
|
||||
|
||||
Name: dkms-%{dkms_name}
|
||||
Version: %{ver}^%{date}git.%{shortcommit}
|
||||
Name: dkms-%{modulename}
|
||||
Version: %{ver}^%{commit_date}git.%{shortcommit}
|
||||
Release: 1%?dist
|
||||
Summary: Linux kernel driver for Xbox One and Xbox Series X|S accessories
|
||||
License: GPL-2.0-or-later
|
||||
URL: https://github.com/dlundqvist/xone
|
||||
Source0: %{url}/archive/%{commit}.tar.gz#/%{dkms_name}-%{shortcommit}.tar.gz
|
||||
Source1: dkms-no-weak-modules.conf
|
||||
Source0: %{url}/archive/%{commit}.tar.gz#/%{modulename}-%{shortcommit}.tar.gz
|
||||
Source1: no-weak-modules.conf
|
||||
BuildRequires: sed
|
||||
BuildRequires: systemd-rpm-macros
|
||||
Requires: %{dkms_name}-kmod-common = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: %{modulename} = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: dkms
|
||||
Conflicts: akmod-%{modulename}
|
||||
BuildArch: noarch
|
||||
Packager: Gilver E. <rockgrub@disroot.org>
|
||||
|
||||
@@ -24,7 +25,7 @@ Packager: Gilver E. <rockgrub@disroot.org>
|
||||
Linux kernel driver for Xbox One and Xbox Series X|S accessories.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{dkms_name}-%{commit}
|
||||
%autosetup -p1 -n %{modulename}-%{commit}
|
||||
|
||||
sed -i \
|
||||
-e 's|#VERSION#|%{version}|g' \
|
||||
@@ -35,28 +36,28 @@ find . -type f -name '*.c' -exec sed -i "s/#VERSION#/%{version}/" {} \;
|
||||
|
||||
%install
|
||||
# Create empty tree:
|
||||
mkdir -p %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/
|
||||
cp -fr auth bus driver transport Kbuild dkms.conf %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/
|
||||
mkdir -p %{buildroot}%{_usrsrc}/%{modulename}-%{version}/
|
||||
cp -fr auth bus driver transport Kbuild dkms.conf %{buildroot}%{_usrsrc}/%{modulename}-%{version}/
|
||||
|
||||
%if 0%{?fedora}
|
||||
# Do not enable weak modules support in Fedora (no kABI):
|
||||
install -Dpm644 %{SOURCE1} %{buildroot}%{_sysconfdir}/dkms/%{dkms_name}.conf
|
||||
install -Dpm644 %{SOURCE1} %{buildroot}%{_sysconfdir}/dkms/%{modulename}.conf
|
||||
%endif
|
||||
|
||||
%post
|
||||
dkms add -m %{dkms_name} -v %{version} -q --rpm_safe_upgrade || :
|
||||
dkms add -m %{modulename} -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 || :
|
||||
dkms build -m %{modulename} -v %{version} -q || :
|
||||
dkms install -m %{modulename} -v %{version} -q --force || :
|
||||
|
||||
%preun
|
||||
# Remove all versions from DKMS registry:
|
||||
dkms remove -m %{dkms_name} -v %{version} -q --all --rpm_safe_upgrade || :
|
||||
dkms remove -m %{modulename} -v %{version} -q --all --rpm_safe_upgrade || :
|
||||
|
||||
%files
|
||||
%{_usrsrc}/%{dkms_name}-%{version}
|
||||
%{_usrsrc}/%{modulename}-%{version}
|
||||
%if 0%{?fedora}
|
||||
%{_sysconfdir}/dkms/%{dkms_name}.conf
|
||||
%{_sysconfdir}/dkms/%{modulename}.conf
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
let c = sh("cat anda/system/xone/kmod-common/xone-kmod-common.spec | grep '%global commit' | sed -E 's/.+commit //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
let c = sh("cat anda/system/xone/kmod-common/xone.spec | grep '%global commit' | sed -E 's/.+commit //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
c.pop();
|
||||
rpm.global("commit", c);
|
||||
if rpm.changed() {
|
||||
rpm.release();
|
||||
let d = sh("cat anda/system/xone/kmod-common/xone-kmod-common.spec | grep '%global date' | sed -E 's/.+date //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
let d = sh("cat anda/system/xone/kmod-common/xone.spec | grep '%global commit_date' | sed -E 's/.+commit_date //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
d.pop();
|
||||
rpm.global("date", d);
|
||||
let v = sh("cat anda/system/xone/kmod-common/xone-kmod-common.spec | grep '%global ver' | sed -E 's/.+ver //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
rpm.global("commit_date", d);
|
||||
let v = sh("cat anda/system/xone/kmod-common/xone.spec | grep '%global ver' | sed -E 's/.+ver //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
v.pop();
|
||||
rpm.global("ver", v);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
project pkg {
|
||||
arches = ["x86_64"]
|
||||
rpm {
|
||||
spec = "xone-kmod-common.spec"
|
||||
spec = "xone.spec"
|
||||
}
|
||||
labels {
|
||||
mock = 1
|
||||
nightly = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
rpm.global("commit", gh_commit("dlundqvist/xone"));
|
||||
if rpm.changed() {
|
||||
rpm.release();
|
||||
rpm.global("date", date());
|
||||
rpm.global("commit_date", date());
|
||||
let ver = gh_tag("dlundqvist/xone");
|
||||
ver.crop(1);
|
||||
rpm.global("ver", ver);
|
||||
|
||||
+42
-20
@@ -1,14 +1,13 @@
|
||||
%global commit 6b9d59aed71f6de543c481c33df4705d4a590a31
|
||||
%global date 20241223
|
||||
%global commit_date 20241223
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global ver 0.3
|
||||
%global real_name xone
|
||||
%global _dracutconfdir %{_prefix}/lib/dracut/dracut.conf.d
|
||||
%global firmware_hash 48084d9fa53b9bb04358f3bb127b7495dc8f7bb0b3ca1437bd24ef2b6eabdf66
|
||||
|
||||
Name: %{real_name}-kmod-common
|
||||
Version: %{ver}^%{date}git.%{shortcommit}
|
||||
Release: 1%{?dist}
|
||||
Name: xone
|
||||
Version: %{ver}^%{commit_date}git.%{shortcommit}
|
||||
Release: 2%{?dist}
|
||||
Summary: Linux kernel driver for Xbox One and Xbox Series X|S accessories common files
|
||||
License: GPL-2.0-or-later
|
||||
URL: https://github.com/dlundqvist/xone
|
||||
@@ -19,30 +18,44 @@ Source2: http://download.windowsupdate.com/c/msdownload/update/driver/drv
|
||||
### Microsoft TOU copy:
|
||||
Source3: https://www.microsoft.com/en-us/legal/terms-of-use
|
||||
BuildRequires: cabextract
|
||||
BuildRequires: sed
|
||||
BuildRequires: systemd-rpm-macros
|
||||
Requires: wireless-regdb
|
||||
Requires: %{real_name}-firmware = 1.0.46.1
|
||||
Requires: %{name}-firmware = 1.0.46.1
|
||||
Requires: (akmod-%{name} = %{?epoch:%{epoch}:}%{version} or dkms-%{name} = %{?epoch:%{epoch}:}%{version})
|
||||
Requires(post): dracut
|
||||
Provides: %{real_name}-kmod-common = %{?epoch:%{epoch}:}%{version}
|
||||
Provides: %{name}-kmod-common = %{?epoch:%{epoch}:}%{version}
|
||||
Obsoletes: %{name}-kmod-common < %{?epoch:%{epoch}:}%{version}-2%{?dist}
|
||||
Conflicts: xow <= 0.5
|
||||
Obsoletes: xow <= 0.5
|
||||
BuildArch: noarch
|
||||
Packager: Gilver E. <rockgrub@disroot.org>
|
||||
|
||||
%description
|
||||
Linux kernel driver for Xbox One and Xbox Series X|S accessories common files.
|
||||
|
||||
%package -n %{real_name}-firmware
|
||||
Version: 1.0.46.1
|
||||
Summary: Firmware for the XBox One controller dongle
|
||||
License: Proprietary
|
||||
Requires: wireless-regdb
|
||||
%package akmod-modules
|
||||
Summary: Modules for Akmods
|
||||
Requires: akmod-%{name}
|
||||
BuildArch: noarch
|
||||
|
||||
%description -n %{real_name}-firmware
|
||||
%description akmod-modules
|
||||
Akmods modules for the akmod-%{name} package.
|
||||
|
||||
%package firmware
|
||||
Version: 1.0.46.1
|
||||
Summary: Firmware for the XBox One controller dongle
|
||||
License: Proprietary
|
||||
Requires: wireless-regdb
|
||||
BuildArch: noarch
|
||||
|
||||
%description firmware
|
||||
Proprietary firmware for XBox controller dongles.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n xone-%{commit}
|
||||
%autosetup -p1 -n %{name}-%{commit}
|
||||
/usr/bin/cp %{SOURCE3} .
|
||||
/usr/bin/sed -nE '/^BUILT_MODULE_NAME/{s@^.+"(.+)"@\1@; s|-|_|g; p}' dkms.conf > %{name}.conf
|
||||
|
||||
# Firmware:
|
||||
cabextract -F FW_ACC_00U.bin %{SOURCE2}
|
||||
@@ -51,28 +64,37 @@ echo %{firmware_hash} FW_ACC_00U.bin | sha256sum -c
|
||||
%install
|
||||
# xone-gip-headset module should have the snd-pcm and snd-seq modules be preloaded or it will give errors on boot due to injecting late.
|
||||
# It still loads afterwards, but this error is easily fixable by just loading the modules in the initramfs.
|
||||
install -Dpm644 %{SOURCE1} %{buildroot}%{_dracutconfdir}/60-xone-snd.conf
|
||||
install -Dpm644 %{SOURCE1} %{buildroot}%{_dracutconfdir}/60-%{name}-snd.conf
|
||||
|
||||
# Blacklist:
|
||||
install -Dpm644 install/modprobe.conf %{buildroot}%{_modprobedir}/60-%{real_name}.conf
|
||||
install -Dpm644 install/modprobe.conf %{buildroot}%{_modprobedir}/60-%{name}.conf
|
||||
|
||||
# Firmware:
|
||||
install -Dpm644 FW_ACC_00U.bin %{buildroot}%{_prefix}/lib/firmware/xow_dongle.bin
|
||||
|
||||
# Akmods modules
|
||||
install -Dm644 %{name}.conf -t %{buildroot}%{_modulesloaddir}
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc README.md
|
||||
%{_modprobedir}/60-%{real_name}.conf
|
||||
%{_dracutconfdir}/60-%{real_name}-snd.conf
|
||||
%{_modprobedir}/60-%{name}.conf
|
||||
%{_dracutconfdir}/60-%{name}-snd.conf
|
||||
|
||||
%files -n xone-firmware
|
||||
%files akmod-modules
|
||||
%{_modulesloaddir}/%{name}.conf
|
||||
|
||||
%files firmware
|
||||
%license terms-of-use
|
||||
%{_prefix}/lib/firmware/xow_dongle.bin
|
||||
|
||||
%post
|
||||
/usr/bin/dracut -f
|
||||
|
||||
%post -n xone-firmware
|
||||
%postun
|
||||
/usr/bin/dracut -f
|
||||
|
||||
%post firmware
|
||||
echo "The firmware for the wireless dongle is subject to Microsoft's Terms of Use:"
|
||||
echo 'https://www.microsoft.com/en-us/legal/terms-of-use'
|
||||
|
||||
@@ -4,6 +4,5 @@ project pkg {
|
||||
}
|
||||
labels {
|
||||
mock = 1
|
||||
updbranch = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
let c = sh("cat anda/system/xpadneo/kmod-common/xpadneo-kmod-common.spec | grep '%global commit' | sed -E 's/.+commit //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
let c = sh("cat anda/system/xpadneo/kmod-common/xpadneo.spec | grep '%global commit' | sed -E 's/.+commit //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
c.pop();
|
||||
rpm.global("commit", c);
|
||||
if rpm.changed() {
|
||||
rpm.release();
|
||||
let d = sh("cat anda/system/xpadneo/kmod-common/xpadneo-kmod-common.spec | grep '%global date' | sed -E 's/.+date //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
let d = sh("cat anda/system/xpadneo/kmod-common/xpadneo.spec | grep '%global commit_date' | sed -E 's/.+commit_date //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
d.pop();
|
||||
rpm.global("date", d);
|
||||
let v = sh("cat anda/system/xpadneo/kmod-common/xpadneo-kmod-common.spec | grep '%global ver' | sed -E 's/.+ver //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
rpm.global("commit_date", d);
|
||||
let v = sh("cat anda/system/xpadneo/kmod-common/xpadneo.spec | grep '%global ver' | sed -E 's/.+ver //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
v.pop();
|
||||
rpm.global("ver", v);
|
||||
}
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
%global commit 8d20a23e38883f45c78f48c8574ac93945b4cb03
|
||||
%global date 20241224
|
||||
%global commit_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
|
||||
%global modulename xpadneo
|
||||
|
||||
Name: %{real_name}-kmod
|
||||
Version: %{ver}^%{date}git.%{shortcommit}
|
||||
Release: 1%?dist
|
||||
Name: %{modulename}-kmod
|
||||
Version: %{ver}^%{commit_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: akmods
|
||||
Requires: bluez
|
||||
Requires: bluez-tools
|
||||
Requires: %{real_name}-kmod-common = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: %{modulename} = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: %{modulename}-akmod-modules = %{?epoch:%{epoch}:}%{version}
|
||||
Conflicts: dkms-%{modulename}
|
||||
Packager: Gilver E. <rockgrub@disroot.org>
|
||||
|
||||
%{expand:%(kmodtool --target %{_target_cpu} --repo terra --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
|
||||
@@ -29,9 +32,7 @@ Advanced Linux Driver for Xbox One Wireless Gamepad.
|
||||
%{?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
|
||||
%autosetup -p1 -n %{modulename}-%{commit}
|
||||
|
||||
for kernel_version in %{?kernel_versions}; do
|
||||
mkdir _kmod_build_${kernel_version%%___*}
|
||||
@@ -46,8 +47,6 @@ for kernel_version in %{?kernel_versions}; do
|
||||
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 \
|
||||
@@ -55,9 +54,6 @@ for kernel_version in %{?kernel_versions}; do
|
||||
done
|
||||
%{?akmod_install}
|
||||
|
||||
%files
|
||||
%{_modulesloaddir}/%{real_name}.conf
|
||||
|
||||
%changelog
|
||||
* Thu Feb 27 2025 Gilver E. <rockgrub@disroot.org>
|
||||
- Package refactoring for alternative DKMS package compatibility
|
||||
|
||||
@@ -5,6 +5,5 @@ project pkg {
|
||||
}
|
||||
labels {
|
||||
mock = 1
|
||||
updbranch = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
%global commit 8d20a23e38883f45c78f48c8574ac93945b4cb03
|
||||
%global date 20241224
|
||||
%global commit_date 20241224
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global ver 0.9.7
|
||||
%global debug_package %{nil}
|
||||
%global dkms_name xpadneo
|
||||
%global modulename xpadneo
|
||||
|
||||
Name: dkms-%{dkms_name}
|
||||
Version: %{ver}^%{date}git.%{shortcommit}
|
||||
Name: dkms-%{modulename}
|
||||
Version: %{ver}^%{commit_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
|
||||
URL: https://atar-axis.github.io/%{modulename}
|
||||
Source0: https://github.com/atar-axis/%{modulename}/archive/%{commit}.tar.gz#/%{modulename}-%{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: %{modulename} = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: dkms
|
||||
Conflicts: akmod-%{modulename}
|
||||
BuildArch: noarch
|
||||
Packager: Gilver E. <rockgrub@disroot.org>
|
||||
|
||||
@@ -26,7 +27,7 @@ Packager: Gilver E. <rockgrub@disroot.org>
|
||||
Advanced Linux Driver for Xbox One Wireless Gamepad.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{dkms_name}-%{commit}
|
||||
%autosetup -p1 -n %{modulename}-%{commit}
|
||||
|
||||
|
||||
cp -f %{SOURCE1} hid-xpadneo/src/dkms.conf
|
||||
@@ -38,28 +39,28 @@ sed -i -e 's/$(VERSION)/v%{version}/g' hid-xpadneo/src/Makefile
|
||||
|
||||
%install
|
||||
# Create empty tree:
|
||||
mkdir -p %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/
|
||||
cp -fr hid-xpadneo/src/* %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/
|
||||
mkdir -p %{buildroot}%{_usrsrc}/%{modulename}-%{version}/
|
||||
cp -fr hid-xpadneo/src/* %{buildroot}%{_usrsrc}/%{modulename}-%{version}/
|
||||
|
||||
%if 0%{?fedora}
|
||||
# Do not enable weak modules support in Fedora (no kABI):
|
||||
install -Dpm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/dkms/%{dkms_name}.conf
|
||||
install -Dpm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/dkms/%{modulename}.conf
|
||||
%endif
|
||||
|
||||
%post
|
||||
dkms add -m %{dkms_name} -v %{version} -q --rpm_safe_upgrade || :
|
||||
dkms add -m %{modulename} -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 || :
|
||||
dkms build -m %{modulename} -v %{version} -q || :
|
||||
dkms install -m %{modulename} -v %{version} -q --force || :
|
||||
|
||||
%preun
|
||||
# Remove all versions from DKMS registry:
|
||||
dkms remove -m %{dkms_name} -v %{version} -q --all --rpm_safe_upgrade || :
|
||||
dkms remove -m %{modulename} -v %{version} -q --all --rpm_safe_upgrade || :
|
||||
|
||||
%files
|
||||
%{_usrsrc}/%{dkms_name}-%{version}
|
||||
%{_usrsrc}/%{modulename}-%{version}
|
||||
%if 0%{?fedora}
|
||||
%{_sysconfdir}/dkms/%{dkms_name}.conf
|
||||
%{_sysconfdir}/dkms/%{modulename}.conf
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
let c = sh("cat anda/system/xpadneo/kmod-common/xpadneo-kmod-common.spec | grep '%global commit' | sed -E 's/.+commit //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
let c = sh("cat anda/system/xpadneo/kmod-common/xpadneo.spec | grep '%global commit' | sed -E 's/.+commit //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
c.pop();
|
||||
rpm.global("commit", c);
|
||||
if rpm.changed() {
|
||||
rpm.release();
|
||||
let d = sh("cat anda/system/xpadneo/kmod-common/xpadneo-kmod-common.spec | grep '%global date' | sed -E 's/.+date //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
let d = sh("cat anda/system/xpadneo/kmod-common/xpadneo.spec | grep '%global commit_date' | sed -E 's/.+commit_date //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
d.pop();
|
||||
rpm.global("date", d);
|
||||
let v = sh("cat anda/system/xpadneo/kmod-common/xpadneo-kmod-common.spec | grep '%global ver' | sed -E 's/.+ver //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
rpm.global("commit_date", d);
|
||||
let v = sh("cat anda/system/xpadneo/kmod-common/xpadneo.spec | grep '%global ver' | sed -E 's/.+ver //'", #{"stdout": "piped"}).ctx.stdout;
|
||||
v.pop();
|
||||
rpm.global("ver", v);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
project pkg {
|
||||
arches = ["x86_64"]
|
||||
rpm {
|
||||
spec = "xpadneo-kmod-common.spec"
|
||||
spec = "xpadneo.spec"
|
||||
}
|
||||
labels {
|
||||
mock = 1
|
||||
nightly = 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
%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: 3%{?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}
|
||||
Obsoletes: %{real_name} < %{?epoch:%{epoch}:}%{version}
|
||||
BuildArch: noarch
|
||||
Packager: Gilver E. <rockgrub@disroot.org>
|
||||
|
||||
%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
|
||||
@@ -0,0 +1,63 @@
|
||||
%global commit 8d20a23e38883f45c78f48c8574ac93945b4cb03
|
||||
%global commit_date 20241224
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global ver 0.9.7
|
||||
|
||||
Name: xpadneo
|
||||
Version: %{ver}^%{commit_date}git.%{shortcommit}
|
||||
Release: 4%{?dist}
|
||||
Summary: Advanced Linux Driver for Xbox One Wireless Gamepad common files
|
||||
License: GPL-3.0
|
||||
URL: https://atar-axis.github.io/%{name}
|
||||
Source0: https://github.com/atar-axis/%{name}/archive/%{commit}.tar.gz#/%{name}-%{shortcommit}.tar.gz
|
||||
Source1: io.github.%{name}.metainfo.xml
|
||||
BuildRequires: sed
|
||||
BuildRequires: systemd-rpm-macros
|
||||
Requires: (akmod-%{name} = %{?epoch:%{epoch}:}%{version} or dkms-%{name} = %{?epoch:%{epoch}:}%{version})
|
||||
Provides: %{name}-kmod-common = %{?epoch:%{epoch}:}%{version}
|
||||
Obsoletes: %{name}-kmod-common < %{?epoch:%{epoch}:}%{version}-3%{?dist}
|
||||
BuildArch: noarch
|
||||
Packager: Gilver E. <rockgrub@disroot.org>
|
||||
|
||||
%description
|
||||
Advanced Linux Driver for Xbox One Wireless Gamepad common files.
|
||||
|
||||
%package akmod-modules
|
||||
Summary: Modules for Akmods
|
||||
Requires: akmod-%{name}
|
||||
BuildArch: noarch
|
||||
|
||||
%description akmod-modules
|
||||
Akmods modules for the akmod-%{name} package.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{name}-%{commit}
|
||||
/usr/bin/sed -nE '/^BUILT_MODULE_NAME/{s@^.+"(.+)"@\1@; s|-|_|g; p}' hid-%{name}/dkms.conf.in > %{name}.conf
|
||||
|
||||
%install
|
||||
# Aliases:
|
||||
install -Dpm644 hid-%{name}/etc-modprobe.d/%{name}.conf -t %{buildroot}%{_modprobedir}
|
||||
|
||||
# UDev rules:
|
||||
install -Dpm644 hid-%{name}/etc-udev-rules.d/*.rules -t %{buildroot}%{_udevrulesdir}/
|
||||
|
||||
# Metadata
|
||||
install -Dm644 %{SOURCE1} %{buildroot}%{_datadir}/metainfo/io.github.%{name}.metainfo.xml
|
||||
|
||||
# Akmods modules
|
||||
install -Dm644 %{name}.conf -t %{buildroot}%{_modulesloaddir}
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc docs/*.md
|
||||
%{_modprobedir}/%{name}.conf
|
||||
%{_udevrulesdir}/60-%{name}.rules
|
||||
%{_udevrulesdir}/70-%{name}-disable-hidraw.rules
|
||||
%{_datadir}/metainfo/io.github.%{name}.metainfo.xml
|
||||
|
||||
%files akmod-modules
|
||||
%{_modulesloaddir}/%{name}.conf
|
||||
|
||||
%changelog
|
||||
* Fri Mar 07 2025 Gilver E. <rockgrub@disroot.org>
|
||||
- Package refactoring
|
||||
Reference in New Issue
Block a user