fedora-zen-custom/build.sh

33 lines
807 B
Bash
Executable File

#!/bin/bash
is_package_installed() {
dnf list installed "$1" &> /dev/null
return $?
}
if [ -f "SOURCES/v6.7.2-zen1.tar.gz" ]; then
rm -f "SOURCES/v6.7.2-zen1.tar.gz"
fi
for dir in BUILD BUILDROOT RPMS SOURCES SPECS SRPMS; do
if [ ! -d "$dir" ]; then
mkdir "$dir"
fi
done
required_packages=(gcc make flex bison ncurses-devel elfutils-libelf-devel openssl-devel clang llvm rpm-build redhat-rpm-config rpmdevtools dwarves)
for package in "${required_packages[@]}"; do
if ! is_package_installed "$package"; then
sudo dnf install -y "$package"
fi
done
if [ ! -f "SOURCES/v6.7.2-zen1.tar.gz" ]; then
wget -P SOURCES/ https://github.com/zen-kernel/zen-kernel/archive/refs/tags/v6.7.2-zen1.tar.gz
fi
rpmbuild -ba --define "_topdir $PWD" SPECS/linux-zen.spec