mirror of
https://abf.rosa.ru/djam/auto-krokodil.git
synced 2025-02-23 18:42:58 +00:00

keleg@ noted that otherwise it may download and process dnf metadata and only then dnf will say that it is unable to install packages
169 lines
4.8 KiB
RPMSpec
169 lines
4.8 KiB
RPMSpec
Summary: Scripts to automate packaging and installation of proprietary drivers for Nvidia GPUs
|
|
Name: auto-krokodil
|
|
Group: System/Kernel and hardware
|
|
License: GPLv3
|
|
Url: https://abf.io/import/auto-krokodil
|
|
Version: 0.25
|
|
Release: 1
|
|
BuildArch: noarch
|
|
%ifarch %{ix86} %{x86_64}
|
|
# for php -l (syntax check)
|
|
BuildRequires: /usr/bin/php
|
|
%endif
|
|
|
|
# rpm generators
|
|
Source10: krokodil-rpm-provides.php
|
|
Source11: krokodilnvidia.attr
|
|
# rpm macros
|
|
Source12: macros.krokodil
|
|
Source13: auto-krokodil-rpmlint.conf
|
|
|
|
# Test data, to run tests:
|
|
# - build and install auto-krokodil-rpm-generators from this spec
|
|
# - install it
|
|
# - run: rpmbuild --define "_sourcedir $PWD" --define "_topdir $PWD" --define "_rpmdir $PWD" --define "_build_name_fmt %%{NAME}.rpm" -bb test.spec.in
|
|
# - run: rpm -qp --provides test-auto-krokodil-provides.rpm, check provides
|
|
# from nvidia470, licensed according to LICENSE.nvidia-json
|
|
Source21: test.nvidia470.json
|
|
# taken from nvidia 470.74/supported-gpus/LICENSE
|
|
Source22: LICENSE.nvidia-json
|
|
Source23: test.spec.in
|
|
Source24: test.kroko-cli.sh
|
|
|
|
Source31: krokodil-legacy-converter.php
|
|
Source32: kroko-cli.sh
|
|
|
|
%description
|
|
Scripts to automate packaging and installation of proprietary drivers for Nvidia GPUs
|
|
|
|
#----------------------------------------
|
|
|
|
%package filesystem
|
|
Summary: Filesystem skeleton for %{name}
|
|
|
|
%description filesystem
|
|
Filesystem skeleton for %{name}
|
|
|
|
%files filesystem
|
|
%dir %{_datadir}/auto-krokodil
|
|
# Directory to put supported-gpus.json as e.g. nvidia470.json
|
|
# inside nvidia470 package so that RPM generator could parse it
|
|
%dir %{_datadir}/auto-krokodil/drivers
|
|
# License for JSON files from Nvidia
|
|
%{_datadir}/auto-krokodil/drivers/LICENSE.nvidia-json
|
|
# Directory for binary kernel modules
|
|
# alternatives(8) manage symlinks from /lib/modules to here
|
|
%dir %{_datadir}/auto-krokodil/kmods
|
|
|
|
#----------------------------------------
|
|
|
|
%package rpm-generators
|
|
Summary: Generators of RPM provides for proprietary Nvidia drivers
|
|
Requires: /usr/bin/php
|
|
Requires: /bin/sh
|
|
|
|
%description rpm-generators
|
|
Generators of RPM provides for proprietary Nvidia drivers
|
|
|
|
%files rpm-generators
|
|
%{_bindir}/krokodil-rpm-provides
|
|
%{_fileattrsdir}/krokodilnvidia.attr
|
|
|
|
#----------------------------------------
|
|
|
|
%package rpm-macros
|
|
Summary: RPM macros for packaging of binary kernel modules for Nvidia drivers
|
|
Requires: coreutils
|
|
Requires: gawk
|
|
# pull rpmlint policy when installing BuildRequires
|
|
Requires: (%{name}-rpmlint if rpmlint)
|
|
|
|
%description rpm-macros
|
|
RPM macros for packaging of binary kernel modules for Nvidia drivers
|
|
|
|
%files rpm-macros
|
|
%{_rpmmacrodir}/*krokodil*
|
|
|
|
#----------------------------------------
|
|
|
|
%package rpmlint
|
|
Summary: rpmlint policy for krokodil-packaged kernel modules
|
|
Requires: rpmlint
|
|
|
|
%description rpmlint
|
|
rpmlint policy for krokodil-packaged kernel modules
|
|
|
|
%files rpmlint
|
|
%{_datadir}/rpmlint/config.d/auto-krokodil-rpmlint.conf
|
|
|
|
#----------------------------------------
|
|
|
|
%package legacy-converter
|
|
Summary: Convert JSON from newer Nvidia driver to an older one
|
|
Requires: /usr/bin/php
|
|
|
|
%description legacy-converter
|
|
Old Nvidia drivers do not have a JSON with supported models,
|
|
but JSONs of newer drivers specify GPUs supported by older drivers.
|
|
This scripts takes a JSON from a newer driver and converts it
|
|
into a JSON for an older driver which does not ship a native JSON.
|
|
|
|
%files legacy-converter
|
|
%{_bindir}/krokodil-legacy-converter
|
|
|
|
#----------------------------------------
|
|
|
|
%package cli
|
|
Summary: Automatically find and install NVIDIA GPU drivers (console program)
|
|
Requires: bash
|
|
Requires: dnf
|
|
Requires: gawk
|
|
Requires: rpm
|
|
Provides: kroko-cli = %{EVRD}
|
|
|
|
%description cli
|
|
Automatically find and install NVIDIA GPU drivers (console program)
|
|
|
|
%files cli
|
|
%{_bindir}/kroko-cli
|
|
%{_bindir}/%{name}-cli
|
|
|
|
#----------------------------------------
|
|
|
|
%prep
|
|
cp %sources .
|
|
|
|
%build
|
|
|
|
%install
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/auto-krokodil/drivers
|
|
mkdir -p %{buildroot}%{_datadir}/auto-krokodil/kmods
|
|
install -m0644 %{SOURCE22} %{buildroot}%{_datadir}/auto-krokodil/drivers/LICENSE.nvidia-json
|
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
install -m0755 %{SOURCE10} %{buildroot}%{_bindir}/krokodil-rpm-provides
|
|
mkdir -p %{buildroot}%{_fileattrsdir}
|
|
install -m0644 %{SOURCE11} %{buildroot}%{_fileattrsdir}/krokodilnvidia.attr
|
|
|
|
install -m0755 %{SOURCE31} %{buildroot}%{_bindir}/krokodil-legacy-converter
|
|
install -m0755 %{SOURCE32} %{buildroot}%{_bindir}/kroko-cli
|
|
ln -s kroko-cli %{buildroot}%{_bindir}/%{name}-cli
|
|
|
|
%install_macro krokodil %{SOURCE12}
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/rpmlint/config.d
|
|
install -m0644 %{SOURCE13} %{buildroot}%{_datadir}/rpmlint/config.d
|
|
|
|
%check
|
|
|
|
bash -x %{SOURCE24}
|
|
|
|
# check syntax
|
|
%ifarch %{ix86} %{x86_64} aarch64
|
|
/usr/bin/php -l %{buildroot}%{_bindir}/krokodil-rpm-provides
|
|
/usr/bin/php -l %{buildroot}%{_bindir}/krokodil-legacy-converter
|
|
|
|
# very basic check of the generator
|
|
FILE="%{SOURCE21}" EVR=888-777 %{buildroot}%{_bindir}/krokodil-rpm-provides | grep -q '^nvidia-blob-devid(1f9d) = 888-777$'
|
|
%endif
|