X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=create_manifest_rpm.sh;fp=create_manifest_rpm.sh;h=b7ac2130ac1f66174bf219c4f0bb077f17a2a7ea;hb=900738828f48bade06f69c1e3a8f6fb988b97950;hp=0000000000000000000000000000000000000000;hpb=c9329b7df4c8a39f97f0c16fc2b14b3ca25d9896;p=ta%2Fbuild-tools.git diff --git a/create_manifest_rpm.sh b/create_manifest_rpm.sh new file mode 100755 index 0000000..b7ac213 --- /dev/null +++ b/create_manifest_rpm.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2019 Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x +set -eu + +scriptdir="$(dirname $(readlink -f ${BASH_SOURCE[0]}))" +source $scriptdir/lib.sh + +work=${1:-$WORKTMP/manifest-work} +work=$(readlink -f $work) +rm -rf $work +mkdir -p $work +cp -f $MANIFEST_PATH/*.spec $work + +$scriptdir/create_mock_config.sh $MANIFEST_PATH/build_config.ini $work/mock_config + +rpm_macros=$work/rpmmacros +$scriptdir/mock2rpmbuild_config.py --mock-config $work/mock_config/mock.cfg --output-file-path $rpm_macros + +docker run --rm \ + -v $rpm_macros:/root/.rpmmacros \ + -v $work:/work \ + alpine:3.9.4 \ + sh -c '\ + apk add rpm && \ + rpmbuild --build-in-place --rmspec -ba /work/*.spec && \ + find /root/rpmbuild -name "*.rpm" | xargs -I "{}" mv {} /work' + +_add_rpms_to_localrepo $(find $work -name '*.rpm')