Fedora용 간단한 커널 모듈 acpi_call을 패키지하고 싶습니다. 이를 위해 나는 따랐다RPM Fusion에 대한 kmods2 지침다음 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
바라보다붙여넣기구문 강조 기능이 있는 버전의 경우.
컴파일되고 rpmbuild -ba acpi_call.spec
두 개의 파일이 생성됩니다.
akmod-acpi_call-1.1.0-1.fc24.x86_64.rpm
kmod-acpi_call-1.1.0-1.fc24.x86_64.rpm
다음을 사용하여 설치하려고 하면 패키지가 누락되어 dnf
설치할 수 없습니다 .-common
# 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)
나는 지금 여기에 갇혀 있다. -common
패키지가 생성되지 않았 으며 설치가 dnf
작동하지 않는 것 같습니다.
가방에 어떻게 넣을 수 있나요?
답변1
kmodtool에는 *-kmod-common
사양이 필요합니다. 이는 기본 사항만 다루는 매우 간단한 패키지일 수 있습니다.
%define modname yourmod
Name: %{modname}-kmod-common
Version: 1.0
Release: 1%{?dist}.1
Summary: Common files for your mod
Group: System Environment/Kernel
License: GPL
Source0: ${name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
좋은 예는 다음과 같습니다https://github.com/neatbasis/sunhme2g
빌드 rpmbuild
하면 모든 것을 패키징할 수 있습니다.createrepo