Commit 70d33932 authored by Dennis Klein's avatar Dennis Klein
Browse files

Add dds

parent c601011e
build/
result/
[submodule "packages/fairlogger"]
path = packages/fairlogger
url = git@git.gsi.de:SDE/packages/fairlogger.git
[submodule "packages/dds"]
path = packages/dds
url = git@git.gsi.de:SDE/packages/dds.git
#!/bin/bash
tree=${HOME}/rpmbuild
rpmdev-setuptree
rpmdev-wipetree
mock=fedora-32-x86_64
function build_srpm() {
pkg=$1
name=$(rpmspec -q --srpm --qf "%{name}" packages/${pkg}/*.spec)
version=$(rpmspec -q --srpm --qf "%{version}" packages/${pkg}/*.spec)
tarball=$(rpmspec -q --srpm --qf "%{source}" packages/${pkg}/*.spec)
url=$(rpmspec -q --srpm --qf "%{url}" packages/${pkg}/*.spec)
tmpdir=$(mktemp -d)
pushd ${tmpdir}
git clone -b v${version} --depth 1 ${url} ${name}-${version}
tar cvzf ${tarball} ${name}-${version}
mv ${tarball} ${tree}/SOURCES
popd
rm -rf ${tmpdir}
cp packages/${pkg}/${pkg}.spec ${tree}/SPECS
mock -r ${mock} --macro-file=macros --buildsrpm --spec ${tree}/SPECS/${pkg}.spec --sources ${tree}/SOURCES
mv /var/lib/mock/${mock}/result/${name}*.src.rpm ${tree}/SRPMS
}
function build_rpms() {
pkg=$1
name=$(rpmspec -q --srpm --qf "%{name}" packages/${pkg}/*.spec)
arch=$(rpmspec -q --srpm --qf "%{arch}" packages/${pkg}/*.spec)
mock -r ${mock} --macro-file=macros --rebuild ${tree}/SRPMS/${name}*.src.rpm
mv /var/lib/mock/${mock}/result/*${arch}.rpm ${tree}/RPMS
}
function build() {
pkg=$1
tree -h ${tree}
build_srpm fairlogger
build_rpms fairlogger
mock -r ${mock} --macro-file=macros --clean
}
build fairlogger
tree -h ${tree}
#!/bin/bash
rpmspec --srpm -q --load=macros --qf "%-30{NAME}%{version}\n" packages/*/*.spec
echo
tree -h ${HOME}/rpmbuild
Subproject commit 63dd70f57102433fd0a940f889deb4a4391fe879
#!/bin/bash
tree=${HOME}/rpmbuild
tree -h ${tree}
rpm --resign ${tree}/RPMS/*.rpm
pushd ${tree}/RPMS
createrepo --update .
gpg --batch --yes --detach-sign --armor repodata/repomd.xml
gpg --armor --export d.klein@gsi.de > repo.key
popd
tree -h ${tree}
echo
du -hs ${tree}/RPMS
#!/bin/bash
__DIR__="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. ${__DIR__}/common.sh
function build_srpm() {
version=$(${rpmspec} -q --srpm --qf "%{version}" ${spec})
tarball=$(${rpmspec} -q --srpm --qf "%{source}" ${spec})
url=$(${rpmspec} -q --srpm --qf "%{url}" ${spec})
(
pushd ${sources}
if [[ -n "$(grep '^%define gh_repo_url ' ${spec})" ]]; then
cloneversion=v${version}
git clone -b ${cloneversion} --depth 1 ${url} ${name}-${version}
tar cvzf ${tarball} ${name}-${version}
rm -rf ${name}-${version}
fi
pushd $(dirname ${spec})
spectool -g -C ${sources} ${spec}
cp *.patch ${sources} || true
cp *tar* ${sources} || true
popd
popd
) > ${sources}/log 2>&1
${mock} -q --buildsrpm --spec ${spec} --sources ${sources} --resultdir ${buildresultsrpm}
}
function build_rpms() {
${mock} -q --rebuild ${buildresultsrpm}/${name}*.src.rpm --resultdir ${buildresultrpms} ${mockaddrepo}
rm -f ${buildresultrpms}/*.src.rpm
}
function build_repos() {
gpgname=$(rpm --eval "%{_gpg_name}")
rpms=${binrepo}/packages
mkdir -p ${rpms}
cp ${buildresultrpms}/*.rpm ${rpms}
rpm --resign ${rpms}/*.rpm
pushd ${binrepo}
rm -rf repodata
createrepo --update .
gpg --batch --yes --detach-sign --armor repodata/repomd.xml
gpg --armor --export ${gpgname} > RPM-GPG-KEY
sha256sum --tag RPM-GPG-KEY > RPM-GPG-KEY-CHECKSUM.txt
popd
srpm=${sourcerepo}/packages
mkdir -p ${srpm}
cp ${buildresultsrpm}/*.src.rpm ${srpm}
rpm --resign ${srpm}/*.rpm
pushd ${sourcerepo}
rm -rf repodata
createrepo --update .
gpg --batch --yes --detach-sign --armor repodata/repomd.xml
gpg --armor --export ${gpgname} > RPM-GPG-KEY
sha256sum --tag RPM-GPG-KEY > RPM-GPG-KEY-CHECKSUM.txt
popd
}
function build() {
pkg=$1
spec=${pkgdir}/${pkg}/${pkg}.spec
echo ">>> Building ${spec}"
name=$(${rpmspec} -q --srpm --qf "%{name}" ${spec})
arch=$(${rpmspec} -q --srpm --qf "%{arch}" ${spec})
sources=${builddir}/${pkg}/SOURCES
mkdir -p ${sources}
buildresultsrpm=${builddir}/${pkg}/SRPMS
mkdir -p ${buildresultsrpm}
buildresultrpms=${builddir}/${pkg}/RPMS
mkdir -p ${buildresultrpms}
binrepo=${resultdir}/${reponame}
mkdir -p ${binrepo}
sourcerepo=${resultdir}/${reponame}-source
mkdir -p ${sourcerepo}
if [[ -n "$(ls -A ${binrepo})" ]]; then
mockaddrepo="--addrepo=${binrepo}"
fi
build_srpm
build_rpms
build_repos
}
# build fairlogger
build dds
#!/bin/bash
__DIR__="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. ${__DIR__}/common.sh
rm -rf ${builddir}/* ${resultdir}/*
${mock} --clean
status
#!/bin/bash
__DIR__="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
if [[ -z "$(rpm --eval '%{?fedora}')" ]]; then
echo "Error: Only supported on Fedora for now!"
exit 1
fi
set -e
pkgdir=$(readlink -f ${__DIR__}/../packages)
scriptdir=${__DIR__}
repodir=$(readlink -f ${__DIR__}/..)
repobasename=fairsoft
gitbranch=$(git branch --show-current)
if [[ master == "${gitbranch}" ]]; then
repoflavor=dev
else
repoflavor=${gitbranch}
fi
reponame=${repobasename}-${repoflavor}
os=fedora
releasever=$(rpm --eval "%{fedora}")
arch=$(rpm --eval "%{_arch}")
mockroot=${os}-${releasever}-${arch}
builddir=${repodir}/build/${mockroot}
resultdir=${repodir}/result/${mockroot}
mock="mock -r ${mockroot} --macro-file=${scriptdir}/macros"
rpmspec="rpmspec --load=${scriptdir}/macros"
mkdir -p ${builddir}
mkdir -p ${resultdir}
function status() {
echo
tree -h ${builddir} ${resultdir}
echo
du -hs ${builddir} ${resultdir}
}
#!/bin/bash
__DIR__="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. ${__DIR__}/common.sh
${rpmspec} --srpm -q --qf "%-20{NAME}%{version}\n" packages/*/*.spec
status
#!/bin/bash
dnf install gcc rpm-build rpm-devel rpm-sign rpmlint make python bash coreutils diffutils patch rpmdevtools mock
dnf install gcc rpm-build rpm-devel rpm-sign rpmlint make python bash coreutils diffutils patch rpmdevtools mock tree
#!/bin/bash
__DIR__="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
. ${__DIR__}/common.sh
${mock} -q --update
#!/bin/bash
mock -r fedora-32-x86_64 --update
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment