if test -f debian/.gitignore; then
cd debian; for i in `cat .gitignore`; do rm -fr $i; done; cd ..
fi
-if test -d deb-src; then
- echo "deb-src exist. You might remove it"
- exit 1
-fi
l=`head -1 $DEBCHANGELOG`
PROD=`echo $l|sed 's/ .*//g'`
VERSION=`echo $l|sed 's/.*(//g'|sed 's/).*//g'`
exit 1
fi
set -e
-mkdir deb-src
+mkdir -p deb-src
ORIG=${PROD}_${MAJOR}.orig.tar.gz
echo "TAR=$TAR"
echo "ORIG=$ORIG"
Options:
[--debian=distros]
[--ubuntu=distros]
+ [--centos=distros]
[--upload]
[--concurrency=N]
[--product=X]
upload=false
do_help=false
concurrency=4
+ARCHS="i386 amd64"
if test -f IDMETA; then
. ./IDMETA
--ubuntu=*)
UBUNTU_DIST=$optarg
;;
+ --centos=*)
+ CENTOS_DIST=$optarg
+ ;;
--upload)
upload=true
;;
fi
if $upload; then
- cd deb-src
+ :
else
if test "${SUDO_USER}"; then
if test ! -d deb-src; then
fi
else
if test -d deb-src; then
- rm -rf deb-src
+ rm -f deb-src/*.gz
if test $? -ne 0; then
echo "deb-src could not be removed. Remove deb-src manually"
exit 1
fi
$MKDEBSRC
fi
- cd deb-src
fi
+cd deb-src
for f in *.dsc; do
if test -f "$f"; then
if test -z "$PRODUCT"; then
PRODUCT=`echo *.dsc|sed 's/_.*//g'`
fi
-ARCHS="i386 amd64"
if grep "Architecture: all" $PKG >/dev/null; then
USE_ARCHS=i386
else
echo "Dsc $PKG . Product $PRODUCT"
echo "Ubuntu distros: $UBUNTU_DIST"
echo "Debian distros: $DEBIAN_DIST"
+echo "Centos distros: $CENTOS_DIST"
if test "${SUDO_USER}"; then
echo "Running as sudo."
echo "Tip: You can avoid it by adding the following in /etc/sudoers"
fi
if $upload; then
+ for dist in ${CENTOS_DIST}; do
+ arch=amd64
+ prodver=${PRODUCT}-${VERSION}
+ if ssh $dist "cd rpmbuild/SOURCES/${prodver} && ../../../proj/git-tools/id-rpm-build/upload-rpms.sh ${PRODUCT}.spec"; then
+ :
+ else
+ echo "Upload failed for $dist"
+ exit 1
+ fi
+ done
for dist in ${UBUNTU_DIST}; do
scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/ubuntu/${dist}
done
done
echo ""
echo "===================================================="
- echo "Remember to update APT on ftp.indexdata.dk !!!"
+ echo "Remember to update APT/YUM on ftp.indexdata.dk !!!"
echo ""
echo "ssh ftp.indexdata.dk"
echo "cd ~/proj/git-tools/update-archive"
echo "sudo su"
echo "./update-archive.sh"
+ if test ${CENTOS_DIST}; then
+ echo "./update-yum-archive.sh"
+ fi
echo "===================================================="
exit 0
fi
+
rm -f *.log
+# copy tars to centos build hosts
+for dist in ${CENTOS_DIST}; do
+ arch=amd64
+ prodver=${PRODUCT}-${VERSION}
+ tarname=${prodver}.tar.gz
+ if test ! -f ../${tarname}; then
+ echo "$tarname: missing"
+ exit 1
+ fi
+
+ if ssh $dist "test -f .rpmmacros && test -d rpmbuild/SOURCES && test -d rpmbuild/RPMS && test -d rpmbuild/SRPMS && test -x proj/git-tools/id-rpm-build/upload-rpms.sh"; then
+ :
+ else
+ echo "Host $dist does not seem to be prepared with git-tools and rpmbuild directories"
+ exit 1
+ fi
+
+ if scp ../${tarname} $dist:rpmbuild/SOURCES/ ; then
+ :
+ else
+ echo "Could not copy $tarname to $dist"
+ exit 1
+ fi
+ if ssh $dist "cd rpmbuild/SOURCES && rm -fr $prodver && tar zxf $tarname && cd ${prodver} && rpmbuild -ba ${PRODUCT}.spec" >${dist}-${arch}.log 2>&1; then
+ :
+ else
+ echo "FAILED: See ${dist}-${arch}.log"
+ exit 1
+ fi
+done
+
# call our privileged wrapper to clean the directories, no --dsc option
for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do
for arch in ${USE_ARCHS}; do
fi
done
done
+
date
echo "Done"
# Local Variables:
#we will keep this to get the project name
DEBCHANGELOG=debian/changelog
-l=`head -1 $DEBCHANGELOG`
if [ "x$NAME" != x ]; then
echo "Got name $NAME from IDMETA file"
else
- NAME=`echo $l|sed 's/ .*//g'`
- echo "Warning: assuming name $NAME from debian/changelog"
+ NAME=`head -1 $DEBCHANGELOG|sed 's/ .*//g'`
+ echo "Warning: assuming name $NAME from $DEBCHANGELOG"
fi
if [ "x$2" != x ]; then
if [ "x$VERSION" != x ]; then
echo "Got version $VERSION from IDMETA file"
else
- FULLVERSION=`echo $l|sed 's/.*(//g'|sed 's/).*//g'`
+ FULLVERSION=`head -1 $DEBCHANGELOG|sed 's/.*(//g'|sed 's/).*//g'`
VERSION=`echo $FULLVERSION|sed 's/-.*//g'`
- echo "Warning: assuming version $VERSION from debian/changelog"
+ echo "Warning: assuming version $VERSION from $DEBCHANGELOG"
fi
if [ "x$1" != x ]; then
VERSION=$1
fi
+trap 'rm -f tmp.tar' 0
git archive --format=tar --prefix=$NAME-$VERSION/ v${VERSION} > tmp.tar || die "This version is not tagged in Git";
tar xf tmp.tar
rm tmp.tar
for file in debian $OMIT_FROM_DIST; do
- echo "Omitting $file from distribution"
- rm -r $NAME-$VERSION/$file
+ if [ -e "$file" ]; then
+ echo "Omitting $file from distribution"
+ rm -r $NAME-$VERSION/$file
+ fi
done
tar cfz $NAME-$VERSION.tar.gz $NAME-$VERSION
rm -r $NAME-$VERSION
# http://releases.ubuntu.com/releases/
case "$DIST" in
- oneiric|natty|maverick|lucid|karmic) # ubuntu specific
+ precise|oneiric|natty|maverick|lucid|karmic) # ubuntu specific
# MIRRORSITE="http://ftp.df.lth.se/ubuntu/"
- MIRRORSITE="http://mirrors.telianet.dk/ubuntu/"
+ MIRRORSITE="http://mirrors.dotsrc.org/ubuntu/"
# MIRRORSITE="http://mirrors.kernel.org/ubuntu/"
COMPONENTS="main restricted universe multiverse"
OTHERMIRROR="deb http://ftp.indexdata.dk/ubuntu $DIST main"
architectures="i386 amd64"
-for vdist in ubuntu/karmic ubuntu/lucid ubuntu/maverick ubuntu/natty ubuntu/oneiric debian/wheezy debian/squeeze debian/lenny debian/etch; do
+for vdist in ubuntu/karmic ubuntu/lucid ubuntu/maverick \
+ ubuntu/natty ubuntu/oneiric ubuntu/precise \
+ debian/wheezy debian/squeeze debian/lenny \
+ debian/etch; do
dist=`basename $vdist`
vendor=`dirname $vdist`
ftpdir=/home/ftp/pub/$vendor