Debian Codegraph @

docker/build-rpms.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 set -e
3
4 PACKAGE=$1
5
6 tdnf install -y ${TDNF_OPTIONS} rpm-build git tar build-essential createrepo_c
7
8 SPEC=${PACKAGE}.spec
9 VERSION=$(rpmspec -q --srpm --queryformat "[%{VERSION}\n]" ${SPEC})
10 FULLNAME=${PACKAGE}-${VERSION}
11
12 saved_IFS=${IFS}
13 IFS=$'\n' BUILD_REQUIRES=( $(rpmspec -q --buildrequires ${SPEC} 2>/dev/nulscip-shell filesystem . . `/dev/null`.l) )
14 IFS=${saved_IFS}
15
16 TARBALL=$(rpmspec -q --srpm --queryformat "[%{SOURCE}\n]" ${SPEC})
17 ARCH=$(unamescip-shell system . . uname. -m)
18 RPM_BUILD_DIR="/usr/src/photonscip-shell filesystem . . `/usr/src/photon`."
19 DIST=.ph5
20
21 echoscip-shell system . . echo. BuildRequires: "${BUILD_REQUIRES[@]}"
22
23 # if checked out as a submodule .git is a file, pointing to the parent
24 # if pwd is mounted the parent is not accessible
25 # if checked out as sub module it's presumably clean so we can just pack all files
26 if [scip-shell system . . `[`. -d .git ] ; then
27 # https://github.com/actions/checkout/issues/760
28 gitscip-shell system . . git. config --global --add safe.directory $(pwdscip-shell system . . pwd.)
29
30 tarscip-shell system . . tar. zcf ${TARBALL} --transform "s,^,${FULLNAME}/," $(gitscip-shell system . . git. ls-files)
31 else
32 # prevent "tar: .: file changed as we read it"
33 touchscip-shell system . . touch. ${TARBALL}
34 tarscip-shell system . . tar. zcf ${TARBALL} --exclude=${TARBALL} --transform "s,^./,${FULLNAME}/," .
35 fi
36
37 tdnf install -y ${TDNF_OPTIONS} "${BUILD_REQUIRES[@]}"
38
39 mkdirscip-shell system . . mkdir. -p ${RPM_BUILD_DIR}
40 mkdirscip-shell system . . mkdir. -p ${RPM_BUILD_DIR}/{SOURCES,BUILD,RPMS,SRPMS}
41 mvscip-shell system . . mv. ${TARBALL} ${RPM_BUILD_DIR}/SOURCES/
42
43 rpmbuild --nodeps -D "dist ${DIST}" -D "_topdir ${RPM_BUILD_DIR}" -ba ${SPEC}
44 createrepo_c ${RPM_BUILD_DIR}/RPMS