Upgrade to 20211125 version

(cherry picked from commit 02ed363eee63447feb7437f217285a12fcc2576b)
This commit is contained in:
houyingchao 2022-01-15 14:33:30 +08:00 committed by openeuler-sync-bot
parent 2116da2ad8
commit a1caf4dc53
5 changed files with 9 additions and 106 deletions

View File

@ -1,29 +0,0 @@
From 2372a1ac834d17d99899275685606f5ebb15f265 Mon Sep 17 00:00:00 2001
From: jeff200902 <jeff200902@163.com>
Date: Mon, 27 Jul 2020 18:59:20 +0800
Subject: [PATCH] modify for osb build
---
build | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/build b/build
index 9b2d0f2..df9ce59 100755
--- a/build
+++ b/build
@@ -1549,6 +1549,12 @@ if test \( -n "$RPMS" -o -n "$DEBS" \) -a -n "$CREATE_BASELIBS"; then
create_baselibs
fi
+if test -f "$BUILD_ROOT/etc/resolv.conf"; then
+ cat $BUILD_ROOT/etc/resolv.conf
+else
+ cp /etc/resolv.conf $BUILD_ROOT/etc/
+fi
+
exitcode=0
# post build work
--
2.23.0

View File

@ -1,68 +0,0 @@
diff --git a/build b/build
index 6f1b474..5191c0d 100755
--- a/build
+++ b/build
@@ -434,6 +434,7 @@ cleanup_and_exit () {
umount -n $BUILD_ROOT/dev/pts 2>/dev/null || true
umount -n $BUILD_ROOT/dev/shm 2>/dev/null || true
umount -n $BUILD_ROOT/sys 2>/dev/null || true
+ umount -n $BUILD_ROOT/home/abuild/.ccache 2>/dev/null || true
test -n "$VM_ROOT" -a "$VM_ROOT" != 1 && umount $BUILD_ROOT 2>/dev/null || true
test -n "$VM_TYPE" && vm_cleanup
fi
@@ -1360,6 +1361,7 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
mkdir -p $BUILD_ROOT/home/abuild/.m2
chown $ABUILD_UID:$ABUILD_GID $BUILD_ROOT/home/abuild/.m2
cp $BUILD_DIR/settings.xml $BUILD_ROOT/home/abuild/.m2/
+ build-ccache "$BUILD_ROOT" "$REASON" "$ABUILD_UID" "$ABUILD_GID"
BUILD_USER_ABUILD_USED=true
else
# building as root
diff --git a/build-ccache b/build-ccache
new file mode 100755
index 0000000..7293d01
--- /dev/null
+++ b/build-ccache
@@ -0,0 +1,42 @@
+#!/bin/bash
+# Script to setup ccache.
+#
+# BUILD_ROOT here the packages will be built
+# REASON here the reason of the build
+# eg: "building {package} for '{project}' repository '{repository}' arch '{arch}' srcmd5 '{md5}'
+#
+################################################################
+
+BUILD_ROOT=$1
+REASON=$2
+ABUILD_UID=$3
+ABUILD_GID=$4
+
+CCACHE_HOME_DIR=/home/abuild/.ccache
+
+package=`echo $REASON |awk '{print $2}'`
+project=`echo $REASON |awk '{print $5}'`
+project=${project//\'/}
+
+# check ccache
+if [[ -d /srv/ccache/$project ]] && [[ -e $BUILD_ROOT/usr/bin/ccache ]] && [[ ! -z $project ]] && [[ ! -z $package ]]
+then
+ # openjdk-11 excluded
+ if [[ $package == "openjdk-11" ]]
+ then
+ exit
+ fi
+
+ echo "Building $package for $project using ccache"
+
+ # mount ccache home dir to obs-worker directory
+ mkdir -p ${BUILD_ROOT}${CCACHE_HOME_DIR}
+ chown $ABUILD_UID:$ABUILD_GID ${BUILD_ROOT}${CCACHE_HOME_DIR}
+ mount --bind /srv/ccache/$project ${BUILD_ROOT}${CCACHE_HOME_DIR}
+
+ # link all compilers to ccache
+ cp $BUILD_ROOT/usr/bin/ccache $BUILD_ROOT/usr/local/bin
+ for compiler in $(ls $BUILD_ROOT/usr/bin | grep -E '^(cc|gcc|[cg][+][+]|clang|clang[+][+])([-]?[234][.]?[0-9])*$'); do
+ ln -sf ccache $BUILD_ROOT/usr/local/bin/$compiler
+ done
+fi

BIN
20211125.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,16 +1,14 @@
Name: build
Version: 20191114
Release: 324.6
Version: 20211125
Release: 1
Summary: A tool to build binary packages
License: GPL-2.0-only OR GPL-3.0-only
Url: https://github.com/openSUSE/obs-build
Source: obs-build-%{version}.tar.gz
Patch0000: 0001-modify-for-obs-build.patch
Source: https://github.com/openSUSE/obs-build/archive/refs/tags/%{version}.tar.gz
Patch0001: 0001-add-settings.patch
Patch0002: 0002-ccache-for-obs-build.patch
BuildArch: noarch
Requires: bash binutils perl tar psmisc build-mkbaselibs
BuildRequires: bash binutils perl psmisc tar
BuildRequires: bash binutils perl psmisc tar perl-libwww-perl
%description
This is a tool to build binary packages in a safe and reproducible
@ -77,8 +75,8 @@ sed -i 's,build-mkbaselibs,,' configs/*.conf
%{_bindir}/build
%{_bindir}/buildvc
%{_bindir}/unrpm
%{_bindir}/pbuild
/usr/lib/build
%config(noreplace) /usr/lib/build/emulator/emulator.sh
%exclude /usr/lib/build/mkbaselibs
%exclude /usr/lib/build/baselibs*
%exclude /usr/lib/build/mkdrpms
@ -92,16 +90,18 @@ sed -i 's,build-mkbaselibs,,' configs/*.conf
%files mkdrpms
%defattr(-,root,root)
%dir /usr/lib/build
/usr/lib/build/mkdrpms
%files help
%defattr(-,root,root)
%doc README
%{_mandir}/man1/build.1*
%{_mandir}/man1/unrpm.1*
%{_mandir}/man1/buildvc.1*
%{_mandir}/man1/pbuild.1.gz
%changelog
* Sat Jan 15 2022 houyingchao <houyingchao@huawei.com> - 20211125-1
- Upgrade to 20211125 version
* Thu Jan 07 2021 openEuler miao_kaibo <miaokaibo@outlook.com> - 20191114-324.5
- Add settings.xml for jar