#!/bin/sh
+if [ "$(id -u)" != "0" -o $HOME != "/root" ]; then
+ echo "This script must be run as root (not sudo) to perform package singning." 1>&2
+ exit 1
+fi
+
+if test ! -f ~/.rpmmacros; then
+ echo "$0: Make sure ~/.rpmmacros file exsits and contains macros from git-tools/update-archive/root-rpmmacros"
+ exit 1
+fi
+
if test ! -x /usr/bin/createrepo; then
echo "$0: /usr/bin/createrepo missing. Install createrepo"
exit 1
fi
+if test ! -x /usr/bin/gpg; then
+ echo "$0: /usr/bin/gpg missing. Install gpg"
+ exit 1
+fi
+
+#check if root has rpm macros
+
confdir=`pwd`
architectures="i386 x86_64"
for vdist in centos/5.5 rhel/5.5; do
mkdir -p $d/${arch}/Packages
for f in $distdir/RPMS/${arch}/*.rpm $distdir/RPMS/noarch/*.rpm; do
if test -f $f; then
+ #rpm --addsign $f
ln -sf $f $d/${arch}/Packages/
has_packages=true
fi
done
createrepo --update $d/${arch}
+ if test -f $d/${arch}/repodata/repomd.xml.asc; then
+ rm $d/${arch}/repodata/repomd.xml.asc
+ fi
gpg --detach-sign -u "Index Data" --armor $d/${arch}/repodata/repomd.xml
done
fi