Whamcloud - gitweb
LU-9859 libcfs: move kernel specific code out of libcfs core
[fs/lustre-release.git] / contrib / lbuild / lbuild-openeuler
1 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
2 source ${LBUILD_DIR}/lbuild-rhel
3
4 DEVEL_PATH_ARCH_DELIMETER="."
5 RPM_HELPERS_DIR="/usr/lib/rpm/openEuler"
6 # Pkg which contains ext4 source code
7 KERNEL_DEBUGINFO="kernel-debugsource-${lnxmaj}-${lnxrel}.${TARGET_ARCH}.rpm"
8
9 # force local definition of %dist into ~/.rpmmacros
10 # to avoid verbose extended strings like ".el9.centos"
11 # in kernel version and rpm names
12 RMAC=$HOME/.rpmmacros
13 grep '^%dist' $RMAC &> /dev/null || echo "%dist .${DISTRO/./}" >> $RMAC
14
15 kernel_debuginfo_location() {
16         local base_url="https://repo.openeuler.org"
17         local distro=${DISTRO^^}
18     # convert OEYYMM.SPx to openEuler-YY.MM-LTS-SPx
19     distro=$(echo $distro | sed -E -e 's/OE/openEuler-/' \
20                 -e 's/([0-9]{2})([0-9]{2})/\1.\2-/' \
21                 -e 's/.(SP[0-9]+)/LTS-\1/')
22
23         echo "${base_url}/${distro}/update/$TARGET_ARCH/Packages"
24 }
25
26
27 eval "$(cat <<EOF
28 unpack_linux_devel_rpm-${DISTROMAJ}() {
29     local callers_rpm="\$1"
30
31     unpack_linux_devel_rpm-rhel "\$callers_rpm"
32 }
33
34 find_linux_rpm-${DISTROMAJ}() {
35         local prefix="\$1"
36         local wanted_kernel="\$2"
37         local pathtorpms=\${3:-"\$KERNELRPMSBASE/\$lnxmaj/\$DISTROMAJ/\$TARGET_ARCH"}
38
39         find_linux_rpm-rhel "\$prefix" "\$wanted_kernel" "\$pathtorpms"
40 }
41 EOF
42 )"