# runs rpm with minimal macroset
minirpm() {
- # we reset macros not to contain macros.build as all the %() macros are
- # executed here, while none of them are actually needed.
- # at the time of this writing macros.build + macros contained 70 "%(...)" macros.
- safe_macrofiles=$(rpm $TARGET_SWITCH --showrc | awk -F: '/^macrofiles/ { gsub(/^macrofiles[ \t]+:/, "", $0); gsub(/:.*macros.build:/, ":", $0); print $0 } ')
+ safe_macrofiles=$(rpm $TARGET_SWITCH --showrc | awk -F: '/^macrofiles/ { gsub(/^macrofiles[ \t]+:/, "", $0); print $0 } ')
# TODO: move these to /usr/lib/rpm/macros
cat > $BUILDER_MACROS <<'EOF'
fi
}
+init_repository() {
+ local remoterepo=$1
+ local localrepo=$2
+
+ if [ ! -e $localrepo ]; then
+ git clone -o $REMOTE_PLD ${GIT_SERVER}/$remoterepo $localrepo
+ git --git-dir=$localrepo/.git remote set-url --push $REMOTE_PLD ssh://${GIT_PUSH}/$remoterepo
+ fi
+}
+
init_rpm_dir() {
local TOP_DIR=$(eval $RPM $RPMOPTS --eval '%{_topdir}')
local rpmdir=$(eval $RPM $RPMOPTS --eval '%{_rpmdir}')
local buildir=$(eval $RPM $RPMOPTS --eval '%{_builddir}')
local srpmdir=$(eval $RPM $RPMOPTS --eval '%{_srcrpmdir}')
+ local TEMPLATES=template-specs
local tmp
echo "Initializing rpm directories to $TOP_DIR from $GIT_SERVER"
mkdir -p $TOP_DIR $rpmdir $buildir $srpmdir
cd "$TOP_DIR"
- if [ ! -e ../rpm-build-tools ]; then
- git clone ${GIT_SERVER}/${PACKAGES_DIR}/rpm-build-tools.git ../rpm-build-tools
- fi
+ init_repository ${PACKAGES_DIR}/rpm-build-tools.git ../rpm-build-tools
+ init_repository projects/$TEMPLATES ../$TEMPLATES
for a in adapter builder fetchsrc_request compile repackage; do
ln -sf ../rpm-build-tools/${a}.sh $a
done