# -*- Mode: rpm-spec -*- # # This Specfile is based on kernel-tmb spec done by # Thomas Backlund # # The mkflavour() macroization done by Anssi Hannula # # Note! remember to push kernel-userspace-headers and # the prebuilt kernel drivers (kmod-) # # Mageia kernels use kernel.org versioning # %define _binary_payload w7.gzdio #define _binary_payload w9.zstdio # --- Start of gcc optimizing block --- # Set to '1' the optimization flag according to the cpu you # want to achieve special compiler optimization for. Please note # that these options are not said to be mutually exclusive, so pay attention # at how you modify the flags to avoid overlapping. # # Set to 1 if you want to optimize for a Generic CPU %define use_gcc_generic 1 # Set to 1 if you want to optimized for the native (auto-detecting) CPU %define use_gcc_native 0 # Set to 1 if you want to optimize for the Skylake CPU family (have AVX2 SIMD) %define use_gcc_skylake 0 # Set to 1 if you want to optimize for the Haswell CPU family (have AVX2 SIMD) %define use_gcc_haswell 0 # Set to 1 if you want to optimize for the SandyBridge CPU family (have AVX SIMD) %define use_gcc_sandybridge 0 # Set to 1 if you want to optimize for the Westmere CPU family (no AVX SIMD) %define use_gcc_westmere 0 # Atom have in-order pipelining (most of other CPUs instead have # out-of-order pipelining) and thus can benefict from specific optimization. # Set to 1 here if you want to optimize for the Atom CPU %define use_gcc_atom 0 # Set to 1 if you want to further optimize with -O3 compiler flag %define use_gcc_harder_opt 0 %{?_with_gcc_generic: %global use_gcc_generic 1} %{?_without_gcc_generic: %global use_gcc_generic 0} %{?_with_gcc_native: %global use_gcc_native 1} %{?_without_gcc_native: %global use_gcc_native 0} %{?_with_gcc_skylake: %global use_gcc_skylake 1} %{?_without_gcc_skylake: %global use_gcc_skylake 0} %{?_with_gcc_haswell: %global use_gcc_haswell 1} %{?_without_gcc_haswell: %global use_gcc_haswell 0} %{?_with_gcc_sandybridge: %global use_gcc_sandybridge 1} %{?_without_gcc_sandybridge: %global use_gcc_sandybridge 0} %{?_with_gcc_westmere: %global use_gcc_westmere 1} %{?_without_gcc_westmere: %global use_gcc_westmere 0} %{?_with_gcc_atom: %global use_gcc_atom 1} %{?_without_gcc_atom: %global use_gcc_atom 0} %{?_with_gcc_harder_opt: %global use_gcc_harder_opt 1} %{?_without_gcc_harder_opt: %global use_gcc_harder_opt 0} # --- End of gcc optimizing block --- %define kernelversion 5 # WARNING: when patchlevel is bumped, please update drakx/kernel/list_modules.pm for new modules!!! %define patchlevel 1 # sublevel is now used for -stable patches %define sublevel 21 # extstable is for extended stable patches %define extstable 0 # Package release %define mgarel 18 # kernel Makefile extraversion is substituted by # kpatch/kgit which are either 0 (empty), rc (kpatch), git (kgit) %define kpatch 0 # kernel.org -gitX patch (only the number after "git") %define kgit 0 # Patch tarball tag %define ktag 51-joeghi # kernel base name (also name of srpm) %define kname kernel-%{ktag} %define rpmtag %{distsuffix}%{mgaver} %if %kpatch %if %kgit %define rpmrel %mkrel 0.%{kpatch}.%{kgit}.%{mgarel} %else %define rpmrel %mkrel 0.%{kpatch}.%{mgarel} %endif %else %define rpmrel %mkrel %{mgarel} %endif # fakerel and fakever never change, they are used to fool # rpm/urpmi/smart and ensure the kernels are installed, # not upgraded so old kernel is not overwritten or removed %define fakever 1 %define fakerel %mkrel 1 # version defines %if %extstable %define kversion %{kernelversion}.%{patchlevel}.%{sublevel}.%{extstable} %else %define kversion %{kernelversion}.%{patchlevel}.%{sublevel} %endif %define kverrel %{kversion}-%{rpmrel} # When we are using a pre/rc patch, the tarball is a sublevel -1 %if %kpatch %if %sublevel %define tar_ver %{kernelversion}.%{patchlevel} %else %define tar_ver %{kernelversion}.%(expr %{patchlevel} - 1) %endif %define patch_ver %{kversion}-%{kpatch}-%{ktag}%{mgarel} %else %define tar_ver %{kernelversion}.%{patchlevel} %define patch_ver %{kversion}-%{ktag}%{mgarel} %endif # Used for not making too long names for rpms or search paths %if %kpatch %if %kgit %define buildrpmrel 0.%{kpatch}.%{kgit}.%{mgarel}%{rpmtag} %else %define buildrpmrel 0.%{kpatch}.%{mgarel}%{rpmtag} %endif %else %define buildrpmrel %{mgarel}%{rpmtag} %endif %define buildrel %{kversion}-%{buildrpmrel} # Having different top level names for packges means that you have to remove # them by hard :( %define top_dir_name %{kname}-%{_arch} %define build_dir ${RPM_BUILD_DIR}/%{top_dir_name} %define src_dir %{build_dir}/linux-%{tar_ver} # Disable useless debug rpms... %global _enable_debug_packages %{nil} %global debug_package %{nil} %global __debug_package %{nil} %global __debug_install_post %{nil} %global _build_id_links none # no bytecompiling wanted as it breaks build on selftests we dont even ship # for older buildsystems %global _python_bytecompile_build 0 # for systems with >= rpm-mageia-setup-2.29-1.mga7 %global __brp_python_bytecompile %nil # Build defines %define build_doc 1 %define build_source 1 %define build_devel 1 %define build_debug 0 # Build desktop i586 / 4GB %ifarch %{ix86} %define build_desktop586 0 %endif # Build desktop (i686 / 4GB) / x86_64 %define build_desktop 1 # Build server (i686 / 64GB)/x86_64 / sparc64 sets %define build_server 0 # build perf and cpupower tools %define build_perf 0 %define build_cpupower 0 # bpf %define build_bpftool 0 %define build_libbpf 0 # compress modules with xz %define build_modxz 0 # ARM builds %ifarch %{arm} %define build_desktop 1 %ifarch armv5tl %define build_desktop_armv6v7 1 %endif %define build_server 0 # no cpupower tools on arm yet %define build_cpupower 0 # arm is currently not using xz %define build_modxz 0 %endif %ifarch aarch64 %define build_cpupower 0 %endif # End of user definitions # buildtime flags %{?_without_desktop586: %global build_desktop586 0} %{?_without_desktop: %global build_desktop 0} %{?_without_server: %global build_server 0} %{?_without_doc: %global build_doc 0} %{?_without_source: %global build_source 0} %{?_without_devel: %global build_devel 0} %{?_without_debug: %global build_debug 0} %{?_without_perf: %global build_perf 0} %{?_without_cpupower: %global build_cpupower 0} %{?_without_modxz: %global build_modxz 0} %{?_with_desktop586: %global build_desktop586 1} %{?_with_desktop: %global build_desktop 1} %{?_with_server: %global build_server 1} %{?_with_doc: %global build_doc 1} %{?_with_source: %global build_source 1} %{?_with_devel: %global build_devel 1} %{?_with_debug: %global build_debug 1} %{?_with_perf: %global build_perf 1} %{?_with_cpupower: %global build_cpupower 1} %{?_with_modxz: %global build_modxz 1} # For the .nosrc.rpm %define build_nosrc 0 %{?_with_nosrc: %global build_nosrc 1} %if %(if [ -z "$CC" ] ; then echo 0; else echo 1; fi) %define kmake %make_build CC="$CC" %else %define kmake %make_build %endif # there are places where parallel make don't work %define smake make # Parallelize xargs invocations on smp machines %define kxargs xargs %([ -z "$RPM_BUILD_NCPUS" ] \\\ && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\ [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-P $RPM_BUILD_NCPUS") # Sparc arch wants sparc64 kernels %define target_arch %(echo %{_arch} | sed -e 's/arm.*/arm/' -e 's/aarch64/arm64/') # # SRC RPM description # Summary: Linux kernel built for %vendor with extra modification by %{ktag} Name: %{kname} Version: %{kversion} Release: %{rpmrel} License: GPLv2 Group: System/Kernel and hardware ExclusiveArch: x86_64 ExclusiveOS: Linux URL: https://www.kernel.org #################################################################### # # Sources # ### This is for full SRC RPM Source0: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz Source1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.sign ### This is for stripped SRC RPM %if %build_nosrc NoSource: 0 %endif # This is for disabling *config, mrproper, prepare, scripts on -devel rpms Source2: disable-mrproper-prepare-scripts-configs-in-devel-rpms.patch Source4: README.kernel-%{ktag}-sources Source5: README.kernel-%{ktag}.md # config and systemd service file from fedora Source50: cpupower.service Source51: cpupower.config # our patch tarball Source100: linux-%{patch_ver}.tar.xz # from bootsplash patchset Source200: ajax-loader.gif #################################################################### # # Patches # # Patch0 to Patch100 are for core kernel upgrades. # # Pre linus patch: https://cdn.kernel.org/pub/linux/kernel/v3.0/testing %if %kpatch %if %sublevel Patch2: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/stable-review/patch-%{kversion}-%{kpatch}.xz %else Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/testing/patch-%{kernelversion}.%{patchlevel}-%{kpatch}.xz %endif %endif %if %kgit Patch2: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/snapshots/patch-%{kernelversion}.%{patchlevel}-%{kpatch}-git%{kgit}.xz %endif %if %sublevel %if %kpatch %define prev_sublevel %(expr %{sublevel} - 1) %if %prev_sublevel Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{prev_sublevel}.xz %endif %else Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{sublevel}.xz %endif %endif %if %extstable Patch3: patch-%{kernelversion}.%{patchlevel}.%{sublevel}.%{extstable}.patch %endif #END #################################################################### # Defines for the things that are needed for all the kernels # %define common_desc_kernel The kernel package contains the Linux kernel (vmlinuz), the core of your \ Mageia operating system. The kernel handles the basic functions \ of the operating system: memory allocation, process allocation, device \ input and output, etc.; this kernel is experimental and has an alternative CPU scheduler (called \ MuQSS) for low latency. %define common_desc_kernel_smp This kernel relies on in-kernel smp alternatives to switch between up & smp \ mode depending on detected hardware. To force the kernel to boot in single \ processor mode, use the "maxcpus=1" boot parameter. ### Global Requires/Provides %define requires1 bootloader-utils >= 1.16-1 %define requires2 dracut >= 038-21 %define requires3 kmod >= 12-2 %define requires4 sysfsutils >= 2.1.0-16 %define requires5 kernel-firmware >= 20170101-1 %define kprovides1 %{kname} = %{kverrel} %define kprovides2 kernel = %{tar_ver} %define kprovides3 alsa = 1.0.26 %define kprovides_server drbd-api = 88 # conflict dkms packages that dont support kernel-4.9 %define kconflicts1 dkms-broadcom-wl < 6.30.223.271-45 %define kconflicts2 dkms-fglrx <= 15.302 %define kconflicts3 dkms-nvidia-current < 375.39-1 %define kconflicts4 dkms-nvidia340 < 340.102-1 %define kconflicts5 dkms-nvidia304 < 304.135-1 %define kconflicts6 dkms-virtualbox < 5.1.10-3 %define kconflicts7 dkms-xtables-addons < 2.12-1 # not supported by x11-server-1.16 %define kconflicts8 dkms-nvidia173 <= 173.14.39 # (tmb) nvidia96xx does not support this kernel or x11-server-1.13 %define kconflicts9 dkms-nvidia96xx <= 96.43.23 # (tmb) conflict too old lvm2 rules to make upgrades work (tv, mga #9536) %define kconflicts10 lvm2 < 2.02.98-3 # (tmb) conflict too old drakxtools-backend to avoid bogus root=/dev/ (#9536) %define kconflicts11 drakxtools-backend < 15.37-1 # (tmb) conflict older btrfs-progs to get the new in same transaction and in initrd %define kconflicts12 btrfs-progs < 4.9-2 # (tmb) conflict too old plymouth (mga#15486) %define kconflicts13 plymouth < 0.8.6.1-13 # (tmb) conflict too old radeon-firmware to get the uvd firmwares in initrd %define kconflicts14 radeon-firmware < 20170101-1 # (tmb) conflict old firmware to get the firmwares in initrd %define kconflicts15 kernel-firmware-nonfree < 20170101-1 # (tmb) conflict old microcode to get updated ones in initrd for early loading %define kconflicts16 microcode < 0.20170707-1 # (tmb) conflict old theme to get mga5 theme in initrd %define kconflicts17 mageia-gfxboot-theme < 4.5.6.6-1 # (tmb) conflict too old grub2(-efi) %define kconflicts18 grub2 < 2.02-0.git9752.18 %define kconflicts19 grub2-efi < 2.02-0.git9752.18 # (tmb) conflict too old efibootmgr %define kconflicts20 efibootmgr < 0.11.0-7 # (tmb) conflict for vmmouse breakage (mga#16954) %define kconflicts21 x11-driver-input-vmmouse < 13.1.0-1 Autoreqprov: no BuildRequires: gcc >= 5.4.0-2 BuildRequires: binutils >= 1:2.24-0.20131016.1 BuildRequires: kmod >= 12-2 BuildRequires: bc BuildRequires: pigz # for crypto stuff BuildRequires: pkgconfig(openssl) # since 4.16 BuildRequires: bison BuildRequires: diffutils BuildRequires: flex # for cpupower %if %{build_cpupower} BuildRequires: pciutils-devel %endif BuildRequires: elfutils-devel BuildRequires: libunwind-devel # for perf %if %{build_perf} BuildRequires: audit-devel BuildRequires: binutils-devel BuildRequires: gtk2-devel BuildRequires: newt-devel BuildRequires: python-devel BuildRequires: zlib-devel BuildRequires: asciidoc BuildRequires: xmlto BuildRequires: perl-devel %ifarch %{ix86} x86_64 BuildRequires: numa-devel %endif %endif %description %common_desc_kernel %ifnarch %{arm} %common_desc_kernel_smp %endif # mkflavour() name flavour processor # name: the flavour name in the package name # flavour: first parameter of CreateKernel() %define mkflavour() \ %package -n %{kname}-%{1}-%{buildrel} \ Version: %{fakever} \ Release: %{fakerel} \ Provides: %kprovides1 %kprovides2 %kprovides3 \ %{expand:%%{?kprovides_%{1}:Provides: %{kprovides_%{1}}}} \ Provides: %{kname}-%{1} \ Requires(pre): %requires1 %requires2 %requires3 %requires4 \ Requires: %requires2 %requires5 \ Conflicts: %kconflicts1 %kconflicts2 %kconflicts3 \ Conflicts: %kconflicts4 %kconflicts5 %kconflicts6 \ Conflicts: %kconflicts7 %kconflicts8 %kconflicts9 \ Conflicts: %kconflicts10 %kconflicts11 %kconflicts12 \ Conflicts: %kconflicts13 %kconflicts14 %kconflicts15 \ Conflicts: %kconflicts16 %kconflicts17 %kconflicts18 \ Conflicts: %kconflicts19 %kconflicts20 %kconflicts21 \ Provides: should-restart = system \ Recommends: %{kname}-%{1}-latest \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ Summary: %{expand:%{summary_%(echo %{1} | sed -e "s/-/_/")}} \ Group: System/Kernel and hardware \ %description -n %{kname}-%{1}-%{buildrel} \ %common_desc_kernel %{expand:%{info_%(echo %{1} | sed -e "s/-/_/")}} \ %ifnarch %{arm} \ %common_desc_kernel_smp \ %endif \ \ %if %build_devel \ %package -n %{kname}-%{1}-devel-%{buildrel} \ Version: %{fakever} \ Release: %{fakerel} \ Requires: glibc-devel ncurses-devel make gcc perl \ Requires: gcc >= 5.4.0-1 \ %ifarch x86_64 \ Requires: pkgconfig(libelf) \ %endif \ Summary: The kernel-devel files for %{kname}-%{1}-%{buildrel} \ Group: Development/Kernel \ Provides: %{kname}-devel = %{kverrel} \ Provides: %{kname}-%{1}-devel \ Recommends: %{kname}-%{1}-devel-latest \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ %description -n %{kname}-%{1}-devel-%{buildrel} \ This package contains the kernel files (headers and build tools) \ that should be enough to build additional drivers for \ use with %{kname}-%{1}-%{buildrel}. \ \ If you want to build your own kernel, you need to install the full \ %{kname}-source-%{buildrel} rpm. \ \ %endif \ \ %if %build_debug \ %package -n %{kname}-%{1}-%{buildrel}-debuginfo \ Version: %{fakever} \ Release: %{fakerel} \ Summary: Files with debuginfo for %{kname}-%{1}-%{buildrel} \ Group: Development/Debug \ Provides: kernel-debug = %{kverrel} \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ %description -n %{kname}-%{1}-%{buildrel}-debuginfo \ This package contains the files with debuginfo to aid in debug tasks \ when using %{kname}-%{1}-%{buildrel}. \ \ If you need to look at debug information or use some application that \ needs debugging info from the kernel, this package may help. \ \ %endif \ \ %package -n %{kname}-%{1}-latest \ Version: %{kversion} \ Release: %{rpmrel} \ Summary: Virtual rpm for latest %{kname}-%{1} \ Group: System/Kernel and hardware \ Requires: %{kname}-%{1}-%{buildrel} \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ %description -n %{kname}-%{1}-latest \ This package is a virtual rpm that aims to make sure you always have the \ latest %{kname}-%{1} installed... \ \ %if %build_devel \ %package -n %{kname}-%{1}-devel-latest \ Version: %{kversion} \ Release: %{rpmrel} \ Summary: Virtual rpm for latest %{kname}-%{1}-devel \ Group: Development/Kernel \ Requires: %{kname}-%{1}-devel-%{buildrel} \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ Provides: %{kname}-devel-latest \ %description -n %{kname}-%{1}-devel-latest \ This package is a virtual rpm that aims to make sure you always have the \ latest %{kname}-%{1}-devel installed... \ \ %endif \ \ %posttrans -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-posttrans \ %preun -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-preun \ %postun -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-postun \ \ %if %build_devel \ %post -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-post \ %preun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-preun \ %postun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-postun \ %endif \ \ %files -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1} \ %files -n %{kname}-%{1}-latest \ \ %if %build_devel \ %files -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1} \ %files -n %{kname}-%{1}-devel-latest \ %endif \ \ %if %build_debug \ %files -n %{kname}-%{1}-%{buildrel}-debuginfo -f kernel_debug_files.%{1} \ %endif %ifarch %{ix86} # # kernel-desktop586: i586, smp-alternatives, 4GB # %if %build_desktop586 %define summary_desktop586 Linux kernel for desktop use with i586 and less than 4GB RAM %define info_desktop586 This kernel is compiled for desktop use, single or \ multiple i586 processor(s)/core(s) and less than 4GB RAM (usually 3-3.5GB \ detected, if you need/want to use all 4GB or more, install kernel-server), \ using HZ_100, voluntary preempt, MuQSS CPU scheduler and BFQ I/O scheduler. %mkflavour desktop586 %endif %endif # # kernel-desktop: i686, smp-alternatives, 4 GB / x86_64 # %if %build_desktop %ifarch %{ix86} %define summary_desktop Linux Kernel for desktop use with i686 and less than 4GB RAM %define info_desktop This kernel is compiled for desktop use, single or \ multiple i686 processor(s)/core(s) and less than 4GB RAM (usually 3-3.5GB \ detected, if you need/want to use all 4GB or more, install kernel-server), \ using HZ_100, voluntary preempt, MuQSS cpu scheduler and BFQ I/O scheduler. %else %define summary_desktop Linux Kernel for desktop use with %{_arch} %define info_desktop This kernel is compiled for desktop use, single or \ multiple %{_arch} processor(s)/core(s), using HZ_750, voluntary preempt, \ MuQSS cpu scheduler and BFQ I/O scheduler. %endif %mkflavour desktop %endif # # kernel-server: i686, smp-alternatives, 64 GB / x86_64 # %if %build_server %ifarch %{ix86} %define summary_server Linux Kernel for server use with i686 & 64GB RAM %define info_server This kernel is compiled for server use, single or \ multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using \ no preempt, HZ_100, MuQSS cpu scheduler and BFQ I/O scheduler. %else %define summary_server Linux Kernel for server use with %{_arch} %define info_server This kernel is compiled for server use, single or \ multiple %{_arch} processor(s)/core(s), using no preempt, HZ_100, \ MuQSS cpu scheduler and BFQ I/O scheduler. %endif %mkflavour server %endif # # ARM kernels # %ifarch armv5tl # # kernel-desktop-armv6v7 # %if %build_desktop_armv6v7 %define summary_desktop_armv6v7 Linux kernel for desktop use with ARMv6 or ARMv7 %define info_desktop_armv6v7 This kernel is compiled for desktop use, single or \ multiple ARMv6 or ARMv7 processor(s)/core(s), using HZ_100, voluntary preempt, \ MuQSS cpu scheduler and BFQ I/O scheduler. %mkflavour desktop-armv6v7 %endif %endif # # kernel-source # %if %build_source %package -n %{kname}-source-%{buildrel} Version: %{fakever} Release: %{fakerel} Requires: glibc-devel, ncurses-devel, make, gcc, perl, diffutils Summary: The Linux source code for %{kname}-%{buildrel} Group: Development/Kernel Autoreqprov: no Provides: kernel-source = %{kverrel} Buildarch: noarch %description -n %{kname}-source-%{buildrel} The %{kname}-source package contains the source code files for the Mageia kernel. Theese source files are only needed if you want to build your own custom kernel that is better tuned to your particular hardware. If you only want the files needed to build 3rdparty (nVidia, Ati, dkms-*,...) drivers against, install the *-devel-* rpm that is matching your kernel. # # kernel-source-latest: virtual rpm # %package -n %{kname}-source-latest Version: %{kversion} Release: %{rpmrel} Summary: Virtual rpm for latest %{kname}-source Group: Development/Kernel Requires: %{kname}-source-%{buildrel} Buildarch: noarch %description -n %{kname}-source-latest This package is a virtual rpm that aims to make sure you always have the latest %{kname}-source installed... %endif # # kernel-doc: documentation for the Linux kernel # %if %build_doc %package -n %{kname}-doc Version: %{kversion} Release: %{rpmrel} Summary: Various documentation bits found in the %{kname} source Group: Documentation Buildarch: noarch %description -n %{kname}-doc This package contains documentation files from the %{kname} source. Various bits of information about the Linux kernel and the device drivers shipped with it are documented in these files. You also might want install this package if you need a reference to the options that can be passed to Linux kernel modules at load time. %endif # # kernel/tools # %if %{build_perf} %package -n perf Version: %{kversion} Release: %{rpmrel} Summary: perf tool and the supporting documentation Group: System/Kernel and hardware %description -n perf the perf tool and the supporting documentation. %endif %if %{build_cpupower} %package -n cpupower Version: %{kversion} Release: %{rpmrel} Summary: the cpupower tools Group: System/Kernel and hardware Requires(post): rpm-helper >= 0.24.8-1 Requires(preun): rpm-helper >= 0.24.8-1 Obsoletes: cpufreq cpufrequtils %description -n cpupower the cpupower tools. %post -n cpupower %_post_service cpupower %preun -n cpupower %_preun_service cpupower %package -n cpupower-devel Version: %{kversion} Release: %{rpmrel} Summary: devel files for cpupower Group: Development/Kernel Requires: cpupower = %{kversion}-%{rpmrel} Conflicts: %{_lib}cpufreq-devel %description -n cpupower-devel This package contains the development files for cpupower. %endif %if %{build_bpftool} %package -n bpftool Summary: Inspection and simple manipulation of eBPF programs and maps Group: System/Kernel and hardware %description -n bpftool This package contains the bpftool, which allows inspection and simple manipulation of eBPF programs and maps. %endif %if %{build_libbpf} %package -n %{_lib}bpf0 Summary: The bpf library from kernel source Group: System/Libraries %description -n %{_lib}bpf0 This package contains the kernel source bpf library. %package -n %{_lib}bpf-devel Summary: Developement files for the bpf library from kernel source Group: Development/Kernel %description -n %{_lib}bpf-devel This package includes libraries and header files needed for development of applications which use bpf library from kernel source. %endif # # End packages - here begins build stage # %prep %setup -q -n %top_dir_name -c %setup -q -n %top_dir_name -D -T -a100 %define patches_dir ../%{patch_ver}/ cd %src_dir # extracted from bootsplash patchset mkdir -p ./tools/bootsplash/ cp -p %{SOURCE200} ./tools/bootsplash/ %if %sublevel %if %kpatch %if %prev_sublevel %patch1 -p1 %endif %patch2 -p1 %else %patch1 -p1 %endif %else %if %kpatch # (tmb) hack around rpm patch hiccup xzcat %{PATCH1}| patch -p1 ||: %endif %endif %if %kgit %patch2 -p1 %endif %if %extstable %patch3 -p1 %endif %{patches_dir}/scripts/apply_patches # PATCH END # # Setup Begin # # Prepare all the variables for calling create_configs %if %build_debug %define debug --debug %else %define debug --no-debug %endif %{patches_dir}/scripts/create_configs %debug --user_cpu="%{target_arch}" -v # last minute tuning .config "on the fly" source %{patches_dir}/scripts/kernel_macros_rpm KERNEL_CONFIG_FILES=arch/x86/configs/%{target_arch}_defconfig-* %if %{use_gcc_generic} config_disable MNATIVE config_disable MSKYLAKE config_disable MHASWELL config_disable MSANDYBRIDGE config_disable MWESTMERE config_enable GENERIC_CPU %endif %if %{use_gcc_native} config_enable MNATIVE config_disable MSKYLAKE config_disable MHASWELL config_disable MSANDYBRIDGE config_disable MWESTMERE config_disable GENERIC_CPU config_add X86_P6_NOP %endif %if %{use_gcc_skylake} config_disable MNATIVE config_enable MSKYLAKE config_disable MHASWELL config_disable MSANDYBRIDGE config_disable MWESTMERE config_disable GENERIC_CPU %endif %if %{use_gcc_haswell} config_disable MNATIVE config_disable MSKYLAKE config_enable MHASWELL config_disable MSANDYBRIDGE config_disable MWESTMERE config_disable GENERIC_CPU %endif %if %{use_gcc_sandybridge} config_disable MNATIVE config_disable MSKYLAKE config_disable MHASWELL config_enable MSANDYBRIDGE config_disable MWESTMERE config_disable GENERIC_CPU %endif %if %{use_gcc_westmere} config_disable MNATIVE config_disable MSKYLAKE config_disable MHASWELL config_disable MSANDYBRIDGE config_enable MWESTMERE config_disable GENERIC_CPU %endif %if %{use_gcc_atom} config_disable MNATIVE config_disable MNATIVE config_disable MSKYLAKE config_disable MHASWELL config_disable MSANDYBRIDGE config_disable MWESTMERE config_disable GENERIC_CPU config_enable MATOM %endif %if %{use_gcc_harder_opt} config_enable CC_OPTIMIZE_HARDER %endif # make sure the kernel has the sublevel we know it has... LC_ALL=C perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile # get rid of unwanted files find . -name '*~' -o -name '*.orig' -o -name '*.append' | %kxargs rm -f # fix missing exec flag on file introduced in 4.14.10-rc1 chmod 755 tools/objtool/sync-check.sh %build # Common target directories %define _kerneldir /usr/src/kernel-%{kversion}-%{ktag}-%{buildrpmrel} %define _bootdir /boot %define _modulesdir /lib/modules %define _efidir %{_bootdir}/efi/mageia # Directories definition needed for building %define temp_root %{build_dir}/temp-root %define temp_source %{temp_root}%{_kerneldir} %define temp_boot %{temp_root}%{_bootdir} %define temp_modules %{temp_root}%{_modulesdir} PrepareKernel() { name=$1 extension=$2 x86_dir=arch/x86/configs echo "Make config for kernel $extension" %smake ARCH=%{target_arch} -s mrproper if [ "%{target_arch}" == "i386" -o "%{target_arch}" == "x86_64" ]; then if [ -z "$name" ]; then cp ${x86_dir}/%{target_arch}_defconfig-desktop .config else cp ${x86_dir}/%{target_arch}_defconfig-$name .config fi else if [ -z "$name" ]; then cp arch/%{target_arch}/defconfig-desktop .config else cp arch/%{target_arch}/defconfig-$name .config fi fi # make sure EXTRAVERSION says what we want it to say %if %extstable LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = .%{extstable}-$extension/" Makefile %else LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -$extension/" Makefile %endif %smake ARCH=%{target_arch} oldconfig } BuildKernel() { KernelVer=$1 echo "Building kernel $KernelVer" %kmake ARCH=%{target_arch} all V=2 # Start installing stuff install -d %{temp_boot} install -m 644 System.map %{temp_boot}/System.map-$KernelVer install -m 644 .config %{temp_boot}/config-$KernelVer %if %{build_modxz} xz -c Module.symvers > %{temp_boot}/symvers-$KernelVer.xz %else cp Module.symvers %{temp_boot}/symvers-$KernelVer %endif %ifarch %{arm} cp -f arch/arm/boot/zImage %{temp_boot}/vmlinuz-$KernelVer install -d %{temp_root}/usr/lib/linux-$KernelVer/ for d in arch/arm/boot/dts/*.dtb; do \ install -D -m644 $d %{temp_root}/usr/lib/linux-$KernelVer/$(basename $d); \ done %else cp -f arch/%{target_arch}/boot/bzImage %{temp_boot}/vmlinuz-$KernelVer %endif # modules install -d %{temp_modules}/$KernelVer %smake ARCH=%{target_arch} INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=$KernelVer modules_install } SaveDevel() { devel_flavour=$1 DevelRoot=/usr/src/kernel-%{kversion}-%{ktag}-$devel_flavour-%{buildrpmrel} TempDevelRoot=%{temp_root}$DevelRoot mkdir -p $TempDevelRoot for i in $(find . -name 'Makefile*'); do cp -R --parents $i $TempDevelRoot;done for i in $(find . -name 'Kconfig*' -o -name 'Kbuild*'); do cp -R --parents $i $TempDevelRoot;done cp -fR include $TempDevelRoot cp -fR scripts $TempDevelRoot cp -fR kernel/bounds.c $TempDevelRoot/kernel cp -fR tools/include $TempDevelRoot/tools/ # needed for selinux cp -R --parents security/selinux/include/*.h $TempDevelRoot %ifarch %{arm} cp -fR arch/%{target_arch}/tools $TempDevelRoot/arch/%{target_arch}/ cp -fR arch/%{target_arch}/kernel/signal.h $TempDevelRoot/arch/%{target_arch}/kernel/ %endif %ifarch aarch64 cp -fR arch/x86/entry/syscalls/syscall_32.tbl $TempDevelRoot/arch/x86/entry/syscalls/ cp -fR arch/arm64/kernel/vdso/*.{S,sh} $TempDevelRoot/arch/arm64/kernel/vdso/ %endif %ifarch %{ix86} x86_64 cp -fR arch/x86/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/x86/kernel/ cp -fR arch/x86/kernel/asm-offsets_{32,64}.c $TempDevelRoot/arch/x86/kernel/ cp -fR arch/x86/purgatory/* $TempDevelRoot/arch/x86/purgatory/ cp -fR arch/x86/entry/syscalls/syscall* $TempDevelRoot/arch/x86/entry/syscalls/ cp -fR arch/x86/include $TempDevelRoot/arch/x86/ cp -fR arch/x86/tools $TempDevelRoot/arch/x86/ cp -fR arch/x86/lib $TempDevelRoot/arch/x86/ %else cp -fR arch/%{target_arch}/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/%{target_arch}/kernel/ for f in $(find arch/%{target_arch} -name include); do cp -fR --parents $f $TempDevelRoot; done %endif cp -fR .config Module.symvers $TempDevelRoot cp -fR 3rdparty/mkbuild.pl $TempDevelRoot/3rdparty # Needed for truecrypt build (Danny) cp -fR drivers/md/dm.h $TempDevelRoot/drivers/md/ # needed by include/generated/timeconst.h cp -fR kernel/time/timeconst.bc $TempDevelRoot/kernel/time/ # Needed for lirc_gpio (#39004) cp -fR drivers/media/pci/bt8xx/bttv{,p}.h $TempDevelRoot/drivers/media/pci/bt8xx/ cp -fR drivers/media/pci/bt8xx/bt848.h $TempDevelRoot/drivers/media/pci/bt8xx/ cp -fR drivers/media/common/btcx-risc.h $TempDevelRoot/drivers/media/common/ # aufs2 has a special file needed # if [ -e fs/aufs/magic.mk ]; then cp -fR fs/aufs/magic.mk $TempDevelRoot/fs/aufs/ fi # rtl8821ce has a special file needed cp -fR 3rdparty/rtl8821ce/rtl8821c.mk $TempDevelRoot/3rdparty/rtl8821ce/ # rtl8812au if [ -e 3rdparty/rtl8812au/hal/phydm/phydm.mk ]; then mkdir -p $TempDevelRoot/3rdparty/rtl8812au/hal/phydm/ cp -fp 3rdparty/rtl8812au/hal/phydm/phydm.mk $TempDevelRoot/3rdparty/rtl8812au/hal/phydm/ fi %ifarch x86_64 # orc unwinder needs theese cp -fR tools/build/Build{,.include} $TempDevelRoot/tools/build cp -fR tools/build/fixdep.c $TempDevelRoot/tools/build cp -fR tools/lib/{str_error_r.c,string.c} $TempDevelRoot/tools/lib cp -fR tools/lib/subcmd/* $TempDevelRoot/tools/lib/subcmd cp -fR tools/objtool/* $TempDevelRoot/tools/objtool cp -fR tools/scripts/utilities.mak $TempDevelRoot/tools/scripts %endif for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 m32r m68k m68knommu metag microblaze \ mips mn10300 nds32 nios2 openrisc parisc powerpc riscv s390 score sh sparc tile unicore32 xtensa; do rm -rf $TempDevelRoot/arch/$i rm -rf $TempDevelRoot/scripts/dtc/include-prefixes/$i rm -rf $TempDevelRoot/tools/arch/$i done %ifnarch %{arm} aarch64 rm -rf $TempDevelRoot/arch/arm* rm -rf $TempDevelRoot/include/kvm/arm* rm -rf $TempDevelRoot/include/soc rm -rf $TempDevelRoot/scripts/dtc/include-prefixes/arm* rm -rf $TempDevelRoot/tools/arch/arm* %endif %ifnarch %{ix86} x86_64 rm -rf $TempDevelRoot/arch/x86 rm -rf $TempDevelRoot/tools/arch/x86 # arch/x86/ras/Kconfig is included by drivers/ras/Kconfig # and kconfig's source command seems to be evaluated even under a false conditional mkdir -p $TempDevelRoot/arch/x86/ras cp -fR arch/x86/ras/Kconfig $TempDevelRoot/arch/x86/ras %endif # Clean the scripts tree, and make sure everything is ok (sanity check) # running prepare+scripts (tree was already "prepared" in build) pushd $TempDevelRoot >/dev/null %smake ARCH=%{target_arch} -s prepare scripts %smake ARCH=%{target_arch} -s clean popd >/dev/null rm -f $TempDevelRoot/.config.old # fix permissions chmod -R a+rX $TempDevelRoot # disable mrproper in -devel rpms patch -p1 --fuzz=0 -d $TempDevelRoot -i %{SOURCE2} kernel_devel_files=../kernel_devel_files.$devel_flavour ### Create the kernel_devel_files.* cat > $kernel_devel_files < $kernel_devel_files-post < $kernel_devel_files-preun < $kernel_devel_files-postun </dev/null EOF } SaveDebug() { debug_flavour=$1 install -m 644 vmlinux \ %{temp_boot}/vmlinux-%{kversion}-%{ktag}-$debug_flavour-%{buildrpmrel} kernel_debug_files=../kernel_debug_files.$debug_flavour echo "%{_bootdir}/vmlinux-%{kversion}-%{ktag}-$debug_flavour-%{buildrpmrel}" \ >> $kernel_debug_files find %{temp_modules}/%{kversion}-%{ktag}-$debug_flavour-%{buildrpmrel}/kernel \ -name "*.ko" | \ %kxargs -I '{}' objcopy --only-keep-debug '{}' '{}'.debug find %{temp_modules}/%{kversion}-%{ktag}-$debug_flavour-%{buildrpmrel}/kernel \ -name "*.ko" | %kxargs -I '{}' \ sh -c 'cd `dirname {}`; \ objcopy --add-gnu-debuglink=`basename {}`.debug \ --strip-debug `basename {}`' pushd %{temp_modules} find %{kversion}-%{ktag}-$debug_flavour-%{buildrpmrel}/kernel \ -name "*.ko.debug" > debug_module_list popd cat %{temp_modules}/debug_module_list | \ sed 's|\(.*\)|%{_modulesdir}/\1|' >> $kernel_debug_files cat %{temp_modules}/debug_module_list | \ sed 's|\(.*\)|%exclude %{_modulesdir}/\1|' \ >> ../kernel_exclude_debug_files.$debug_flavour rm -f %{temp_modules}/debug_module_list } CreateFiles() { kernel_flavour=$1 kernel_files=../kernel_files.$kernel_flavour ker="vmlinuz" ### Create the kernel_files.* cat > $kernel_files <> $kernel_files %endif ### Create kernel Posttrans script cat > $kernel_files-posttrans < /dev/null if [ -L vmlinuz-%{ktag}-$kernel_flavour ]; then rm -f vmlinuz-%{ktag}-$kernel_flavour fi ln -sf vmlinuz-%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel} vmlinuz-%{ktag}-$kernel_flavour if [ -L initrd-%{ktag}-$kernel_flavour.img ]; then rm -f initrd-%{ktag}-$kernel_flavour.img fi ln -sf initrd-%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel}.img initrd-%{ktag}-$kernel_flavour.img if [ -e initrd-%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel}.img ]; then ln -sf vmlinuz-%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel} vmlinuz ln -sf initrd-%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel}.img initrd.img fi popd > /dev/null %endif EOF ### Create kernel Preun script on the fly cat > $kernel_files-preun < /dev/null if [ -L vmlinuz-%{ktag}-$kernel_flavour ]; then if [ "$(readlink vmlinuz-%{ktag}-$kernel_flavour)" = "vmlinuz-%{kversion}-${ktag}-$kernel_flavour-%{buildrpmrel}" ]; then rm -f vmlinuz-%{ktag}-$kernel_flavour fi fi if [ -L initrd-%{ktag}-$kernel_flavour.img ]; then if [ "$(readlink initrd-%{ktag}-$kernel_flavour.img)" = "initrd-%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel}.img" ]; then rm -f initrd-%{ktag}-$kernel_flavour.img fi fi popd > /dev/null %if %build_devel if [ -L /lib/modules/%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel}/build ]; then rm -f /lib/modules/%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel}/build fi if [ -L /lib/modules/%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel}/source ]; then rm -f /lib/modules/%{kversion}-%{ktag}-$kernel_flavour-%{buildrpmrel}/source fi %endif exit 0 EOF ### Create kernel Postun script on the fly cat > $kernel_files-postun </dev/null if [ -d /var/lib/dkms ]; then rm -f /var/lib/dkms/*/kernel-%{kversion}-%{ktag}-$devel_flavour-%{buildrpmrel}-%{_target_cpu} >/dev/null rm -rf /var/lib/dkms/*/*/%{kversion}-%{ktag}-$devel_flavour-%{buildrpmrel} >/dev/null rm -f /var/lib/dkms-binary/*/kernel-%{kversion}-%{ktag}-$devel_flavour-%{buildrpmrel}-%{_target_cpu} >/dev/null rm -rf /var/lib/dkms-binary/*/*/%{kversion}-%{ktag}-$devel_flavour-%{buildrpmrel} >/dev/null fi EOF } CreateKernel() { flavour=$1 PrepareKernel $flavour %{ktag}-$flavour-%{buildrpmrel} BuildKernel %{kversion}-%{ktag}-$flavour-%{buildrpmrel} %if %build_devel SaveDevel $flavour %endif %if %build_debug SaveDebug $flavour %endif CreateFiles $flavour } ### # DO it... ### # Create a simulacro of buildroot rm -rf %{temp_root} install -d %{temp_root} # make sure we are in the directory cd %src_dir %ifarch %{ix86} %if %build_desktop586 CreateKernel desktop586 %endif %endif %if %build_desktop CreateKernel desktop %endif %if %build_server CreateKernel server %endif %ifarch armv5tl %if %build_desktop_armv6v7 CreateKernel desktop-armv6v7 %endif %endif # set extraversion to match srpm to get nice version reported by the tools %if %extstable LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = .%{extstable}-%{rpmrel}/" Makefile %else LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile %endif # build perf %if %{build_perf} # perf %smake -s -C tools/perf NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 \ HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 NO_JVMTI=1 prefix=%{_prefix} lib=%{_lib} all %smake -C tools/perf -s prefix=%{_prefix} man %endif %if %{build_cpupower} # cpupower # make sure version-gen.sh is executable. chmod +x tools/power/cpupower/utils/version-gen.sh %make_build -C tools/power/cpupower CPUFREQ_BENCH=false %endif # build bpftool %if %{build_bpftool} pushd tools/bpf/bpftool make popd %endif # build libbpf %if %{build_libbpf} pushd tools/lib/bpf make V=1 popd %endif # We don't make to repeat the depend code at the install phase %if %build_source PrepareKernel "" %{buildrpmrel}%{ktag}custom %smake ARCH=%{target_arch} -s mrproper %endif ### ### install ### %install install -m 644 %{SOURCE4} . cd %src_dir # Directories definition needed for installing %define target_source %{buildroot}%{_kerneldir} %define target_boot %{buildroot}%{_bootdir} %define target_modules %{buildroot}%{_modulesdir} # We want to be able to test several times the install part rm -rf %{buildroot} cp -a %{temp_root} %{buildroot} # Create directories infastructure %if %build_source install -d %{target_source} tar cf - . | tar xf - -C %{target_source} chmod -R a+rX %{target_source} # we remove all the source files that we don't ship # first architecture files for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 m32r m68k m68knommu metag microblaze \ mips nds32 nios2 openrisc parisc powerpc riscv s390 score sh sh64 sparc tile unicore32 v850 xtensa mn10300; do rm -rf %{target_source}/arch/$i rm -rf %{target_source}/scripts/dtc/include-prefixes/$i rm -rf %{target_source}/tools/arch/$i rm -rf %{target_source}/tools/testing/selftests/$i done %ifnarch %{arm} aarch64 rm -rf %{target_source}/include/kvm/arm* rm -rf %{target_source}/scripts/dtc/include-prefixes/arm* rm -rf %{target_source}/tools/arch/arm* %endif # other misc files rm -f %{target_source}/{.clang-format,.config.old,.config.cmd,.lst,.mailmap,.get_maintainer.ignore} rm -f %{target_source}/{.missing-syscalls.d,.cocciconfig,.gitattributes} rm -rf %{target_source}/.tmp_depmod/ # more cleaning pushd %{target_source} # lots of gitignore files find -iname ".gitignore" -delete # clean tools tree %smake -C tools clean %smake -C tools/build clean %smake -C tools/build/feature clean popd # nuke last as it gets re-created rm -f %{target_source}/.cache.mk #endif %build_source %endif # compressing modules %if %{build_modxz} find %{target_modules} -name "*.ko" | %kxargs xz -6e %else find %{target_modules} -name "*.ko" | %kxargs pigz -9 %endif # We used to have a copy of PrepareKernel here # Now, we make sure that the thing in the linux dir is what we want it to be for i in %{target_modules}/*; do rm -f $i/build $i/source done # sniff, if we compressed all the modules, we change the stamp :( # we really need the depmod -ae here pushd %{target_modules} for i in *; do /sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i echo $? done for i in *; do pushd $i echo "Creating modules.description for $i" modules=`find . -name "*.ko.[g,x]z"` echo $modules | %kxargs /sbin/modinfo \ | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!; $name =~ s!.*/!!' > modules.description popd done popd # need to set extraversion to match srpm again to avoid rebuild %if %extstable LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = .%{extstable}-%{rpmrel}/" Makefile %else LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile %endif %if %{build_perf} # perf tool binary and supporting scripts/binaries %smake -s -C tools/perf V=1 DESTDIR=%{buildroot} NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 \ HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 NO_JVMTI=1 prefix=%{_prefix} lib=%{_lib} install # perf man pages (note: implicit rpm magic compresses them later) make -C tools/perf V=1 DESTDIR=%{buildroot} prefix=%{_prefix} install-man # remove perf files we dont ship rm -rf %{buildroot}/usr/lib/perf/examples rm -rf %{buildroot}/usr/lib/perf/include/bpf %endif %if %{build_cpupower} make -C tools/power/cpupower DESTDIR=%{buildroot} libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install rm -f %{buildroot}%{_libdir}/*.{a,la} %find_lang cpupower mv cpupower.lang ../ chmod 0755 %{buildroot}%{_libdir}/libcpupower.so* mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig install -m644 %{SOURCE50} %{buildroot}%{_unitdir}/cpupower.service install -m644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/cpupower %endif ### ### clean ### %clean rm -rf %{buildroot} # We don't want to remove this, the whole reason of its existence is to be # able to do several rpm --short-circuit -bi for testing install # phase without repeating compilation phase #rm -rf %{temp_root} ### ### source and doc file lists ### %if %build_source %files -n %{kname}-source-%{buildrel} %doc %{_kerneldir}/LICENSES %dir %{_kerneldir} %dir %{_kerneldir}/arch %dir %{_kerneldir}/include %{_kerneldir}/3rdparty %{_kerneldir}/Documentation %{_kerneldir}/arch/Kconfig %{_kerneldir}/arch/arm %{_kerneldir}/arch/arm64 %{_kerneldir}/arch/um %{_kerneldir}/arch/x86 %{_kerneldir}/block %{_kerneldir}/certs %{_kerneldir}/crypto %{_kerneldir}/drivers %{_kerneldir}/fs %{_kerneldir}/include/acpi %{_kerneldir}/include/asm-generic %{_kerneldir}/include/clocksource %{_kerneldir}/include/crypto %{_kerneldir}/include/drm %{_kerneldir}/include/dt-bindings %{_kerneldir}/include/keys %{_kerneldir}/include/kvm %{_kerneldir}/include/linux %{_kerneldir}/include/math-emu %{_kerneldir}/include/media %{_kerneldir}/include/memory %{_kerneldir}/include/misc %{_kerneldir}/include/net %{_kerneldir}/include/pcmcia %{_kerneldir}/include/ras %{_kerneldir}/include/rdma %{_kerneldir}/include/scsi %{_kerneldir}/include/soc %{_kerneldir}/include/sound %{_kerneldir}/include/target %{_kerneldir}/include/trace %{_kerneldir}/include/uapi %{_kerneldir}/include/video %{_kerneldir}/include/xen %{_kerneldir}/init %{_kerneldir}/ipc %{_kerneldir}/kernel %{_kerneldir}/lib %{_kerneldir}/mm %{_kerneldir}/net %{_kerneldir}/virt %{_kerneldir}/samples %{_kerneldir}/scripts %{_kerneldir}/security %{_kerneldir}/sound %{_kerneldir}/tools %{_kerneldir}/usr %{_kerneldir}/COPYING %{_kerneldir}/CREDITS %{_kerneldir}/Kbuild %{_kerneldir}/Kconfig %{_kerneldir}/MAINTAINERS %{_kerneldir}/Makefile %{_kerneldir}/README %doc README.kernel-%{ktag}-sources %files -n %{kname}-source-latest %endif %if %build_doc %files -n %{kname}-doc %doc linux-%{tar_ver}/Documentation/* %endif %if %{build_perf} %files -n perf %{_bindir}/perf %{_bindir}/trace %{_datadir}/perf-core/strace/groups/file %{_datadir}/doc/perf-tip/tips.txt %dir %{_libdir}/traceevent %dir %{_libdir}/traceevent/plugins %{_libdir}/traceevent/plugins/plugin_* %dir %{_prefix}/libexec/perf-core %{_prefix}/libexec/perf-core/* %{_mandir}/man[1-8]/perf* %{_sysconfdir}/bash_completion.d/perf %exclude %{_prefix}/src/debug %endif %if %{build_cpupower} %files -n cpupower -f cpupower.lang %config(noreplace) %{_sysconfdir}/sysconfig/cpupower %{_bindir}/cpupower %{_datadir}/bash-completion/completions/cpupower %{_libdir}/libcpupower.so.0 %{_libdir}/libcpupower.so.0.0.1 %{_unitdir}/cpupower.service %{_mandir}/man[1-8]/cpupower* %exclude %{_prefix}/src/debug %files -n cpupower-devel %{_libdir}/libcpupower.so %{_includedir}/cpuidle.h %{_includedir}/cpufreq.h %endif %if %{build_bpftool} %files -n bpftool %{_sbindir}/bpftool %{_sysconfdir}/bash_completion.d/bpftool %{_mandir}/man7/bpf-helpers.7* %{_mandir}/man8/bpftool-cgroup.8* %{_mandir}/man8/bpftool-map.8* %{_mandir}/man8/bpftool-net.8* %{_mandir}/man8/bpftool-prog.8* %{_mandir}/man8/bpftool-perf.8* %{_mandir}/man8/bpftool-feature.8* %{_mandir}/man8/bpftool.8* %endif %if %{build_libbpf} %files -n %{_lib}bpf0 %{_libdir}/libbpf.so.0 %{_libdir}/libbpf.so.0.0.2 %files -n %{_lib}bpf-devel %{_libdir}/libbpf.a %{_libdir}/libbpf.so %{_includedir}/bpf/bpf.h %{_includedir}/bpf/btf.h %{_includedir}/bpf/libbpf.h %{_includedir}/bpf/xsk.h %endif