Eu quero empacotar um módulo de kernel simples, acpi_call, para o Fedora. Para isso, segui as instruções do kmods2 no RPM Fusion e obtive o seguinte arquivo SPEC:
# Copyright © 2016 Martin Ueding <[email protected]>
# A lot of boilerplate taken from
# http://rpmfusion.org/Packaging/KernelModules/Kmods2
#define buildforkernels newest
#define buildforkernels current
%define buildforkernels akmod
%define kmod_name acpi_call
%global debug_package %{nil}
Name: %{kmod_name}
Version: 1.1.0
Release: 1%{?dist}
Summary: Call ACPI methods by writing to /proc
License: GPL3+
Source0: https://github.com/mkottman/acpi_call/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires: %{_bindir}/kmodtool
Requires: %{name}-kmod >= %{version}
Provides: %{name}-kmod-common = %{version}
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i586 i686 x86_64 ppc ppc64
# get the proper build-sysbuild package from the repo, which
# tracks in all the kernel-devel packages
BuildRequires: %{_bindir}/kmodtool
%{!?kernels:BuildRequires: buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} }
# kmodtool does its magic here
%{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
%description
A kernel simple module that enables you to call ACPI methods by writing the
method name followed by arguments to /proc/acpi/call.
This module is to be considered a proof-of-concept and has been superseeded by
projects like bbswitch. It allows you to tamper with your system and should be
used with caution.
%prep
# error out if there was something wrong with kmodtool
%{?kmodtool_check}
%autosetup -n %{kmod_name}-%{version}
# print kmodtool output for debugging purposes:
kmodtool --target %{_target_cpu} --repo %{repo} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
for kernel_version in %{?kernel_versions} ; do
cp -a foo-%{version} _kmod_build_${kernel_version%%___*}
done
%build
for kernel_version in %{?kernel_versions}; do
make %{?_smp_mflags} -C "${kernel_version##*___}" SUBDIRS=${PWD}/_kmod_build_${kernel_version%%___*} modules
done
%install
rm -rf ${RPM_BUILD_ROOT}
for kernel_version in %{?kernel_versions}; do
make install DESTDIR=${RPM_BUILD_ROOT} KMODPATH=%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}
# install -D -m 755 _kmod_build_${kernel_version%%___*}/foo/foo.ko ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/foo.ko
done
%{?akmod_install}
%clean
rm -rf $RPM_BUILD_ROOT
%changelog
* Sat Jul 23 2016 Martin Ueding <[email protected]> 1.1.0-1
- Initial packaging
Veja este colar para obter uma versão com realce de sintaxe.
Ele compila com rpmbuild -ba acpi_call.spec
e eu recebo dois arquivos:
akmod-acpi_call-1.1.0-1.fc24.x86_64.rpm
kmod-acpi_call-1.1.0-1.fc24.x86_64.rpm
Quando tento instalá-los com dnf
, não consigo porque o pacote -common
está ausente:
# dnf install akmod-acpi_call-1.1.0-1.fc24.x86_64.rpm kmod-acpi_call-1.1.0-1.fc24.x86_64.rpm
Last metadata expiration check: 0:47:46 ago on Sat Jul 23 11:03:54 2016.
Error: nothing provides acpi_call-kmod-common >= 1.1.0 needed by akmod-acpi_call-1.1.0-1.fc24.x86_64.
nothing provides acpi_call-kmod-common >= 1.1.0 needed by akmod-acpi_call-1.1.0-1.fc24.x86_64
(try to add '--allowerasing' to command line to replace conflicting packages)
Agora estou preso aqui. Nenhum pacote -common
foi criado e instalar esses pacotes com dnf
parece não funcionar também.
Como posso colocar isso em um pacote?