demo of project-builder.org
===========================

# First demonstrate the way of working for pb itself
cd ~/local/pb|~/pb|~/svn-git/pb
# Show the various versions available in this SVK exported dir
ls
# get the current tag of the SVK repository
svk info|svn info|git svn info

# get the current version of project-builder
rpm -q project-builder
pb --help
pb

# Decide to build a package for project-builder based on that devel version
# to replace the one currently installed
pb -p pb -r devel sbx2build|cms2build

# Show the upstream part
ls -altg /home/bruno/svn-git/pb/delivery/
tar tvfz /home/bruno/svn-git/pb/delivery/project-builder-develXXX.tar.gz

# Show the pb specific part
tar tvfz /home/bruno/svn-git/pb/delivery/project-builder-develXXX.pbconf.tar.gz

# Now make the packages
pb -p pb build2pkg

# Look at the latest pckges created
ls -altrg /home/bruno/svn-git/pb/build/RPMS/noarch

# Install the generated packages
sudo urpmi /home/bruno/svn-git/pb/build/RPMS/noarch/*.rpm

# Check that it's the right one
rpm -q project-builder
pb --version
git svn info

# Now  show how easy it's to build for another distro in a VM
ls /home/qemu
-> pb -p pb -m debian-7-x86_64 sbx2vm
ls -al /var/ftp/pub/pb/test/debian/7/
ls -al /var/ftp/pub/pb/test/debian/dists/7/

pb -p pb -m mageia-3-i386 sbx2vm
# Now  show how easy it's to build for another distro in a VE
ls /home/rpmbootstrap
pb -p pb -m centos-6-x86_64 build2ve
pb -p pb -m ubuntu-11.10-x86_64 build2ve
-> pb -p pb -m debian-6.0-x86_64 sbx2ve
ls -al /var/ftp/pub/pb/test/debian/6.0/
ls -al /var/ftp/pub/pb/test/debian/dists/6.0/

# Now show how easy it's to build for another distro in a Docker VE
# Create Docker container
docker images
pb -p pb -m mageia-4-x86_64 -T docker newve 
docker images
docker run -ti <imgid> /bin/bash
$ urpmi tar 
pb -p pb -m mageia-4-x86_64  -T docker sbx2setupve
docker images
docker run -ti <imgid> /bin/bash
pb --version
pb -p pb -m mageia-4-x86_64  -T docker prepve
docker images
docker run -ti <imgid> /bin/bash
pb -p pb -m mageia-4-x86_64  -T docker sbx2ve
ls -al /var/ftp/pub/pb/test/mageia/4/x86_64
# On another project 
pb -p mondorescue -m mageia-4-x86_64  -T docker prepve
docker images
ls -al /var/ftp/pub/pb/test/mageia/4/x86_64
ssh bruno@www.mondorescue.org ls -altrg /prj/ftp/test/mageia/4/x86_64


# Now  show how easy it's to build for another project for which I'm upstream
-> pb -p mondorescue -m debian-6.0-x86_64 sbx2ve

# Now  show how easy it's to build for another project for which I'm not upstream with patches
-> pb -p afio -r 2.5 -m debian-6.0-x86_64 sbx2ve

# Look at conf files
cat ~/.pbrc
cat /home/rpmbootstrap/.pbrc
cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio.pb
cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/rpm/afio.spec
cat ~/svn-git/pb/projects/afio/pbconf/2.5/afio/deb/control
ls -R ~/svn-git/pb/projects/afio/pbconf/2.5/

# Short Lab
# in pblab account
# prepa
# As root
rm -rf /prj/svn
svnadmin create /prj/svn
cat >> /prj/svn/conf/authz << EOF
[/]
pblab = rw
* = r
EOF
cat >> /prj/svn/conf/passwd << EOF
pblab = pblab
EOF
cat > /prj/svn/conf/svnserve.conf << EOF
[general]
password-db = passwd
authz-db = authz
[sasl]
EOF
killall svnserve
~pblab/bin/rc.local

# as pblab
rm -rf pb .pbrc
cat > afio.pb.add << EOF
defpkgdir afio = dummy
pbpackager default = Big Chief <bigchief@hp.com>
projver afio = 2.5
projtag afio = 1
pburl afio = ftp://localhost/src/afio-2.5.tar.gz
pbrepo afio = ftp://localhost
EOF

pb -p afio clean
cat ~/.pbrc
cat >> ~/.pbrc << EOF
pbconfurl afio = svn://localhost/pb/afio/pbconf
EOF
echo "pbdefdir default = \$ENV{'HOME'}/pb" >>  ~/.pbrc
mkdir pb
svn import pb svn://localhost/pb -m "Initial creation of pb repo"
# passwd asked here

cd pb
svn co svn://localhost/pb .
pb -p afio newproj afio
# passwd asked here

cat ~/afio.pb.add >> afio/pbconf/afio.pb
pb -p afio sbx2build

# with Ubuntu CD
cat >> ~/.pbrc << EOF
vmpath default = /home/qemu
EOF

