uppbox: lbbuild update

git-svn-id: svn://ultimatepp.org/upp/trunk@2113 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-02-21 18:45:50 +00:00
parent a79370d55c
commit b602fc63da
2 changed files with 147 additions and 144 deletions

View file

@ -1,144 +1,144 @@
#!/bin/bash
#setup some variables, paths, etc. first:
#upp server setting guesses:
THEIDE="~/bin/theide" # where is theide executable
SRC_PATH="/home/upp/upp.tmp/u" # where to look for sources
BM="GCCMK" # what build method to use
ASEMBLY="uppsrc" # just in case we wan't to build from different assembly
VER="`svnversion ~/upp.src`" # this is obvious, isn't it?
BUILD="1" # increment this when building version which is already in launchpad (BUGGY! do not touch, please)
SERIES=( hardy intrepid jaunty karmic lucid )
# my local setup (for debuging)
#~ THEIDE="/tmp/theide"
#~ SRC_PATH="/media/data/temp/uppsvn"
#~ BM="GCC"
#~ ASEMBLY="uppsrc-svn"
#~ VER="`svnversion $SRC_PATH`"
#~ VER="2050"
#~ BUILD="1"
#~ SERIES=( karmic )
echo "Debian source package builder"
echo "written by Jan Dolinar (dolik.rce), 2010"
# setup some variables for later
tmpdir="`mktemp -t -d lpbuild.XXXXXXX`"
tmp=$tmpdir/upp-$VER
orig="$tmp/../upp_$VER.orig.tar.gz"
scriptpath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")" #not from my head:-)
scriptdir=`dirname "$scriptpath"`
subfolders=( uppsrc examples tutorial reference bazaar )
# create dir for sources
mkdir $tmp
# copy source files to tmp folder
# rsync takes care about .svn subdirs
echo -n "copying sources:"
for folder in ${subfolders[@]}
do
echo -n " $folder"
rsync -rl --exclude '.svn' $SRC_PATH/$folder $tmp > /dev/null
done
echo
# create Makefile for theide
echo "Creating makefile ..."
$THEIDE $ASEMBLY ide $BM ">GUI,MT" -srxM $tmp/uppsrc
# get changelog from svn
echo "Creating changelog ..."
cd $SRC_PATH
svn -l 100 --xml -v log |python $scriptdir/svn2log.py \
-u $scriptdir/users.lst -P upp -L -d ultimatepp.org -S all -p /trunk/ \
-i "`echo ${subfolders[@]} |tr \" \" ,`" -o $tmp/changelog
# Patch the version.h for original tarball
mv $tmp/uppsrc/ide/version.h $tmpdir/version.h.backup
echo "#define IDE_VERSION \"$VER\"" > $tmp/uppsrc/ide/version.h
# compress the sources and Makefile to get orig.tar.gz
echo "Compressing original source tarball ..."
cd $tmp
tar -czf $orig ${subfolders[@]} #Makefile
# restore backed-up ide/version.h
rm $tmp/uppsrc/ide/version.h
mv $tmpdir/version.h.backup $tmp/uppsrc/ide/version.h
# prepare architecture independent part of debian directory:
echo "Debianizing source tree ..."
mkdir $tmp/debian
# copy maintainer scripts and control file
cp $scriptdir/{postinst,prerm,control,rules,theide.desktop,theide.1} $tmp/debian
chmod +x $scriptdir/{postinst,prerm,rules}
# generate copyrightfile
cat > $tmp/debian/copyright << EOF
This package was debianized by Jan Dolinar <dolik.rce@seznam.cz>
on `date -R`.
Copyright © 1999-2010 Ultimate++ team (http://ultimatepp.org)
Authors: Mirek Fidler, Tomas Rylek, Daniel Kos
License: BSD (please see /usr/share/common-licenses/BSD).
EOF
# cycle through series to build and call archdep to prepare the
# architecture depedent stuff
for dist in ${SERIES[@]}
do
version=$VER"~ppa"$BUILD"~"$dist"1"
# save complete version string to ide/version.h
mv $tmp/uppsrc/ide/version.h $tmpdir/version.h.backup
echo "#define IDE_VERSION \"$version\"" > $tmp/uppsrc/ide/version.h
# generate changelog (with changes in packaging, not in sources!)
cat > "$tmp/debian/changelog" << EOF
upp ($version) $dist; urgency=low
* Updated to version $VER
-- Jan Dolinar <dolik.rce@seznam.cz> `date -R`
EOF
# generate debian/dopack script
cat > "$tmp/debian/dopack" << EOF
#!/bin/bash
VERSION="$VER"
MAINTAINER="Jan Dolinar"
EMAIL="dolik.rce@seznam.cz"
SERIES="$dist"
BUILD="$BUILD"
release="$version"
EOF
cat "$scriptdir/dopack-stub" >> $tmp/debian/dopack
# call debuild to create the package
echo "Packaging upp $version ..."
cd $tmp
debuild --no-lintian -sgpg -pgpg-extpass -S
# upload to launchpad ("-s"=simulate, use for debugging)
echo "Uploading upp $version ..."
cd $tmpdir
dput "upp-$dist" "upp_"$version"_source.changes"
# remove architecture dependent files
rm $tmp/debian/{dopack,changelog}
#restore backed-up ide/version.h
rm $tmp/uppsrc/ide/version.h
mv $tmpdir/version.h.backup $tmp/uppsrc/ide/version.h
done
# clean up temporary files
echo "Cleaning up ..."
rm -rf $tmpdir
echo "FINISHED!"
#!/bin/bash
#setup some variables, paths, etc. first:
#upp server setting guesses:
THEIDE="~/bin/theide" # where is theide executable
SRC_PATH="/home/upp/upp.tmp/u" # where to look for sources
BM="GCCMK" # what build method to use
ASEMBLY="uppsrc" # just in case we wan't to build from different assembly
VER="`svnversion ~/upp.src`" # this is obvious, isn't it?
BUILD="1" # increment this when building version which is already in launchpad (BUGGY! do not touch, please)
SERIES=( hardy intrepid jaunty karmic lucid )
# my local setup (for debuging)
#~ THEIDE="/tmp/theide"
#~ SRC_PATH="/media/data/temp/uppsvn"
#~ BM="GCC"
#~ ASEMBLY="uppsrc-svn"
#~ VER="`svnversion $SRC_PATH`"
#~ VER="2050"
#~ BUILD="1"
#~ SERIES=( karmic )
echo "Debian source package builder"
echo "written by Jan Dolinar (dolik.rce), 2010"
# setup some variables for later
tmpdir="`mktemp -t -d lpbuild.XXXXXXX`"
tmp=$tmpdir/upp-$VER
orig="$tmp/../upp_$VER.orig.tar.gz"
scriptpath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")" #not from my head:-)
scriptdir=`dirname "$scriptpath"`
subfolders=( uppsrc examples tutorial reference bazaar )
# create dir for sources
mkdir $tmp
# copy source files to tmp folder
# rsync takes care about .svn subdirs
echo -n "copying sources:"
for folder in ${subfolders[@]}
do
echo -n " $folder"
rsync -rl --exclude '.svn' $SRC_PATH/$folder $tmp > /dev/null
done
echo
# create Makefile for theide
echo "Creating makefile ..."
$THEIDE $ASEMBLY ide $BM ">GUI,MT" -srxM $tmp/uppsrc
# get changelog from svn
echo "Creating changelog ..."
cd $SRC_PATH
svn --limit 100 --xml -v log |python $scriptdir/svn2log.py \
-u $scriptdir/users.lst -P upp -L -d ultimatepp.org -S all -p /trunk/ \
-i "`echo ${subfolders[@]} |tr \" \" ,`" -o $tmp/changelog
# Patch the version.h for original tarball
mv $tmp/uppsrc/ide/version.h $tmpdir/version.h.backup
echo "#define IDE_VERSION \"$VER\"" > $tmp/uppsrc/ide/version.h
# compress the sources and Makefile to get orig.tar.gz
echo "Compressing original source tarball ..."
cd $tmp
tar -czf $orig ${subfolders[@]} #Makefile
# restore backed-up ide/version.h
rm $tmp/uppsrc/ide/version.h
mv $tmpdir/version.h.backup $tmp/uppsrc/ide/version.h
# prepare architecture independent part of debian directory:
echo "Debianizing source tree ..."
mkdir $tmp/debian
# copy maintainer scripts and control file
cp $scriptdir/{postinst,prerm,control,rules,theide.desktop,theide.1} $tmp/debian
chmod +x $scriptdir/{postinst,prerm,rules}
# generate copyrightfile
cat > $tmp/debian/copyright << EOF
This package was debianized by Jan Dolinar <dolik.rce@seznam.cz>
on `date -R`.
Copyright © 1999-2010 Ultimate++ team (http://ultimatepp.org)
Authors: Mirek Fidler, Tomas Rylek, Daniel Kos
License: BSD (please see /usr/share/common-licenses/BSD).
EOF
# cycle through series to build and call archdep to prepare the
# architecture depedent stuff
for dist in ${SERIES[@]}
do
version=$VER"~ppa"$BUILD"~"$dist"1"
# save complete version string to ide/version.h
mv $tmp/uppsrc/ide/version.h $tmpdir/version.h.backup
echo "#define IDE_VERSION \"$version\"" > $tmp/uppsrc/ide/version.h
# generate changelog (with changes in packaging, not in sources!)
cat > "$tmp/debian/changelog" << EOF
upp ($version) $dist; urgency=low
* Updated to version $VER
-- Jan Dolinar <dolik.rce@seznam.cz> `date -R`
EOF
# generate debian/dopack script
cat > "$tmp/debian/dopack" << EOF
#!/bin/bash
VERSION="$VER"
MAINTAINER="Jan Dolinar"
EMAIL="dolik.rce@seznam.cz"
SERIES="$dist"
BUILD="$BUILD"
release="$version"
EOF
cat "$scriptdir/dopack-stub" >> $tmp/debian/dopack
# call debuild to create the package
echo "Packaging upp $version ..."
cd $tmp
debuild --no-lintian -sgpg -pgpg-extpass -S
# upload to launchpad ("-s"=simulate, use for debugging)
echo "Uploading upp $version ..."
cd $tmpdir
dput "upp-$dist" "upp_"$version"_source.changes"
# remove architecture dependent files
rm $tmp/debian/{dopack,changelog}
#restore backed-up ide/version.h
rm $tmp/uppsrc/ide/version.h
mv $tmpdir/version.h.backup $tmp/uppsrc/ide/version.h
done
# clean up temporary files
echo "Cleaning up ..."
rm -rf $tmpdir
echo "FINISHED!"

View file

@ -12,3 +12,6 @@ file
postinst,
lpbuild;
mainconfig
"" = "";