diff --git a/kernel_module/lenovolegionlinux-dkms-mkrpm.spec b/kernel_module/lenovolegionlinux-dkms-mkrpm.spec deleted file mode 100644 index 4f37461..0000000 --- a/kernel_module/lenovolegionlinux-dkms-mkrpm.spec +++ /dev/null @@ -1,79 +0,0 @@ -%{?!module_name: %{error: You did not specify a module name (%%module_name)}} -%{?!version: %{error: You did not specify a module version (%%version)}} -%{?!kernel_versions: %{error: You did not specify kernel versions (%%kernel_version)}} -%{?!packager: %define packager DKMS } -%{?!license: %define license Unknown} -%{?!_dkmsdir: %define _dkmsdir /var/lib/dkms} -%{?!_srcdir: %define _srcdir %_prefix/src} -%{?!_datarootdir: %define _datarootdir %{_datadir}} - -Summary: %{module_name} %{version} dkms package -Name: %{module_name} -Version: %{version} -License: %license -Release: 1dkms -BuildArch: x86_64 -Group: System/Kernel -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root/ - -%description -DKMS Kernel modules for %{module_name}. - -%prep -if [ "%mktarball_line" != "none" ]; then - /usr/sbin/dkms mktarball -m %module_name -v %version %mktarball_line --archive `basename %{module_name}-%{version}.dkms.tar.gz` - cp -af %{_dkmsdir}/%{module_name}/%{version}/tarball/`basename %{module_name}-%{version}.dkms.tar.gz` %{module_name}-%{version}.dkms.tar.gz -fi - -%install -if [ "$RPM_BUILD_ROOT" != "/" ]; then - rm -rf $RPM_BUILD_ROOT -fi -mkdir -p $RPM_BUILD_ROOT/%{_srcdir} -mkdir -p $RPM_BUILD_ROOT/%{_datarootdir}/%{module_name} - -if [ -d %{_sourcedir}/%{module_name}-%{version} ]; then - cp -Lpr %{_sourcedir}/%{module_name}-%{version} $RPM_BUILD_ROOT/%{_srcdir} -fi - -if [ -f %{module_name}-%{version}.dkms.tar.gz ]; then - install -m 644 %{module_name}-%{version}.dkms.tar.gz $RPM_BUILD_ROOT/%{_datarootdir}/%{module_name} -fi - -if [ -f %{_sourcedir}/common.postinst ]; then - install -m 755 %{_sourcedir}/common.postinst $RPM_BUILD_ROOT/%{_datarootdir}/%{module_name}/postinst -fi - -%clean -if [ "$RPM_BUILD_ROOT" != "/" ]; then - rm -rf $RPM_BUILD_ROOT -fi - -%post -for POSTINST in %{_prefix}/lib/dkms/common.postinst %{_datarootdir}/%{module_name}/postinst; do - if [ -f $POSTINST ]; then - $POSTINST %{module_name} %{version} %{_datarootdir}/%{module_name} - exit $? - fi - echo "WARNING: $POSTINST does not exist." -done -echo -e "ERROR: DKMS version is too old and %{module_name} was not" -echo -e "built with legacy DKMS support." -echo -e "You must either rebuild %{module_name} with legacy postinst" -echo -e "support or upgrade DKMS to a more current version." -exit 1 - -%preun -echo -e -echo -e "Uninstall of %{module_name} module (version %{version}) beginning:" -dkms remove -m %{module_name} -v %{version} --all --rpm_safe_upgrade -exit 0 - -%files -%defattr(-,root,root) -%{_srcdir} -%{_datarootdir}/%{module_name}/ - -%changelog -* %(date "+%a %b %d %Y") %packager %{version}-%{release} -- Automatic build by DKMS diff --git a/kernel_module/lenovolegionlinux.spec b/kernel_module/lenovolegionlinux.spec index 5347c22..91a5156 100644 --- a/kernel_module/lenovolegionlinux.spec +++ b/kernel_module/lenovolegionlinux.spec @@ -1,9 +1,3 @@ -# -# lenovolegionlinux.spec -# Sample KMP spec file -# - -# Following line included for SUSE "build" command; does not affect "rpmbuild" # norootforbuild Name: LenovoLegionLinux @@ -15,11 +9,16 @@ Release: 0 Source0: %name-%version.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build -%kernel_module_package - %description Driver for controlling Lenovo Legion laptops including fan control and power mode. +%package KMP +Summary: LenovoLegionLinux Kernel Module +Group: System/Kernel + +%description KMP +This is one of the subpackages require for LenovoLegionLinux [kernel module/driver] + %prep %setup set -- * @@ -31,15 +30,14 @@ mkdir obj for flavor in %flavors_to_build; do rm -rf obj/$flavor cp -r source obj/$flavor - make -C %{kernel_source $flavor} modules M=$PWD/obj/$flavor + make -C /usr/src/linux/%_target_cpu/$flavor M=$PWD/obj/$flavor done %install export INSTALL_MOD_PATH=$RPM_BUILD_ROOT -# Following line works for SUSE 11+ and RHEL 6.1+ only, must set INSTALL_MOD_DIR manually for other targets -export INSTALL_MOD_DIR=%kernel_module_package_moddir %{name} +export INSTALL_MOD_DIR=updates for flavor in %flavors_to_build; do - make -C %{kernel_source $flavor} install M=$PWD/obj/$flavor + make -C /usr/src/linux/%_target_cpu/$flavor install M=$PWD/obj/$flavor done %clean