Line 4: |
Line 4: |
| | | |
| In this howto we could let script-tools we need to build rpm | | In this howto we could let script-tools we need to build rpm |
| + | |
| + | ===Unnilennium=== |
| + | [[User:Unnilennium|Jean-Philippe Pialasse]]<br/> |
| + | |
| + | ====prepa==== |
| + | a script to update the cvs Tree and apply all patches |
| + | cvs update -dPA |
| + | make clean |
| + | make prep |
| + | |
| + | ====refresh==== |
| + | a script to refresh the whole cvs Tree of smecontribs |
| + | #!/bin/bash |
| + | |
| + | cd ~/smecontribs/rpms |
| + | cvs update -dPA |
| + | cd ~/smecontribs |
| + | cvs -z3 -d:ext:shell.koozali.org:/cvs/smecontribs co -P rpms |
| + | cd ~/smecontribs/rpms |
| + | |
| + | ====addSubTree==== |
| + | A script to add srpm in Buildsrv |
| + | |
| + | #!/bin/bash |
| + | |
| + | if [ ! -f "$1" ] |
| + | then |
| + | echo "srpm does not exists" |
| + | exit 99 |
| + | fi |
| + | |
| + | package=$1 |
| + | |
| + | pkgname=`echo $1|rev|cut -d"/" -f1|cut -d"-" -f3-|rev` |
| + | |
| + | VSME=${2:-'9'} |
| + | |
| + | echo "$pkgname/contribs$VSME" |
| + | |
| + | |
| + | #cd ~/smecontribs/rpms |
| + | #cvs update -dPA |
| + | #cd ~/smecontribs |
| + | #cvs -z3 -d:ext:shell.koozali.org:/cvs/smecontribs co -P rpms |
| + | #cd ~/smecontribs/rpms |
| + | |
| + | cd ~/smecontribs/rpms |
| + | |
| + | # contrib folder not found |
| + | if [ ! -d "$pkgname" ] |
| + | then |
| + | echo " ~/smecontribs/rpms/$pkgname not found" |
| + | exit 99 |
| + | fi |
| + | |
| + | |
| + | if [ ! -d "$pkgname/contribs$VSME" ] |
| + | then |
| + | echo " ~/smecontribs/rpms/$pkgname/contribs$VSME not found : new subtree to create" |
| + | mkdir -p $pkgname/contribs$VSME |
| + | touch $pkgname/contribs$VSME/.cvsignore |
| + | touch $pkgname/contribs$VSME/import.log |
| + | cvs add $pkgname |
| + | cvs add $pkgname/contribs$VSME |
| + | cvs add $pkgname/contribs$VSME/.cvsignore |
| + | cvs add $pkgname/contribs$VSME/import.log |
| + | cvs commit -m "Prep for $pkgname import" |
| + | |
| + | else |
| + | echo " ~/smecontribs/rpms/$pkgname/contribs$VSME found : just need to import new source rpm" |
| + | |
| + | fi |
| + | |
| + | |
| + | ./common/cvs-import.sh -b "contribs$VSME" -m "Initial import to v$VSME" "$package" |
| + | |
| + | echo " now first build ..." |
| + | cd ~/smecontribs/rpms/$pkgname/contribs$VSME |
| + | cvs update -dPA |
| + | make clean |
| + | make prep |
| + | make local |
| + | cvs commit -m "$pkgname first build" |
| + | make tag |
| + | make build |
| + | echo "now please fill a bug" |
| + | echo "http://bugs.contribs.org/enter_bug.cgi?product=SME%20Contribs&component=${pkgname}&version=${VSME}beta&short_desc=first%20import%20to%20sme$VSME%20tree%20[$pkgname]" |
| + | echo "http://bugs.contribs.org/enter_bug.cgi?product=SME%20Contribs&component=${pkgname}&version=${VSME}beta&short_desc=first%20import%20to%20sme$VSME%20tree%20[$pkgname]">>~/TODO |
| + | |
| + | ====listv9==== |
| + | List rpm version already online in the sme9contribs tree and build srpm from the folder ~/srpm which are not already online |
| + | |
| + | #!/bin/bash |
| + | |
| + | #liste contribs avec deja version v9 |
| + | #find ~/smecontribs/rpms/ -name 'contribs9' -printf '%h\n' | sort -u |grep "smeserver-"|cut -d"/" -f6>~/alreadyV9 |
| + | # liste �tant deja released |
| + | URL='http://mirror.contribs.org/releases/9/smecontribs/SRPMS/'; |
| + | curl $URL 2>&1 | grep -o -E 'href="(.+)"' | cut -d'"' -f2|grep -E '^smeserver-'|rev| cut -d"-" -f3-|rev >~/lscontribs9 |
| + | home=~ |
| + | echo $home |
| + | ls ~/srpm |grep "src.rpm"|sed "s|.*|$home/srpm/&|"> ~/listsrpm |
| + | |
| + | #listes juste import�e ou smedev |
| + | comm -23 <(sort ~/lscontribs9) <(sort ~/alreadyV9) |
| + | |
| + | while read fichier ; do |
| + | |
| + | tmp=`echo $fichier|rev|cut -d"/" -f1| cut -d"-" -f3-|rev` |
| + | #echo $fichier |
| + | #echo $tmp |
| + | if grep -Fxq "^$tmp$" ~/alreadyV9 |
| + | then |
| + | echo " $tmp : already there " # code if found |
| + | echo " $tmp : already there " >>~/TODO |
| + | else |
| + | echo "$tmp to import into v9" # code if not found |
| + | # import |
| + | echo "addSubTree $fichier 9 " |
| + | addSubTree $fichier 9 |
| + | echo "mv $fichier \"$home/done/\"" |
| + | mv $fichier "$home/srpm/done/" |
| + | sleep 10 |
| + | fi |
| + | |
| + | done < <(cat ~/listsrpm) |
| | | |
| ===Stephdl=== | | ===Stephdl=== |
Line 122: |
Line 248: |
| # Find the centos version | | # Find the centos version |
| DIST=$2 | | DIST=$2 |
− | if [[ -z $DIST && "$BRANCH" =~ "sme9" ]]; then | + | <nowiki>if [[ -z $DIST && "$BRANCH" =~ "sme9" ]]; then</nowiki> |
| DIST="el6" | | DIST="el6" |
| elif [ -z $DIST ]; then | | elif [ -z $DIST ]; then |
Line 156: |
Line 282: |
| cp $TMPDIR/$PACKAGE-$VERSION.tar.gz ~/rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz | | cp $TMPDIR/$PACKAGE-$VERSION.tar.gz ~/rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz |
| cp $PACKAGE.spec ~/rpmbuild/SPECS/ | | cp $PACKAGE.spec ~/rpmbuild/SPECS/ |
| + | |
| + | ##copy a list of files to SOURCES when patches or archives are not in the root folder |
| + | ls > /tmp/$PACKAGE-$VERSION |
| + | cp -Rf $(</tmp/$PACKAGE-$VERSION) ~/rpmbuild/SOURCES/ |
| | | |
| # And build | | # And build |
Line 223: |
Line 353: |
| | | |
| rm -f ~/rpmbuild/SPECS/$PACKAGE.spec ~/rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz ~/rpmbuild/SRPMS/$PACKAGE-$VERSION*.src.rpm | | rm -f ~/rpmbuild/SPECS/$PACKAGE.spec ~/rpmbuild/SOURCES/$PACKAGE-$VERSION.tar.gz ~/rpmbuild/SRPMS/$PACKAGE-$VERSION*.src.rpm |
− | rm -rf $TMPDIR ~/$PACKAGE-$VERSION | + | rm -rf $TMPDIR ~/rpmbuild/SOURCES/$PACKAGE-$VERSION |
| + | |
| + | # clean ~/rpmbuild/SOURCES when patches or archives are not in the root folder |
| + | cd ~/rpmbuild/SOURCES/ |
| + | rm -rf $(</tmp/$PACKAGE-$VERSION) |
| + | #remove the file list |
| + | rm -rf /tmp/$PACKAGE-$VERSION |
| | | |
| # we give the path where are files | | # we give the path where are files |
Line 492: |
Line 628: |
| #first we update the smecontribs tree | | #first we update the smecontribs tree |
| cd ~/work/smecontribs | | cd ~/work/smecontribs |
− | cvs -z3 -d:ext:smeserver.cvs.sourceforge.net:/cvsroot/smecontribs co -P rpms | + | cvs -z3 -d:ext:shell.koozali.org:/cvs/smecontribs co -P rpms |
| echo "############################" | | echo "############################" |
| echo " smecontribs uptodate " | | echo " smecontribs uptodate " |
Line 503: |
Line 639: |
| | | |
| cd ~/work/smeserver | | cd ~/work/smeserver |
− | cvs -z3 -d:ext:smeserver.cvs.sourceforge.net:/cvsroot/smeserver co -P rpms | + | cvs -z3 -d:ext:shell.koozali.org:/cvs/smeserver co -P rpms |
| | | |
| echo "############################" | | echo "############################" |
Line 667: |
Line 803: |
| #import all to cvs | | #import all to cvs |
| cvs add * | | cvs add * |
− | #sed work | + | # Informations needed from the spec file |
− | version=$(grep -sri 'define version' *.spec | sed 's/%define version //gI') | + | version=$(rpm -q --qf "%{version}\n" --specfile $1.spec| head -1) |
− | release=$(grep -sri 'define release' *.spec | sed 's/%define release //gI') | + | #ARCH=$(rpm -q --qf "%{arch}\n" --specfile $1.spec | head -1) |
| + | release=$(rpm -q --qf "%{release}\n" --specfile $1.spec | head -1| sed s/\.el.//) |
| + | |
| + | #sed work no needed anymore(see above) |
| + | #version=$(grep -sri 'define version' *.spec | sed 's/%define version //gI') |
| + | #release=$(grep -sri 'define release' *.spec | sed 's/%define release //gI') |
| + | |
| #bump the release | | #bump the release |
| release=$((release + 1)) | | release=$((release + 1)) |
Line 682: |
Line 824: |
| echo " cvs co CVSROOT" | | echo " cvs co CVSROOT" |
| echo " Then you must edit /CVSROOT/modules and add the name of the new CVS module (alphabetically sorted), after that commit the changes" | | echo " Then you must edit /CVSROOT/modules and add the name of the new CVS module (alphabetically sorted), after that commit the changes" |
| + | echo "now please fill a bug" |
| + | pkgname=$1 |
| + | VSME=$(echo $2|sed 's/sme\|contribs//gI') |
| + | |
| + | echo "http://bugs.contribs.org/enter_bug.cgi?product=SME%20Contribs&component=${pkgname}&version=${VSME}beta&short_desc=first%20import%20to%20sme$VSME%20tree%20[$pkgname]" |
| + | echo "$(date) |
| + | http://bugs.contribs.org/enter_bug.cgi?product=SME%20Contribs&component=${pkgname}&version=${VSME}beta&short_desc=first%20import%20to%20sme$VSME%20tree%20[$pkgname]">>~/TODO |
| | | |
− | ==== Find ==== | + | ==== search ==== |
− | Like the name, simply find rpm in buildsrv | + | Like the name, simply search rpm in buildsrv |
| | | |
| #!/bin/bash | | #!/bin/bash |
− | if [[ -z $1 ]]; then | + | <nowiki>if [[ -z $1 ]]; then</nowiki> |
| echo "You must specify a name of rpm" | | echo "You must specify a name of rpm" |
| exit | | exit |
| fi | | fi |
− | find /teams/ -name "*$1*" | + | find /distros -name "*$1*" |
| echo '' | | echo '' |
| echo '## other repo ##' | | echo '## other repo ##' |