Refactor PKGBUILD generation

This will allow aur users to easily change the PKGBUILDS to work with newer versions
pull/254/head
Jan Houben 7 years ago
parent de663429dc
commit 4bfb947efd
No known key found for this signature in database
GPG Key ID: 6866AADB974DD983
  1. 91
      lib.sh
  2. 12
      repo.sh
  3. 7
      src/kernels/archiso.sh
  4. 4
      src/kernels/common-git.sh
  5. 8
      src/kernels/common.sh
  6. 17
      src/kernels/dkms.sh
  7. 55
      src/kernels/linux-hardened.sh
  8. 53
      src/kernels/linux-lts.sh
  9. 59
      src/kernels/linux-vfio.sh
  10. 59
      src/kernels/linux-zen.sh
  11. 56
      src/kernels/linux.sh
  12. 13
      src/spl/PKGBUILD.sh
  13. 1
      src/zfs-dkms/PKGBUILD.sh
  14. 3
      src/zfs-utils/PKGBUILD.sh
  15. 16
      src/zfs/PKGBUILD.sh

@ -425,6 +425,7 @@ source_safe() {
linux_headers_depends=""
spl_replaces=""
zfs_replaces=""
zfs_set_commit=""
export script_dir mode kernel_name
shopt -u extglob
@ -510,76 +511,6 @@ check_result() {
fi
}
get_linux_vfio_kernel_version() {
#
# Get linux-vfio kernel version (this will change when the linux-vfio is updated)
#
msg "Checking linux-vfio download page for the latest linux kernel version..."
if ! get_webpage "https://aur.archlinux.org/packages/linux-vfio" "(?<=linux-vfio )[\d\w\.-]+"; then
exit 1
fi
latest_kernel_version=${webpage_output}
}
get_archiso_kernel_version() {
#
# Get archiso kernel version (this will change when the archiso is updated)
#
msg "Checking archiso download page for the latest linux kernel version..."
if ! get_webpage "https://www.archlinux.org/download/" "(?<=Included Kernel:</strong> )[\d\.]+"; then
exit 1
fi
latest_kernel_version=${webpage_output}
}
get_linux_hardened_kernel_version() {
#
# Get x86_64 linux-hardened kernel version
#
msg "Checking the online package database for the latest x86_64 linux-hardened kernel version..."
if ! get_webpage "https://www.archlinux.org/packages/extra/x86_64/linux-hardened/" "(?<=<h2>linux-hardened )[\d\w\.-]+(?=</h2>)"; then
exit 1
fi
latest_kernel_version=${webpage_output}
}
get_linux_zen_kernel_version() {
#
# Check x86_64 linux-hardened kernel version
#
msg "Checking the online package database for the latest x86_64 linux-zen kernel version..."
if ! get_webpage "https://www.archlinux.org/packages/extra/x86_64/linux-zen/" "(?<=<h2>linux-zen )[\d\w\.-]+(?=</h2>)"; then
exit 1
fi
latest_kernel_version=${webpage_output}
}
get_linux_kernel_version() {
#
# Check x86_64 linux kernel version
#
msg "Checking the online package database for the latest x86_64 linux kernel version..."
if ! get_webpage "https://www.archlinux.org/packages/core/x86_64/linux/" "(?<=<h2>linux )[\d\w\.-]+(?=</h2>)"; then
exit 1
fi
latest_kernel_version=${webpage_output}
}
get_linux_lts_kernel_version() {
#
# Check x86_64 linux-lts kernel version
#
msg "Checking the online package database for the latest x86_64 linux-lts kernel version..."
if ! get_webpage "https://www.archlinux.org/packages/core/x86_64/linux-lts/" "(?<=<h2>linux-lts )[\d\w\.-]+(?=</h2>)"; then
exit 1
fi
latest_kernel_version=${webpage_output}
}
check_zol_version() {
#
# Check ZFSonLinux.org
@ -941,22 +872,12 @@ git_calc_pkgver() {
if [[ ${repo} =~ ^spl ]]; then
spl_git_ver=${run_cmd_output}
# append kernel version if set
if [ ! -z "${kernvers}" ]; then
spl_pkgver=${spl_git_ver}.${kernvers};
else
spl_pkgver=${spl_git_ver};
fi
spl_pkgver=${spl_git_ver}
debug "spl_pkgver: ${spl_pkgver}"
elif [[ ${repo} =~ ^zfs ]]; then
zfs_git_ver=${run_cmd_output}
# append kernel version if set
if [ ! -z "${kernvers}" ]; then
zfs_pkgver=${zfs_git_ver}.${kernvers};
else
zfs_git_ver=${run_cmd_output}
zfs_pkgver=${zfs_git_ver};
fi
debug "zfs_pkgver: ${zfs_pkgver}"
debug "zfs_pkgver: ${zfs_pkgver}"
fi
# get latest commit sha
@ -964,9 +885,9 @@ git_calc_pkgver() {
cmd+="git rev-parse HEAD"
run_cmd_no_output_no_dry_run "${cmd}"
if [[ ${repo} =~ ^zfs ]]; then
latest_zfs_git_commit=${run_cmd_output}
latest_zfs_git_commit=${run_cmd_output}
else
latest_spl_git_commit=${run_cmd_output}
latest_spl_git_commit=${run_cmd_output}
fi
# Cleanup

@ -190,12 +190,20 @@ repo_package_list() {
# Version match check: arch: x86_64 name: spl-utils-linux-git vers: 0.7.0_rc1_r0_g4fd75d3_4.7.2_1-4 vers_match: 0.6.5.8.*4.7.2_1-4
debug "spl_pkgver: ${spl_pkgver}"
debug "zfs_pkgver: ${zfs_pkgver}"
debug "kernel_version_full_pkgver: ${kernel_version_full_pkgver}"
kernvers=""
# append kernel version if set
if [ ! -z "${kernel_version_full_pkgver}" ]; then
kernvers="_${kernel_version_full_pkgver}";
fi
if [[ ${pkg} =~ .*spl-.* ]]; then
match="${spl_pkgver}-${spl_pkgrel}"
match="${spl_pkgver}${kernvers}-${spl_pkgrel}"
elif [[ ${pkg} =~ .*zfs-.* ]]; then
match="${zfs_pkgver}-${zfs_pkgrel}"
match="${zfs_pkgver}${kernvers}-${zfs_pkgrel}"
fi
debug "Version match check: arch: ${arch} name: ${name} vers: ${vers} vers_match: ${match}"
if ! [[ ${vers} =~ ^${match} ]] ; then

@ -26,8 +26,11 @@ header="\
#"
update_archiso_linux_pkgbuilds() {
get_archiso_kernel_version
kernel_version=${latest_kernel_version}
msg "Checking archiso download page for the latest linux kernel version..."
if ! get_webpage "https://www.archlinux.org/download/" "(?<=Included Kernel:</strong> )[\d\.]+"; then
exit 1
fi
kernel_version=${webpage_output}
pkg_list=("spl-archiso-linux" "zfs-archiso-linux")
kernel_version_full=$(kernel_version_full ${kernel_version})

@ -27,7 +27,6 @@ update_common_git_pkgbuilds() {
zfs_utils_pkgname="zfs-utils-common-git"
spl_utils_pkgbuild_path="packages/${kernel_name}/${spl_utils_pkgname}"
zfs_utils_pkgbuild_path="packages/${kernel_name}/${zfs_utils_pkgname}"
zfs_src_target="git+${zfs_git_url}"
zfs_src_hash="SKIP"
zfs_makedepends="\"git\""
zfs_workdir="\${srcdir}/zfs"
@ -38,5 +37,6 @@ update_common_git_pkgbuilds() {
git_check_repo
git_calc_pkgver
fi
zfs_src_target="git+${zfs_git_url}#commit=${latest_zfs_git_commit}"
zfs_set_commit="_commit='${latest_zfs_git_commit}'"
zfs_src_target="git+${zfs_git_url}#commit=\${_commit}"
}

@ -28,10 +28,10 @@ update_common_pkgbuilds() {
# Paths are relative to build.sh
spl_utils_pkgbuild_path="packages/${kernel_name}/${spl_utils_pkgname}"
zfs_utils_pkgbuild_path="packages/${kernel_name}/${zfs_utils_pkgname}"
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/spl-${zol_version}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/zfs-${zol_version}.tar.gz"
spl_workdir="\${srcdir}/spl-${zol_version}"
zfs_workdir="\${srcdir}/zfs-${zol_version}"
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${pkgver}/spl-\${pkgver}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${pkgver}/zfs-\${pkgver}.tar.gz"
spl_workdir="\${srcdir}/spl-\${pkgver}"
zfs_workdir="\${srcdir}/zfs-\${pkgver}"
spl_utils_replaces='replaces=("spl-utils-linux", "spl-utils-linux-lts")'
zfs_utils_replaces='replaces=("zfs-utils-linux", "zfs-utils-linux-lts")'
}

@ -34,15 +34,15 @@ update_dkms_pkgbuilds() {
zfs_conflicts="'zfs-dkms-git'"
spl_pkgname="spl-dkms"
zfs_pkgname="zfs-dkms"
spl_utils_pkgname="spl-utils-common=${zol_version}"
zfs_utils_pkgname="zfs-utils-common=${zol_version}"
spl_utils_pkgname="spl-utils-common=\${pkgver}"
zfs_utils_pkgname="zfs-utils-common=\${pkgver}"
# Paths are relative to build.sh
spl_dkms_pkgbuild_path="packages/${kernel_name}/${spl_pkgname}"
zfs_dkms_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/spl-${zol_version}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/zfs-${zol_version}.tar.gz"
spl_workdir="\${srcdir}/spl-${zol_version}"
zfs_workdir="\${srcdir}/zfs-${zol_version}"
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${pkgver}/spl-\${pkgver}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${pkgver}/zfs-\${pkgver}.tar.gz"
spl_workdir="\${srcdir}/spl-\${pkgver}"
zfs_workdir="\${srcdir}/zfs-\${pkgver}"
}
update_dkms_git_pkgbuilds() {
@ -64,7 +64,8 @@ update_dkms_git_pkgbuilds() {
git_check_repo
git_calc_pkgver
fi
zfs_utils_pkgname="zfs-utils-common-git=${zfs_git_ver}"
zfs_utils_pkgname="zfs-utils-common-git=\${pkgver}"
zfs_mod_ver="git"
zfs_src_target="git+${zfs_git_url}#commit=${latest_zfs_git_commit}"
zfs_set_commit="_commit='${latest_zfs_git_commit}'"
zfs_src_target="git+${zfs_git_url}#commit=\${_commit}"
}

@ -32,57 +32,55 @@ header="\
# archzfs github page.
#"
update_linux_hardened_pkgbuilds() {
get_linux_hardened_kernel_version
kernel_version=${latest_kernel_version}
pkg_list=("spl-linux-hardened" "zfs-linux-hardened")
get_kernel_options() {
msg "Checking the online package database for the latest x86_64 linux-hardened kernel version..."
if ! get_webpage "https://www.archlinux.org/packages/extra/x86_64/linux-hardened/" "(?<=<h2>linux-hardened )[\d\w\.-]+(?=</h2>)"; then
exit 1
fi
kernel_version=${webpage_output}
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version_full}-hardened"
linux_depends="\"linux-hardened=\${_kernelver}\""
linux_headers_depends="\"linux-hardened-headers=\${_kernelver}\""
}
update_linux_hardened_pkgbuilds() {
get_kernel_options
pkg_list=("spl-linux-hardened" "zfs-linux-hardened")
archzfs_package_group="archzfs-linux-hardened"
spl_pkgver=${zol_version}_${kernel_version_full_pkgver}
zfs_pkgver=${zol_version}_${kernel_version_full_pkgver}
spl_pkgver=${zol_version}
zfs_pkgver=${zol_version}
spl_pkgrel=${pkgrel}
zfs_pkgrel=${pkgrel}
spl_conflicts="'spl-linux-hardened-git'"
zfs_conflicts="'zfs-linux-hardened-git'"
spl_utils_pkgname="spl-utils-common=${zol_version}"
spl_pkgname="spl-linux-hardened"
zfs_utils_pkgname="zfs-utils-common=${zol_version}"
spl_utils_pkgname="spl-utils-common=\${_splver}"
zfs_pkgname="zfs-linux-hardened"
zfs_utils_pkgname="zfs-utils-common=\${_zfsver}"
# Paths are relative to build.sh
spl_pkgbuild_path="packages/${kernel_name}/${spl_pkgname}"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/spl-${zol_version}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/zfs-${zol_version}.tar.gz"
spl_workdir="\${srcdir}/spl-${zol_version}"
zfs_workdir="\${srcdir}/zfs-${zol_version}"
linux_depends="\"linux-hardened=${kernel_version}\""
linux_headers_depends="\"linux-hardened-headers=${kernel_version}\""
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_splver}/spl-\${_splver}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_zfsver}/zfs-\${_zfsver}.tar.gz"
spl_workdir="\${srcdir}/spl-\${_splver}"
zfs_workdir="\${srcdir}/zfs-\${_zfsver}"
zfs_makedepends="\"${spl_pkgname}-headers\""
}
update_linux_hardened_git_pkgbuilds() {
get_linux_hardened_kernel_version
kernel_version=${latest_kernel_version}
get_kernel_options
pkg_list=("zfs-linux-hardened-git")
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version_full}-hardened"
archzfs_package_group="archzfs-linux-hardened-git"
zfs_pkgver="" # Set later by call to git_calc_pkgver
zfs_pkgrel=${pkgrel_git}
zfs_conflicts="'zfs-linux-hardened' 'spl-linux-hardened-git'"
zfs_conflicts="'zfs-linux-hardened' 'spl-linux-hardened-git' 'spl-linux-hardened'"
spl_pkgname=""
zfs_pkgname="zfs-linux-hardened-git"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
linux_depends="\"linux-hardened=${kernel_version}\""
linux_headers_depends="\"linux-hardened-headers=${kernel_version}\""
zfs_replaces='replaces=("spl-linux-hardened-git")'
zfs_src_target="git+${zfs_git_url}"
zfs_src_hash="SKIP"
zfs_makedepends="\"git\""
zfs_workdir="\${srcdir}/zfs"
@ -90,6 +88,7 @@ update_linux_hardened_git_pkgbuilds() {
git_check_repo
git_calc_pkgver
fi
zfs_utils_pkgname="zfs-utils-common-git=${zfs_git_ver}"
zfs_src_target="git+${zfs_git_url}#commit=${latest_zfs_git_commit}"
zfs_utils_pkgname="zfs-utils-common-git=\${_zfsver}"
zfs_set_commit="_commit='${latest_zfs_git_commit}'"
zfs_src_target="git+${zfs_git_url}#commit=\${_commit}"
}

@ -32,56 +32,54 @@ header="\
# archzfs github page.
#"
update_linux_lts_pkgbuilds() {
get_linux_lts_kernel_version
kernel_version=${latest_kernel_version}
pkg_list=("spl-linux-lts" "zfs-linux-lts")
get_kernel_options() {
msg "Checking the online package database for the latest x86_64 linux-lts kernel version..."
if ! get_webpage "https://www.archlinux.org/packages/core/x86_64/linux-lts/" "(?<=<h2>linux-lts )[\d\w\.-]+(?=</h2>)"; then
exit 1
fi
kernel_version=${webpage_output}
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version_full}-lts"
linux_depends="\"linux-lts=\${_kernelver}\""
linux_headers_depends="\"linux-lts-headers=\${_kernelver}\""
}
update_linux_lts_pkgbuilds() {
get_kernel_options
pkg_list=("spl-linux-lts" "zfs-linux-lts")
archzfs_package_group="archzfs-linux-lts"
spl_pkgver=${zol_version}.${kernel_version_full_pkgver}
zfs_pkgver=${zol_version}.${kernel_version_full_pkgver}
spl_pkgver=${zol_version}
zfs_pkgver=${zol_version}
spl_pkgrel=${pkgrel}
zfs_pkgrel=${pkgrel}
spl_conflicts="'spl-linux-lts-git'"
zfs_conflicts="'zfs-linux-lts-git'"
spl_pkgname="spl-linux-lts"
spl_utils_pkgname="spl-utils-common=${zol_version}"
spl_utils_pkgname="spl-utils-common=\${_splver}"
zfs_pkgname="zfs-linux-lts"
zfs_utils_pkgname="zfs-utils-common=${zol_version}"
zfs_utils_pkgname="zfs-utils-common=\${_zfsver}"
# Paths are relative to build.sh
spl_pkgbuild_path="packages/${kernel_name}/${spl_pkgname}"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/spl-${zol_version}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/zfs-${zol_version}.tar.gz"
spl_workdir="\${srcdir}/spl-${zol_version}"
zfs_workdir="\${srcdir}/zfs-${zol_version}"
linux_depends="\"linux-lts=${kernel_version}\""
linux_headers_depends="\"linux-lts-headers=${kernel_version}\""
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_splver}/spl-\${_splver}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_zfsver}/zfs-\${_zfsver}.tar.gz"
spl_workdir="\${srcdir}/spl-\${_splver}"
zfs_workdir="\${srcdir}/zfs-\${_zfsver}"
zfs_makedepends="\"${spl_pkgname}-headers\""
}
update_linux_lts_git_pkgbuilds() {
get_linux_lts_kernel_version
kernel_version=${latest_kernel_version}
get_kernel_options
pkg_list=("zfs-linux-lts-git")
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version_full}-lts"
archzfs_package_group="archzfs-linux-lts-git"
zfs_pkgver="" # Set later by call to git_calc_pkgver
zfs_pkgrel=${pkgrel_git}
zfs_conflicts="'zfs-linux-lts' 'spl-linux-lts-git'"
zfs_conflicts="'zfs-linux-lts' 'spl-linux-lts-git' 'spl-linux-lts'"
spl_pkgname=""
zfs_pkgname="zfs-linux-lts-git"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
linux_depends="\"linux-lts=${kernel_version}\""
linux_headers_depends="\"linux-lts-headers=${kernel_version}\""
zfs_replaces='replaces=("spl-linux-lts-git")'
zfs_src_hash="SKIP"
zfs_makedepends="\"git\""
@ -90,6 +88,7 @@ update_linux_lts_git_pkgbuilds() {
git_check_repo
git_calc_pkgver
fi
zfs_utils_pkgname="zfs-utils-common-git=${zfs_git_ver}"
zfs_src_target="git+${zfs_git_url}#commit=${latest_zfs_git_commit}"
zfs_utils_pkgname="zfs-utils-common-git=\${_zfsver}"
zfs_set_commit="_commit='${latest_zfs_git_commit}'"
zfs_src_target="git+${zfs_git_url}#commit=\${_commit}"
}

@ -7,7 +7,7 @@ mode_desc="Select and use the packages for the linux-vfio kernel"
pkgrel="1"
# pkgrel for GIT packages
pkgrel_git="${pkgrel}"
pkgrel_git="1"
zfs_git_commit=""
spl_git_commit=""
zfs_git_url="https://github.com/zfsonlinux/zfs.git"
@ -32,56 +32,54 @@ header="\
# archzfs github page.
#"
update_linux_pkgbuilds() {
get_linux_vfio_kernel_version
kernel_version=${latest_kernel_version}
pkg_list=("spl-linux-vfio" "zfs-linux-vfio")
get_kernel_options() {
msg "Checking linux-vfio download page for the latest linux kernel version..."
if ! get_webpage "https://aur.archlinux.org/packages/linux-vfio" "(?<=linux-vfio )[\d\w\.-]+"; then
exit 1
fi
kernel_version=${webpage_output}
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version/.arch/-arch}-vfio"
kernel_mod_path="\${_kernelver/.arch/-arch}-vfio"
linux_depends="\"linux-vfio=\${_kernelver}\""
linux_headers_depends="\"linux-vfio-headers=\${_kernelver}\""
}
update_linux_vfio_pkgbuilds() {
get_kernel_options
pkg_list=("spl-linux-vfio" "zfs-linux-vfio")
archzfs_package_group="archzfs-linux-vfio"
spl_pkgver=${zol_version}.${kernel_version_full_pkgver}
zfs_pkgver=${zol_version}.${kernel_version_full_pkgver}
spl_pkgver=${zol_version}
zfs_pkgver=${zol_version}
spl_pkgrel=${pkgrel}
zfs_pkgrel=${pkgrel}
spl_conflicts="'spl-linux-vfio-git'"
zfs_conflicts="'zfs-linux-vfio-git'"
spl_utils_pkgname="spl-utils-common=${zol_version}"
spl_pkgname="spl-linux-vfio"
zfs_utils_pkgname="zfs-utils-common=${zol_version}"
spl_utils_pkgname="spl-utils-common=\${_splver}"
zfs_pkgname="zfs-linux-vfio"
zfs_utils_pkgname="zfs-utils-common=\${_zfsver}"
# Paths are relative to build.sh
spl_pkgbuild_path="packages/${kernel_name}/${spl_pkgname}"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/spl-${zol_version}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/zfs-${zol_version}.tar.gz"
spl_workdir="\${srcdir}/spl-${zol_version}"
zfs_workdir="\${srcdir}/zfs-${zol_version}"
linux_depends="\"linux-vfio=${kernel_version}\""
linux_headers_depends="\"linux-vfio-headers=${kernel_version}\""
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_splver}/spl-\${_splver}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_zfsver}/zfs-\${_zfsver}.tar.gz"
spl_workdir="\${srcdir}/spl-\${_splver}"
zfs_workdir="\${srcdir}/zfs-\${_zfsver}"
zfs_makedepends="\"${spl_pkgname}-headers\""
}
update_linux_git_pkgbuilds() {
get_linux_vfio_kernel_version
kernel_version=${latest_kernel_version}
update_linux_vfio_git_pkgbuilds() {
get_kernel_options
pkg_list=("zfs-linux-vfio-git")
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version/.arch/-arch}-vfio"
archzfs_package_group="archzfs-linux-vfio-git"
zfs_pkgver="" # Set later by call to git_calc_pkgver
zfs_pkgrel=${pkgrel_git}
zfs_conflicts="'zfs-linux-vfio' 'spl-linux-vfio-git'"
zfs_conflicts="'zfs-linux-vfio' 'spl-linux-vfio-git' 'spl-linux-vfio'"
spl_pkgname=""
zfs_pkgname="zfs-linux-vfio-git"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
linux_depends="\"linux-vfio=${kernel_version}\""
linux_headers_depends="\"linux-vfio-headers=${kernel_version}\""
zfs_replaces='replaces=("spl-linux-vfio-git")'
zfs_src_hash="SKIP"
zfs_makedepends="\"git\""
@ -90,6 +88,7 @@ update_linux_git_pkgbuilds() {
git_check_repo
git_calc_pkgver
fi
zfs_utils_pkgname="zfs-utils-common-git=${zfs_git_ver}"
zfs_src_target="git+${zfs_git_url}#commit=${latest_zfs_git_commit}"
zfs_utils_pkgname="zfs-utils-common-git=\${_zfsver}"
zfs_set_commit="_commit='${latest_zfs_git_commit}'"
zfs_src_target="git+${zfs_git_url}#commit=\${_commit}"
}

@ -7,7 +7,7 @@ mode_desc="Select and use the packages for the linux-zen kernel"
pkgrel="1"
# pkgrel for GIT packages
pkgrel_git="${pkgrel}"
pkgrel_git="1"
zfs_git_commit=""
spl_git_commit=""
zfs_git_url="https://github.com/zfsonlinux/zfs.git"
@ -32,56 +32,54 @@ header="\
# archzfs github page.
#"
update_linux_pkgbuilds() {
get_linux_zen_kernel_version
kernel_version=${latest_kernel_version}
pkg_list=("spl-linux-zen" "zfs-linux-zen")
get_kernel_options() {
msg "Checking the online package database for the latest x86_64 linux-zen kernel version..."
if ! get_webpage "https://www.archlinux.org/packages/extra/x86_64/linux-zen/" "(?<=<h2>linux-zen )[\d\w\.-]+(?=</h2>)"; then
exit 1
fi
kernel_version=${webpage_output}
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version/.zen/-zen}-zen"
kernel_mod_path="\${_kernelver/.zen/-zen}-zen"
linux_depends="\"linux-zen=\${_kernelver}\""
linux_headers_depends="\"linux-zen-headers=\${_kernelver}\""
}
update_linux_zen_pkgbuilds() {
get_kernel_options
pkg_list=("spl-linux-zen" "zfs-linux-zen")
archzfs_package_group="archzfs-linux-zen"
spl_pkgver=${zol_version}.${kernel_version_full_pkgver}
zfs_pkgver=${zol_version}.${kernel_version_full_pkgver}
spl_pkgver=${zol_version}
zfs_pkgver=${zol_version}
spl_pkgrel=${pkgrel}
zfs_pkgrel=${pkgrel}
spl_conflicts="'spl-linux-zen-git'"
zfs_conflicts="'zfs-linux-zen-git'"
spl_utils_pkgname="spl-utils-common=${zol_version}"
spl_pkgname="spl-linux-zen"
zfs_utils_pkgname="zfs-utils-common=${zol_version}"
spl_utils_pkgname="spl-utils-common=\${_splver}"
zfs_pkgname="zfs-linux-zen"
zfs_utils_pkgname="zfs-utils-common=\${_zfsver}"
# Paths are relative to build.sh
spl_pkgbuild_path="packages/${kernel_name}/${spl_pkgname}"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/spl-${zol_version}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/zfs-${zol_version}.tar.gz"
spl_workdir="\${srcdir}/spl-${zol_version}"
zfs_workdir="\${srcdir}/zfs-${zol_version}"
linux_depends="\"linux-zen=${kernel_version}\""
linux_headers_depends="\"linux-zen-headers=${kernel_version}\""
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_splver}/spl-\${_splver}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_zfsver}/zfs-\${_zfsver}.tar.gz"
spl_workdir="\${srcdir}/spl-\${_splver}"
zfs_workdir="\${srcdir}/zfs-\${_zfsver}"
zfs_makedepends="\"${spl_pkgname}-headers\""
}
update_linux_git_pkgbuilds() {
get_linux_zen_kernel_version
kernel_version=${latest_kernel_version}
update_linux_zen_git_pkgbuilds() {
get_kernel_options
pkg_list=("zfs-linux-zen-git")
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version/.zen/-zen}-zen"
archzfs_package_group="archzfs-linux-zen-git"
zfs_pkgver="" # Set later by call to git_calc_pkgver
zfs_pkgrel=${pkgrel_git}
zfs_conflicts="'zfs-linux-zen' 'spl-linux-zen-git'"
zfs_conflicts="'zfs-linux-zen' 'spl-linux-zen-git' 'spl-linux-zen'"
spl_pkgname=""
zfs_pkgname="zfs-linux-zen-git"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
linux_depends="\"linux-zen=${kernel_version}\""
linux_headers_depends="\"linux-zen-headers=${kernel_version}\""
zfs_replaces='replaces=("spl-linux-zen-git")'
zfs_src_hash="SKIP"
zfs_makedepends="\"git\""
@ -90,6 +88,7 @@ update_linux_git_pkgbuilds() {
git_check_repo
git_calc_pkgver
fi
zfs_utils_pkgname="zfs-utils-common-git=${zfs_git_ver}"
zfs_src_target="git+${zfs_git_url}#commit=${latest_zfs_git_commit}"
zfs_utils_pkgname="zfs-utils-common-git=\${_zfsver}"
zfs_set_commit="_commit='${latest_zfs_git_commit}'"
zfs_src_target="git+${zfs_git_url}#commit=\${_commit}"
}

@ -30,61 +30,58 @@ header="\
# If you have a custom kernel, you will need to change things in the PKGBUILDS. If you would like to have AUR or archzfs repo
# packages for your favorite kernel package built using the archzfs build tools, submit a request in the Issue tracker on the
# archzfs github page.
#
#"
update_linux_pkgbuilds() {
get_linux_kernel_version
kernel_version=${latest_kernel_version}
pkg_list=("spl-linux" "zfs-linux")
get_kernel_options() {
msg "Checking the online package database for the latest x86_64 linux kernel version..."
if ! get_webpage "https://www.archlinux.org/packages/core/x86_64/linux/" "(?<=<h2>linux )[\d\w\.-]+(?=</h2>)"; then
exit 1
fi
kernel_version=${webpage_output}
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version/.arch/-arch}-ARCH"
kernel_mod_path="\${_kernelver/.arch/-arch}-ARCH"
linux_depends="\"linux=\${_kernelver}\""
linux_headers_depends="\"linux-headers=\${_kernelver}\""
}
update_linux_pkgbuilds() {
get_kernel_options
pkg_list=("spl-linux" "zfs-linux")
archzfs_package_group="archzfs-linux"
spl_pkgver=${zol_version}.${kernel_version_full_pkgver}
zfs_pkgver=${zol_version}.${kernel_version_full_pkgver}
spl_pkgver=${zol_version}
zfs_pkgver=${zol_version}
spl_pkgrel=${pkgrel}
zfs_pkgrel=${pkgrel}
spl_conflicts="'spl-linux-git'"
zfs_conflicts="'zfs-linux-git'"
spl_pkgname="spl-linux"
spl_utils_pkgname="spl-utils-common=${zol_version}"
spl_utils_pkgname="spl-utils-common=\${_splver}"
zfs_pkgname="zfs-linux"
zfs_utils_pkgname="zfs-utils-common=${zol_version}"
zfs_utils_pkgname="zfs-utils-common=\${_zfsver}"
# Paths are relative to build.sh
spl_pkgbuild_path="packages/${kernel_name}/${spl_pkgname}"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/spl-${zol_version}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-${zol_version}/zfs-${zol_version}.tar.gz"
spl_workdir="\${srcdir}/spl-${zol_version}"
zfs_workdir="\${srcdir}/zfs-${zol_version}"
linux_depends="\"linux=${kernel_version}\""
linux_headers_depends="\"linux-headers=${kernel_version}\""
spl_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_splver}/spl-\${_splver}.tar.gz"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_zfsver}/zfs-\${_zfsver}.tar.gz"
spl_workdir="\${srcdir}/spl-\${_splver}"
zfs_workdir="\${srcdir}/zfs-\${_zfsver}"
spl_replaces='replaces=("spl-git")'
zfs_replaces='replaces=("zfs-git")'
zfs_makedepends="\"${spl_pkgname}-headers\""
}
update_linux_git_pkgbuilds() {
get_linux_kernel_version
kernel_version=${latest_kernel_version}
get_kernel_options
pkg_list=("zfs-linux-git")
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
kernel_mod_path="${kernel_version/.arch/-arch}-ARCH"
archzfs_package_group="archzfs-linux-git"
zfs_pkgver="" # Set later by call to git_calc_pkgver
zfs_pkgrel=${pkgrel_git}
zfs_conflicts="'zfs-linux' 'spl-linux-git'"
zfs_conflicts="'zfs-linux' 'spl-linux-git' 'spl-linux'"
spl_pkgname=""
zfs_pkgname="zfs-linux-git"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
linux_depends="\"linux=${kernel_version}\""
linux_headers_depends="\"linux-headers=${kernel_version}\""
zfs_replaces='replaces=("spl-linux-git")'
zfs_src_hash="SKIP"
zfs_makedepends="\"git\""
@ -93,6 +90,7 @@ update_linux_git_pkgbuilds() {
git_check_repo
git_calc_pkgver
fi
zfs_utils_pkgname="zfs-utils-common-git=${zfs_git_ver}"
zfs_src_target="git+${zfs_git_url}#commit=${latest_zfs_git_commit}"
zfs_utils_pkgname="zfs-utils-common-git=\${_zfsver}"
zfs_set_commit="_commit='${latest_zfs_git_commit}'"
zfs_src_target="git+${zfs_git_url}#commit=\${_commit}"
}

@ -4,7 +4,12 @@ cat << EOF > ${spl_pkgbuild_path}/PKGBUILD
${header}
pkgbase="${spl_pkgname}"
pkgname=("${spl_pkgname}" "${spl_pkgname}-headers")
pkgver=${spl_pkgver}
_splver="${spl_pkgver}"
_kernelver="${kernel_version}"
_extramodules="${kernel_mod_path}"
pkgver="\${_splver}_\$(echo \${_kernelver} | sed s/-/./g)"
pkgrel=${spl_pkgrel}
makedepends=(${linux_headers_depends} ${spl_makedepends})
arch=("x86_64")
@ -25,8 +30,8 @@ build() {
cd "${spl_workdir}"
./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib --sbindir=/usr/bin \\
--with-linux=/usr/lib/modules/${kernel_mod_path}/build \\
--with-linux-obj=/usr/lib/modules/${kernel_mod_path}/build \\
--with-linux=/usr/lib/modules/\${_extramodules}/build \\
--with-linux-obj=/usr/lib/modules/\${_extramodules}/build \\
--with-config=kernel
make
}
@ -55,7 +60,7 @@ package_${spl_pkgname}-headers() {
rm -r "\${pkgdir}/lib"
# Remove reference to \${srcdir}
sed -i "s+\${srcdir}++" \${pkgdir}/usr/src/spl-*/${kernel_mod_path}/Module.symvers
sed -i "s+\${srcdir}++" \${pkgdir}/usr/src/spl-*/\${_extramodules}/Module.symvers
}
EOF

@ -9,6 +9,7 @@ fi
cat << EOF > ${zfs_dkms_pkgbuild_path}/PKGBUILD
${header}
pkgname="${zfs_pkgname}"
${zfs_set_commit}
pkgdesc="Kernel modules for the Zettabyte File System."
pkgver=${zfs_pkgver}
pkgrel=${zfs_pkgrel}

@ -9,6 +9,7 @@ fi
cat << EOF > ${zfs_utils_pkgbuild_path}/PKGBUILD
${header}
pkgname="${zfs_utils_pkgname}"
${zfs_set_commit}
pkgver=${zfs_pkgver}
pkgrel=${zfs_pkgrel}
pkgdesc="Kernel module support files for the Zettabyte File System."
@ -39,7 +40,7 @@ build() {
./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin --with-mounthelperdir=/usr/bin \\
--libdir=/usr/lib --datadir=/usr/share --includedir=/usr/include \\
--with-udevdir=/lib/udev --libexecdir=/usr/lib/zfs-${zol_version} \\
--with-udevdir=/lib/udev --libexecdir=/usr/lib/zfs-\${pkgver} \\
--with-config=user --enable-systemd
make
}

@ -10,7 +10,13 @@ cat << EOF > ${zfs_pkgbuild_path}/PKGBUILD
${header}
pkgbase="${zfs_pkgname}"
pkgname=("${zfs_pkgname}" "${zfs_pkgname}-headers")
pkgver=${zfs_pkgver}
${zfs_set_commit}
_zfsver="${zfs_pkgver}"
_kernelver="${kernel_version}"
_extramodules="${kernel_mod_path}"
pkgver="\${_zfsver}_\$(echo \${_kernelver} | sed s/-/./g)"
pkgrel=${zfs_pkgrel}
makedepends=(${linux_headers_depends} ${zfs_makedepends})
arch=("x86_64")
@ -31,9 +37,9 @@ build() {
./autogen.sh
./configure --prefix=/usr --sysconfdir=/etc --sbindir=/usr/bin --libdir=/usr/lib \\
--datadir=/usr/share --includedir=/usr/include --with-udevdir=/lib/udev \\
--libexecdir=/usr/lib/zfs-${zol_version} --with-config=kernel \\
--with-linux=/usr/lib/modules/${kernel_mod_path}/build \\
--with-linux-obj=/usr/lib/modules/${kernel_mod_path}/build
--libexecdir=/usr/lib/zfs-\${zfsver} --with-config=kernel \\
--with-linux=/usr/lib/modules/\${_extramodules}/build \\
--with-linux-obj=/usr/lib/modules/\${_extramodules}/build
make
}
@ -63,7 +69,7 @@ package_${zfs_pkgname}-headers() {
rm -r "\${pkgdir}/lib"
# Remove reference to \${srcdir}
sed -i "s+\${srcdir}++" \${pkgdir}/usr/src/zfs-*/${kernel_mod_path}/Module.symvers
sed -i "s+\${srcdir}++" \${pkgdir}/usr/src/zfs-*/\${_extramodules}/Module.symvers
}
EOF

Loading…
Cancel
Save