wiki:NetPerfExample

Version 9 (modified by bruno, 10 years ago) (diff)

begin of re-write with 0.9.0

Example of use on netperf (simple example)

As an example of how easy (or not :-) Project-Builder is to use, I decided to write that tutorial as a gift for another project which deserves it, the NetPerf project.

You first have to create a .pbrc configuration file in your home directory, which will setup things globally:

$ cat > ~/.pbrc << EOF
#
# Define for each project the URL of its pbconf repository
# No default option allowed here as they need to be all different
#
pbconfurl netperf = svn+ssh://svn.mondorescue.org/mondo/svn/project-builder/netperf/pbconf

#
# Under that dir will take place everything related to pb
# If you want to use VMs/chroot/..., then use $ENV{'HOME'} to make it portable
# to your VMs/chroot/...
# if not defined then /var/cache
pbdefdir default = $ENV{'HOME'}/project-builder

EOF

Note that the format is in general

pb-keyword project = value

which means that here I named my project netperf for Project-Builder (I can choose what I want but need to be consistent everywhere). Also that configuration file is linked to the person who wants to package the software. Another configuration file will also be used, which only concerns the project itself.

The pbconfurl keyword indicates where are stored the configuration files for pb allowing us to build netperf packages with them. Here by default, everything will be extracted under $ENV{'HOME'}/project-builder for all projects we decide to package. Other keywords exist and may be used, but won't be needed for such a simple project.

To get the bits of the project you want to package, different protocols may be used. Currently supported protocols are using a SVN or CVS access if there is such a thing, or URL pointing to a ftp or http server.

The netperf project is a nice project using a simple environment to build itself. It uses the GNU autoconf/autmake/litool mechanism, which makes it easy to package with pb.

You will now need to get the latest and greatest project-builder software from our ftp repository. Of course we provide lots of packages for your distribution ;-) Or a tar.gz file if you prefer. Once available, you can use the newproj option of pb to create the infrastructure that is mandatory for pb. The latest version available of netperf at the time of this writing is 2.4.4.

$ pb -p netperf -r 2.4.4 newproj

Explore then the pbconf directory to familiarize yourself with some of the config file. the next one we want to edit, is the main configuration file which will be used as the central piece of information for pb.

Edit it and adapt it. After edition, here is the resulting file:

$ ls -R pbconf
pbconf:
netperf.pb  pbfilter  pkg1

pbconf/pbfilter:
all.pbf  deb.pbf  md.pbf  novell.pbf  rpm.pbf

pbconf/pkg1:
deb  pbfilter  rpm

pbconf/pkg1/deb:
changelog  compat  control  copyright  pkg1.dirs  pkg1.docs  rules

pbconf/pkg1/pbfilter:

pbconf/pkg1/rpm:
pkg1.spec
$
$ vi pbconf/netperf.pb
[Modifications here]
$ cat pbconf/netperf.pb
#
# Project Builder configuration file
# For project netperf
#
# $Id$
#

#
# Which CMS system is used (Subversion, CVS or tar file content extracted)
#
#cms netperf = svn
#cms netperf = cvs
cms netperf = flat

#
# Packager label
#
packager netperf = "Bruno Cornec <bruno@project-builder.org>"
#

# For delivery to a machine by SSH (potentially the FTP server)
# Needs hostname, account and directory
#
sshhost netperf = www.project-builder.org
sshlogin netperf = bruno
sshdir netperf = /mondo/ftp
sshport netperf = 22

#
# For Virtual machines management
# Naming convention to follow: distribution name (as per ProjectBuilder::Distribution)
# followed by '_' and by release number
# a .vmtype extension will be added to the resulting string
# a QEMU rhel_3 here means that the VM will be named rhel_3.qemu
#
vmlist netperf = mandrake_10.1,mandrake_10.2,mandriva_2006.0,mandriva_2007.0,mandriva_2007.1,mandriva_2008.0,redhat_7.3,redhat_9,fedora_4,fedora_5,fedora_6,fedora_7,rhel_3,rhel_4,rhel_5,suse_10.0,suse_10.1,suse_10.2,suse_10.3,sles_9,sles_10,gentoo_nover,debian_3.1,debian_4.0,ubuntu_6.06,ubuntu_7.04,ubuntu_7.10

#
# Valid values for vmtype are
# qemu, (vmware, xen, ... TBD)
vmtype netperf = qemu

# Hash for VM stuff on vmtype
vmntp default = pool.ntp.org

# We suppose we can commmunicate with the VM through SSH
vmhost netperf = localhost
vmlogin netperf = pb
vmport netperf = 2225

# Timeout to wait when VM is launched/stopped
vmtmout default = 120

# per VMs needed paramaters
vmopt netperf = -m 384 -daemonize
vmpath netperf = /home/qemu
vmsize netperf = 5G

#
# Global version/tag for the project
#
projver netperf = 2.4.4
projtag netperf = 1

# Adapt to your needs:
# Optional if you need to overwrite the global values above
#
#pkgver pkg1 = stable
#pkgtag pkg1 = 3
#pkgver nil
#pkgtag nil

# Hash of default package/package directory
defpkgdir netperf = netperf-2.4.4

# Hash of additional package/package directory
#extpkgdir pkg1-doc = pkg1-docdir

# Hash of valid version names
version devel
#version stable

# List of files per pkg on which to apply filters
# Files are mentioned relatively to pbroot/defpkgdir
filteredfiles netperf = configure.ac
#filteredfiles pkg1-doc = configure.in

I skip the parameters begining with vm and ssh for the moment. I inform pb that I will produce packages with a version-tag of 2.4.4-1, that no local package should have a different version than the project version (pkgver/pkgtag), that my default package will be netperf (pb will work on it by default all the time) and that no additional packages will be produced. In addition to standard version with numbers, pb will accept the version devel. And finally, I give to pb the name of all files (per package) that it will have to filter to produce the packages - more on that later on. Once this is done, you may already try to see if pb can make something useful for you. Check the result of:

$ pb -p netperf -r `pwd` cms2build
Project: netperf
Action: cms2build
Packages: netperf

Management of netperf 2.4.4-1 (rev flat)
Exporting /users/bruno/netperf/src/netperf-2.4.4 from DIR to /users/bruno/netperf/delivery/netperf-2.4.4... OK
Build files generated for
No Build files found for mandriva-2006.0,sles-9,mandrake-10.2,mandriva-2007.0,rhel-3,mandriva-2007.1,redhat-9,ubuntu-6.06,suse-10.3,rhel-5,ubuntu-7.10,gentoo-nover,suse-10.2,mandrake-10.1,mandriva-2008.0,sles-10,fedora-6,suse-10.1,fedora-5,fedora-4,ubuntu-7.04,fedora-7,suse-10.0,debian-4.0,rhel-4,debian-3.1,redhat-7.3
filter: no such variable
Can't use an undefined value as a HASH reference at /usr/lib/perl5/vendor_perl/5.8.8/ProjectBuilder/Base.pm line 1077.

Ok we tried to make a build file from ou Configuration Management System (CMS) which didn't work completely as our structure is incomplete. However, pb already recognized the project name, action, package to build, type of CMS (flat), used our -r option to create the intermediate delivery directory where all the final files|packages will be created.

So now, in order to be more useful, we need to create the structure for our package. Luckily, pb did most of the work for us, by creating a template pkg1 directory and files under pbconf. Rename them to netperf (name of our package) and explore and adapt its content:

$ find . -name pkg1'*'
./pbconf/pkg1
./pbconf/pkg1/rpm/pkg1.spec
./pbconf/pkg1/deb/pkg1.dirs
./pbconf/pkg1/deb/pkg1.docs
$ mv ./pbconf/pkg1 ./pbconf/netperf
$ mv ./pbconf/netperf/rpm/pkg1.spec ./pbconf/netperf/rpm/netperf.spec
$ mv ./pbconf/netperf/deb/pkg1.dirs ./pbconf/netperf/deb/netperf.dirs
$ mv ./pbconf/netperf/deb/pkg1.docs ./pbconf/netperf/deb/netperf.docs

Now this is done, it's time to look at those and adapt them. At the begining, we try to make RPM packages.

$ vi pbconf/netperf/rpm/netperf.spec
[Modifications here]
$ cat pbconf/netperf/rpm/netperf.spec
#
# $Id$
#

Summary:        The netperf tool is a benchmarking network tool
Summary(fr):    netperf est un outil de benchmark réseau

Name:           PBPKG
Version:        PBVER
Release:        PBTAGPBSUF
License:        GPL
Group:          PBGRP
Url:            PBURL
Source:         PBSRC
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)

%description
PBDESC

%description -l fr
netperf est un outil de benchmark réseau

%prep
%setup -q

%build
./configure
make %{?_smp_mflags} VERSION=%{version}

%install
%{__rm} -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc ChangeLog
%doc INSTALL COPYING README AUTHORS NEWS

%changelog
PBLOG

That spec file looks normal except that it uses a lot of PBSOMETHING keywords. Those are Project-Builder macros that will be instantiate depending on the distribution during the cms2build step.

So now that we have the base for our spec file, we need to look at those filters:

$ vi pbconf/pbfilter/all.pbf
[Modifications here]
$ cat pbconf/pbfilter/all.pbf
#
# $Id$
#
# Filter for all files
#
# PBSRC is replaced by the source package format
filter PBSRC = ftp://ftp.netperf.org/netperf/%{name}-%{version}.tar.gz

# PBVER is replaced by the version ($pbver in code)
filter PBVER = $pbver

# PBDATE is replaced by the date ($pbdate in code)
filter PBDATE = $pbdate

# PBLOG is replaced by the changelog if value is yes
filter PBLOG = yes

# PBTAG is replaced by the tag ($pbtag in code)
filter PBTAG = $pbtag

# PBREV is replaced by the revision ($pbrev in code)
filter PBREV = $pbrev

# PBPKG is replaced by the package name ($pbpkg in code)
filter PBPKG = $pbpkg

# PBPACKAGER is replaced by the packager name ($pbpackager in code)
filter PBPACKAGER = $pbpackager

# PBDESC contains the description of the package
filter PBDESC = "netperf is a network benchmarking tool"

# PBURL contains the URL of the Web site of the project
filter PBURL = http://www.netperf.org

We can now try again to use pb to create our build file:

$ pb -p netperf -r `pwd` cms2build
Project: netperf
Action: cms2build
Packages: netperf

Management of netperf 2.4.4-1 (rev flat)
Exporting /users/bruno/netperf/src/netperf-2.4.4 from DIR to /users/bruno/netperf/delivery/netperf-2.4.4... OK
Build files generated for mandriva-2006.0,sles-9,mandrake-10.2,mandriva-2007.0,rhel-3,mandriva-2007.1,redhat-9,ubuntu-6.06,suse-10.3,rhel-5,ubuntu-7.10,suse-10.2,mandrake-10.1,mandriva-2008.0,sles-10,fedora-6,suse-10.1,fedora-5,fedora-4,ubuntu-7.04,fedora-7,suse-10.0,debian-4.0,rhel-4,debian-3.1,redhat-7.3
No Build files found for gentoo-nover
Files configure.ac have been filtered
Creating netperf tar files compressed... OK
Under /users/bruno/netperf/delivery/netperf-2.4.4.tar.gz

Much better. You have now your first useful result from pb :-) Congrats ! Well wait ! It's not really useful because we started exactly from a tar file. Well it's not exactly the same tar file. This one adds Project-Builder support:

tar tvfz /users/bruno/netperf/delivery/netperf-2.4.4.tar.gz
drwxr-x--- bruno/users       0 2007-11-16 00:57 netperf-2.4.4/
-rw-r----- bruno/users      30 2007-10-16 20:00 netperf-2.4.4/inet_ntop.c
-rwxr-x--- bruno/users   31743 2007-06-02 00:06 netperf-2.4.4/config.sub
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/suse-10.0/
-rw-r--r-- bruno/users     880 2007-11-16 00:57 netperf-2.4.4/pbconf/suse-10.0/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/rhel-5/
-rw-r--r-- bruno/users     856 2007-11-16 00:57 netperf-2.4.4/pbconf/rhel-5/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/fedora-4/
-rw-r--r-- bruno/users     856 2007-11-16 00:57 netperf-2.4.4/pbconf/fedora-4/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/suse-10.1/
-rw-r--r-- bruno/users     880 2007-11-16 00:57 netperf-2.4.4/pbconf/suse-10.1/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/redhat-7.3/
-rw-r--r-- bruno/users     856 2007-11-16 00:57 netperf-2.4.4/pbconf/redhat-7.3/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/sles-9/
-rw-r--r-- bruno/users     880 2007-11-16 00:57 netperf-2.4.4/pbconf/sles-9/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/mandriva-2006.0/
-rw-r--r-- bruno/users     867 2007-11-16 00:57 netperf-2.4.4/pbconf/mandriva-2006.0/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/fedora-7/
-rw-r--r-- bruno/users     856 2007-11-16 00:57 netperf-2.4.4/pbconf/fedora-7/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/mandriva-2007.0/
-rw-r--r-- bruno/users     867 2007-11-16 00:57 netperf-2.4.4/pbconf/mandriva-2007.0/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/mandriva-2008.0/
-rw-r--r-- bruno/users     867 2007-11-16 00:57 netperf-2.4.4/pbconf/mandriva-2008.0/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/sles-10/
-rw-r--r-- bruno/users     880 2007-11-16 00:57 netperf-2.4.4/pbconf/sles-10/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.04/
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.04/changelog
-rw-r--r-- bruno/users     431 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.04/control
-rw-r--r-- bruno/users      36 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.04/netperf.docs
-rw-r--r-- bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.04/netperf.dirs
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.04/compat
-rw-r--r-- bruno/users    3632 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.04/rules
-rw-r--r-- bruno/users     994 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.04/copyright
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-6.06/
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-6.06/changelog
-rw-r--r-- bruno/users     431 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-6.06/control
-rw-r--r-- bruno/users      36 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-6.06/netperf.docs
-rw-r--r-- bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-6.06/netperf.dirs
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-6.06/compat
-rw-r--r-- bruno/users    3632 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-6.06/rules
-rw-r--r-- bruno/users     994 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-6.06/copyright
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.10/
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.10/changelog
-rw-r--r-- bruno/users     431 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.10/control
-rw-r--r-- bruno/users      36 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.10/netperf.docs
-rw-r--r-- bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.10/netperf.dirs
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.10/compat
-rw-r--r-- bruno/users    3632 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.10/rules
-rw-r--r-- bruno/users     994 2007-11-16 00:57 netperf-2.4.4/pbconf/ubuntu-7.10/copyright
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/suse-10.3/
-rw-r--r-- bruno/users     880 2007-11-16 00:57 netperf-2.4.4/pbconf/suse-10.3/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/rhel-3/
-rw-r--r-- bruno/users     856 2007-11-16 00:57 netperf-2.4.4/pbconf/rhel-3/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/mandriva-2007.1/
-rw-r--r-- bruno/users     867 2007-11-16 00:57 netperf-2.4.4/pbconf/mandriva-2007.1/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-3.1/
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-3.1/changelog
-rw-r--r-- bruno/users     431 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-3.1/control
-rw-r--r-- bruno/users      36 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-3.1/netperf.docs
-rw-r--r-- bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-3.1/netperf.dirs
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-3.1/compat
-rw-r--r-- bruno/users    3632 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-3.1/rules
-rw-r--r-- bruno/users     994 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-3.1/copyright
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/fedora-5/
-rw-r--r-- bruno/users     856 2007-11-16 00:57 netperf-2.4.4/pbconf/fedora-5/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/fedora-6/
-rw-r--r-- bruno/users     856 2007-11-16 00:57 netperf-2.4.4/pbconf/fedora-6/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/mandrake-10.2/
-rw-r--r-- bruno/users     867 2007-11-16 00:57 netperf-2.4.4/pbconf/mandrake-10.2/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/suse-10.2/
-rw-r--r-- bruno/users     880 2007-11-16 00:57 netperf-2.4.4/pbconf/suse-10.2/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/redhat-9/
-rw-r--r-- bruno/users     856 2007-11-16 00:57 netperf-2.4.4/pbconf/redhat-9/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/rhel-4/
-rw-r--r-- bruno/users     856 2007-11-16 00:57 netperf-2.4.4/pbconf/rhel-4/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/mandrake-10.1/
-rw-r--r-- bruno/users     867 2007-11-16 00:57 netperf-2.4.4/pbconf/mandrake-10.1/netperf.spec
drwxr-xr-x bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-4.0/
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-4.0/changelog
-rw-r--r-- bruno/users     431 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-4.0/control
-rw-r--r-- bruno/users      36 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-4.0/netperf.docs
-rw-r--r-- bruno/users       0 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-4.0/netperf.dirs
-rw-r--r-- bruno/users       2 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-4.0/compat
-rw-r--r-- bruno/users    3632 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-4.0/rules
-rw-r--r-- bruno/users     994 2007-11-16 00:57 netperf-2.4.4/pbconf/debian-4.0/copyright
-rw-r----- bruno/users    2382 2007-06-02 00:06 netperf-2.4.4/README.ovms
-rwxr-x--- bruno/users    1988 2007-06-02 00:06 netperf-2.4.4/mkinstalldirs
-rw-r----- bruno/users   14022 2007-06-05 03:08 netperf-2.4.4/acinclude.m4
-rw-r----- bruno/users    4203 2007-06-14 18:51 netperf-2.4.4/README.windows
-rw-r----- bruno/users    2100 2007-06-02 00:06 netperf-2.4.4/README
-rw-r----- bruno/users    1048 2007-06-02 00:06 netperf-2.4.4/README.aix
-rw-r----- bruno/users   45985 2007-10-17 18:55 netperf-2.4.4/aclocal.m4
drwxr-x--- bruno/users       0 2007-10-17 23:42 netperf-2.4.4/doc/
-rw-r----- bruno/users    1163 2007-06-02 00:06 netperf-2.4.4/doc/netserver.man
[...]
-rw-r----- bruno/users      27 2007-06-02 00:06 netperf-2.4.4/ChangeLog
drwxr-x--- bruno/users       0 2007-10-17 23:42 netperf-2.4.4/src/
-rw-r----- bruno/users    7777 2007-06-02 00:06 netperf-2.4.4/src/netperf.c
[...]
-rw-r----- bruno/users    4095 2007-08-08 22:30 netperf-2.4.4/src/netsh.h
-rwxr-x--- bruno/users  290760 2007-10-17 18:55 netperf-2.4.4/configure
-rw-r----- bruno/users     106 2007-06-02 00:06 netperf-2.4.4/Makefile.am
-rw-r----- bruno/users   32819 2007-10-17 23:20 netperf-2.4.4/Release_Notes
-rw-r----- bruno/users    9223 2007-10-17 23:42 netperf-2.4.4/config.h.in
-rw-r----- bruno/users       0 2007-06-02 00:06 netperf-2.4.4/NEWS
-rw-r----- bruno/users     258 2007-06-02 00:06 netperf-2.4.4/README.osx
-rwxr-x--- bruno/users   13866 2007-06-02 00:06 netperf-2.4.4/depcomp
-rw-r----- bruno/users    1260 2007-06-02 00:06 netperf-2.4.4/README.solaris
-rwxr-x--- bruno/users    7122 2007-06-02 00:06 netperf-2.4.4/install-sh
-rw-r----- bruno/users    1204 2007-06-02 00:06 netperf-2.4.4/netperf.spec.in
-rwxr-x--- bruno/users   43499 2007-06-02 00:06 netperf-2.4.4/config.guess
-rw-r----- bruno/users   14031 2007-11-16 00:57 netperf-2.4.4/configure.ac
-rw-r----- bruno/users    2079 2007-06-02 00:06 netperf-2.4.4/COPYING
-rwxr-x--- bruno/users   10266 2007-06-02 00:06 netperf-2.4.4/missing
-rw-r----- bruno/users    6013 2007-10-15 19:41 netperf-2.4.4/AUTHORS
-rw-r----- bruno/users    1772 2007-06-02 00:06 netperf-2.4.4/README.hpux
-rw-r----- bruno/users   17464 2007-10-17 18:55 netperf-2.4.4/Makefile.in
-rw-r----- bruno/users    9240 2007-06-02 00:06 netperf-2.4.4/INSTALL

As you can see a lot of directories and files have been created under pbconf. They correspond to all the required build files for all the distributions supported and will later be used to really create the packages.

So now, we can try to go to the next step and build a package. So issue:

$ pb -p netperf -r `pwd` build2pkg
Project: netperf
Action: build2pkg
Packages: netperf
Source file: /users/bruno/netperf/delivery/netperf-2.4.4.tar.gz
Working directory: /users/bruno/netperf/build
Extracting build files... OK
Building package with /users/bruno/netperf/build/SPECS/netperf.spec under /users/bruno/netperf/build... Executing(%prep): /bin/sh -e /users/bruno/netperf/build/tmp/rpm-tmp.93873
+ umask 022
+ cd /users/bruno/netperf/build/BUILD
+ '[' 1 -eq 1 ']'
+ '[' 1 -eq 1 ']'
[... build execution continues ...]
+ '[' -f ./configure.in -o -f ./configure.ac ']'
+ CONFIGURE_XPATH='--x-includes=/usr/include --x-libraries=/usr/lib64'
+ ./configure x86_64-mandriva-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib64 --localstatedir=/var/lib --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --x-includes=/usr/include --x-libraries=/usr/lib64
[... build execution continues ...]
+ make -j4
cd . && /bin/sh /users/bruno/netperf/build/BUILD/netperf-2.4.4/missing --run aclocal-1.7
/users/bruno/netperf/build/BUILD/netperf-2.4.4/missing: line 46: aclocal-1.7: command not found
WARNING: `aclocal-1.7' is missing on your system.  You should only need it if
         you modified `acinclude.m4' or `configure.ac'.  You might want
         to install the `Automake' and `Perl' packages.  Grab them from
         any GNU archive site.
cd . && \
          /bin/sh /users/bruno/netperf/build/BUILD/netperf-2.4.4/missing --run automake-1.7 --gnu  Makefile
cd . && /bin/sh /users/bruno/netperf/build/BUILD/netperf-2.4.4/missing --run autoconf
/users/bruno/netperf/build/BUILD/netperf-2.4.4/missing: line 46: automake-1.7: command not found
WARNING: `automake-1.7' is missing on your system.  You should only need it if
         you modified `Makefile.am', `acinclude.m4' or `configure.ac'.
         You might want to install the `Automake' and `Perl' packages.
         Grab them from any GNU archive site.
/bin/sh ./config.status --recheck
[... build execution continues ...]
make[2]: Leaving directory `/users/bruno/netperf/build/BUILD/netperf-2.4.4'
make[1]: Leaving directory `/users/bruno/netperf/build/BUILD/netperf-2.4.4'
+ exit 0
Executing(%install): /bin/sh -e /users/bruno/netperf/build/tmp/rpm-tmp.48294
+ umask 022
+ cd /users/bruno/netperf/build/BUILD
+ cd netperf-2.4.4
+ '[' 1 -eq 1 ']'
+ /bin/rm -rf /users/bruno/netperf/build/tmp/netperf-2.4.4-1PBSUF-root-bruno
+ make DESTDIR=/users/bruno/netperf/build/tmp/netperf-2.4.4-1PBSUF-root-bruno install
Making install in src
[... build execution continues ...]
Checking for unpackaged file(s): /usr/lib/rpm/check-files /users/bruno/netperf/build/tmp/netperf-2.4.4-1PBSUF-root-bruno
error: Installed (but unpackaged) file(s) found:
   /usr/bin/netperf
   /usr/bin/netserver
   /usr/share/info/netperf.info.bz2
   /usr/share/man/man1/netperf.1.bz2
   /usr/share/man/man1/netserver.1.bz2


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/bin/netperf
   /usr/bin/netserver
   /usr/share/info/netperf.info.bz2
   /usr/share/man/man1/netperf.1.bz2
   /usr/share/man/man1/netserver.1.bz2
child (rpmbuild --define "packager Bruno Cornec <bruno@project-builder.org>" --define "_topdir /users/bruno/netperf/build" -ba /users/bruno/netperf/build/SPECS/netperf.spec) exited with value 1

So it seems we are not there yet ;-) But it's not too bad for just having renamed a couple of files and parameters in our conf files. Now we need to solve those issues and produce the package.

The first problem we've met, is that the build process seems to need automake and autoconf. However, when build separately with the classical ./configure ; make it doesn't ask for it.

Project-Builder provide a means when exporting the software to build a coherent automake/autoconf setup by the way of the pbinit script.

Create now such a script for your project:

$ cat > pbconf/netperf/pbinit << EOF
#!/bin/bash
aclocal
autoconf
automake
EOF
$ chmod 755 pbconf/netperf/pbinit

Then it seems that the PBSUF macro isn't expanded correctly. Look for it using a Project-Builder tool:

$ pbg PBSUF
./pbconf/pbfilter/rpm.pbf:# PBSUF is replaced by the package name ($pbpkg in code)
./pbconf/pbfilter/rpm.pbf:#filter PBSUF = $pbsuf
./pbconf/netperf/rpm/netperf.spec:Release:        PBTAGPBSUF

So indeed that macro is used in our spec file, but is only declared for rpm types of build in the rpm filter file. However it's currently commented. So edit that file to validate it, as well as the other variables needed:

$ cat ./pbconf/pbfilter/rpm.pbf
#
# $Id$
#
# Filter for rpm build
#

# PBGRP is replaced by the RPM group of apps
# Cf: http://fedoraproject.org/wiki/RPMGroups
filter PBGRP = Applications/Network

# PBDEP is replaced by the list of dependencies
# filter PBDEP =

# PBSUF is replaced by the package name ($pbpkg in code)
filter PBSUF = $pbsuf

# PBOBS is replaced by the Obsolete line
#filter PBOBS =

And our final current problem is the list of files produced by the build process that need to be referenced in our %files session. So modify that section of the spec file to read like this:

%files
%defattr(-,root,root)
%doc ChangeLog
%doc INSTALL COPYING README AUTHORS NEWS
%doc README.* Release_Notes doc/examples
%{_bindir}/*
%{_mandir}/*/*
%{_infodir}/*

Now you're ready for your second run !

$ pb -p netperf -r `pwd` cms2pkg
[... build process ...]
Wrote: /users/bruno/netperf/build/SRPMS/netperf-2.4.4-1.mdv2007.1.src.rpm
Wrote: /users/bruno/netperf/build/RPMS/x86_64/netperf-2.4.4-1.mdv2007.1.x86_64.rpm
Wrote: /users/bruno/netperf/build/RPMS/x86_64/netperf-debug-2.4.4-1.mdv2007.1.x86_64.rpm
[... build process ...]
Checking validity of rpms with rpmlint... E: netperf no-changelogname-tag
E: netperf zero-length /usr/share/doc/netperf-2.4.4/NEWS
E: netperf info-files-without-install-info-postin /usr/share/info/netperf.info.bz2
E: netperf info-files-without-install-info-postun /usr/share/info/netperf.info.bz2
E: netperf no-signature
E: netperf no-changelogname-tag
E: netperf no-signature
$

So this time we have an RPM ! You can try to install it and check if it works:

$ sudo urpmi /users/bruno/netperf/build/RPMS/x86_64/netperf-2.4.4-1.mdv2007.1.x86_64.rpm

installation de netperf-2.4.4-1.mdv2007.1.x86_64.rpm depuis /users/bruno/netperf/build/RPMS/x86_64
Préparation ...                  ##########################################################################
      1/1: netperf               ##########################################################################
$ sudo netserver
Starting netserver at port 12865
Starting netserver at hostname 0.0.0.0 port 12865 and family AF_UNSPEC
$ sudo netperf
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to victoria2.home.musique-ancienne.org (127.0.0.1) port 0 AF_INET
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

 87380  16384  16384    10.00    3665.59

So it seems to work. Check now the RPM:

$ rpm -ql netperf
/usr/bin/netperf
/usr/bin/netserver
/usr/share/doc/netperf-2.4.4
/usr/share/doc/netperf-2.4.4/AUTHORS
/usr/share/doc/netperf-2.4.4/COPYING
/usr/share/doc/netperf-2.4.4/ChangeLog
/usr/share/doc/netperf-2.4.4/INSTALL
/usr/share/doc/netperf-2.4.4/NEWS
/usr/share/doc/netperf-2.4.4/README
/usr/share/info/netperf.info.bz2
/usr/share/man/man1/netperf.1.bz2
/usr/share/man/man1/netserver.1.bz2
$ rpm -qi netperf
Name        : netperf                      Relocations: (not relocatable)
Version     : 2.4.4                             Vendor: (none)
Release     : 1.mdv2007.1                   Build Date: sam 17 nov 2007 00:40:33 CET
Install Date: sam 17 nov 2007 00:47:29 CET      Build Host: victoria2.home.musique-ancienne.org
Group       : Archiving/Backup              Source RPM: netperf-2.4.4-1.mdv2007.1.src.rpm
Size        : 263698                           License: GPL
Signature   : (none)
Packager    : Bruno Cornec <bruno@project-builder.org>
URL         : http://www.netperf.org
Summary     : netperf est un outil de benchmark réseau
Description :
netperf est un outil de benchmark réseau
$ rpm -q --changelog netperf
$ 

So we still have an issue with the Group used and the changelog which is empty. Also some modes are wrong and our NEWS file is empty. Again Project-Builder can will with those issues. You'll have for that to create a new file under pbconf/netperf called pbcl which will be the changelog file for your project:

$ cp netperf-2.4.4/Release_Notes pbconf/netperf/pbcl
$ vi pbconf/netperf/pbcl
[... format modifications ...]
$ head -20 pbconf/netperf/pbcl
# $Id$

NETPERF CHANGES

2.4.4 (2007-11-16)
-  The LOC_CPU and REM_CPU tests will report their respective beliefs
   as to the number of CPUs present when the verbosity is set to more
   than one.  This can be used when trying to diagnose issues with CPU
   utilization.
-  A kind soul who wishes to remain anonymous provided a patch to
   enable use of sendfile() on OSX.
-  Fix a misplaced \n in a format string of send_tcp_maerts, courtesy
   of Alexander Duyck.
-  There is an experimental global -r option which will allow one to
   include CPU utilization measurements, but make the decision about
   hitting confidence based on the result only.  The test banner will
   reflects this when -r is used.
-  It is no longer necessary to specify a file with the global -F
   option when running a _SENDFILE test.  Netperf will create a
   temporary file and populate it with random data and use that.  If
$
EOF

The format of the pbcl file is strict. It has 4 initital lines that you can use the way you want, the the 5th line should have 'Version (date)' wwith date using ISO format, then the following lines are the changelog content of that version. Then after a blank line, again a 'Version (date)' and the changelog, etc...

I also decide to remove the useless files in the distribution, and replace them with those that Project-Builder will generate from the pbcl file we just created from Release_Notes:

$ rm netperf-2.4.4/ChangeLog netperf-2.4.4/NEWS

Ready to check again:

$ pb -p netperf -r `pwd` cms2pkg
Project: netperf
Action: cms2pkg
Packages: netperf

Management of netperf 2.4.4-1 (rev flat)
Exporting /users/bruno/netperf/src/netperf-2.4.4 from DIR to /users/bruno/netperf/delivery/netperf-2.4.4... OK
Generating NEWS file from /users/bruno/netperf/src/pbconf/netperf/pbcl
[... build continues ...]
Wrote: /users/bruno/netperf/build/SRPMS/netperf-2.4.4-1.mdv2007.1.src.rpm
Wrote: /users/bruno/netperf/build/RPMS/x86_64/netperf-2.4.4-1.mdv2007.1.x86_64.rpm
Wrote: /users/bruno/netperf/build/RPMS/x86_64/netperf-debug-2.4.4-1.mdv2007.1.x86_64.rpm
Executing(%clean): /bin/sh -e /users/bruno/netperf/build/tmp/rpm-tmp.76745
+ umask 022
+ cd /users/bruno/netperf/build/BUILD
+ cd netperf-2.4.4
+ /bin/rm -rf /users/bruno/netperf/build/tmp/netperf-2.4.4-1.mdv2007.1-root-bruno
+ exit 0
OK
Checking validity of rpms with rpmlint... E: netperf script-without-shellbang /usr/share/doc/netperf-2.4.4/examples/arr_script
E: netperf info-files-without-install-info-postin /usr/share/info/netperf.info.bz2
E: netperf info-files-without-install-info-postun /usr/share/info/netperf.info.bz2
W: netperf wrong-file-end-of-line-encoding /usr/share/doc/netperf-2.4.4/README.windows
E: netperf no-signature
E: netperf no-signature
OK

So seems much better. More verifications:

$ sudo rpm -Uvh --force /users/bruno/netperf/build/RPMS/x86_64/netperf-2.4.4-1.mdv2007.1.x86_64.rpm
Préparation...              ########################################### [100%]
   1:netperf                ########################################### [100%]
$ rpm -ql netperf
/usr/bin/netperf
/usr/bin/netserver
/usr/share/doc/netperf-2.4.4
/usr/share/doc/netperf-2.4.4/AUTHORS
/usr/share/doc/netperf-2.4.4/COPYING
/usr/share/doc/netperf-2.4.4/ChangeLog
/usr/share/doc/netperf-2.4.4/INSTALL
/usr/share/doc/netperf-2.4.4/NEWS
/usr/share/doc/netperf-2.4.4/README
/usr/share/doc/netperf-2.4.4/README.aix
/usr/share/doc/netperf-2.4.4/README.hpux
/usr/share/doc/netperf-2.4.4/README.osx
/usr/share/doc/netperf-2.4.4/README.ovms
/usr/share/doc/netperf-2.4.4/README.solaris
/usr/share/doc/netperf-2.4.4/README.windows
/usr/share/doc/netperf-2.4.4/Release_Notes
/usr/share/doc/netperf-2.4.4/examples
/usr/share/doc/netperf-2.4.4/examples/Makefile
/usr/share/doc/netperf-2.4.4/examples/Makefile.am
/usr/share/doc/netperf-2.4.4/examples/Makefile.in
/usr/share/doc/netperf-2.4.4/examples/arr_script
/usr/share/doc/netperf-2.4.4/examples/packet_byte_script
/usr/share/doc/netperf-2.4.4/examples/sctp_stream_script
/usr/share/doc/netperf-2.4.4/examples/snapshot_script
/usr/share/doc/netperf-2.4.4/examples/tcp_range_script
/usr/share/doc/netperf-2.4.4/examples/tcp_rr_script
/usr/share/doc/netperf-2.4.4/examples/tcp_stream_script
/usr/share/doc/netperf-2.4.4/examples/udp_rr_script
/usr/share/doc/netperf-2.4.4/examples/udp_stream_script
/usr/share/info/netperf.info.bz2
/usr/share/man/man1/netperf.1.bz2
/usr/share/man/man1/netserver.1.bz2
$ rpm -q --changelog netperf | head
* ven nov 16 2007 Bruno Cornec <bruno@project-builder.org> 2.4.4-1.mdv2007.1
- Updated to 2.4.4
-  The LOC_CPU and REM_CPU tests will report their respective beliefs
   as to the number of CPUs present when the verbosity is set to more
   than one.  This can be used when trying to diagnose issues with CPU
   utilization.
-  A kind soul who wishes to remain anonymous provided a patch to
   enable use of sendfile() on OSX.
-  Fix a misplaced \n in a format string of send_tcp_maerts, courtesy
   of Alexander Duyck.
$ 

So we now have a much more correct rpm built, even if not everything is solve. The beauty of Project-Builder will now appear, as it's as easy to generate more RPMs for other distributions than it is for your native distribution.

Imagine you want to build the same RPMs for the just issued Fedora 8, instead of your native distribution. First download the ISO image of your distribution and put it where you have space on your disk. Then call pb to help you create a new virtual machine for that distribution:

$ pb -p netperf -r `pwd` -m fedora_8 -i ~/Download/Fedora-8-i386-DVD.iso newvm
Project: nerperf
Action: newvm
Creating the QEMU VM... Formating '/users/qemu/fedora_8.qemu', fmt=qcow2, size=5242880 kB
OK
Launching the VM /users/qemu/fedora_8.qemu... OK
Waiting for VM fedora_8 to come up...

Then the Virtual Machine is launched booting on your CD, and the rest is just a classical installation of a Linux distribution. Once your distribution is installed, stop the VM and relaunch it to finish the setup with:

$ pb -p netperf -r `pwd` -m fedora_8 launchvm
Project: netperf
Action: launchvm
Launching the VM /users/qemu/fedora_8.qemu... OK
Waiting for VM fedora_8 to come up...           

I especially disable firewall and SElinux on the VM. At the end of this initial setup phase log as root on your new VM installation. Check that your update mechanism for yum is correct. Allow your local account (the one running the pb commands) to have access through ssh to the VM, and activate ssh if it's not already done:

# mkdir .ssh
# scp bruno@victoria2.home.musique-ancienne.org:.ssh/id_dsa.pub .ssh//authorized_keys
The authenticity of host 'victoria2.home.musique-ancienne.org (192.168.8.28)' can't be established.
RSA key fingerprint is 8c:48:e7:a0:23:fe:81:c6:27:a2:d7:e1:7f:00:02:09.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'victoria2.home.musique-ancienne.org,192.168.8.28' (RSA) to the list of known hosts.
bruno@victoria2.home.musique-ancienne.org's password:
id_dsa.pub                                    100%  604     0.6KB/s   00:00
# chmod 700 .ssh
# chmod 600 .ssh//authorized_keys

And check that it's working by connecting to your VM (fr that use the port you put in your netperf.pb configuration file as vmport):

ssh root@localhost -p 2225
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
83:6f:24:f3:33:db:bf:95:93:79:cf:f4:1f:2a:23:23.
Please contact your system administrator.
Add correct host key in /users/bruno/.ssh/known_hosts to get rid of this message.
Offending key in /users/bruno/.ssh/known_hosts:90
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
Agent forwarding is disabled to avoid man-in-the-middle attacks.
X11 forwarding is disabled to avoid man-in-the-middle attacks.
#

So now you can finish to set up the VM by installing and configuring all what is necessary for pb to work flawlessly. There is a contributed script in Project-Builder that may help you greatly realizing that (Cf: http://trac.project-builder.org/browser/devel/pb/contrib/pbsetupqemu and its launcher http://trac.project-builder.org/browser/devel/pb/contrib/updateqemu). Try launching:

$ wget 'http://trac.project-builder.org/browser/devel/pb/contrib/pbsetupqemu?format=raw'
--01:08:11--  http://trac.project-builder.org/browser/devel/pb/contrib/pbsetupqemu?format=raw
           => `pbsetupqemu?format=raw'
Résolution de trac.project-builder.org... 213.30.161.23
Connexion vers trac.project-builder.org|213.30.161.23|:80...connecté.
requête HTTP transmise, en attente de la réponse...200 OK
Longueur: 7,880 (7.7K) [text/plain]

100%[=================================================================>] 7,880         --.--K/s


$ cat pbsetupqemu* /usr/lib/perl5/vendor_perl/*/ProjectBuilder/Distribution.pm > /tmp/pbscript
$ chmod 755 /tmp/pbscript
$ pb -p netperf -r `pwd` -a root -m fedora_8 -s /tmp/pbscript script2vm 
Project: pb
Action: script2vm
VMs: fedora_8
Found an existing VM /users/qemu/fedora_8.qemu (pid 32149)
Packages: project-builder
Sources handled (Script): /users/bruno/pb/svn/delivery/pbscript
Preparing pb/svn/pbrc/src on root@localhost... OK
pbscript                                                                   100%   15KB  14.6KB/s   00:00
OK
Executing pbscript on root@localhost  if needed... distro tuple: fedora,8,rh,rpm,.fc8
Cleaning up Everything
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package gnome-screensaver.i386 0:2.20.0-10.fc8 set to be updated
---> Package slrn.i386 0:0.9.8.1pl1-5.20070716cvs.fc8 set to be updated
---> Package perl-Test-Harness.i386 0:2.56-31.fc8 set to be updated
[...]
---> Package libsexy.i386 0:0.1.11-3.fc8 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 kernel                  i686       2.6.23.1-49.fc8  updates            16 M
 kernel-devel            i686       2.6.23.1-49.fc8  updates           4.8 M
Updating:
 acl                     i386       2.2.39-12.fc8    updates            69 k
 attr                    i386       2.4.38-2.fc8     updates            61 k
 codeina                 noarch     0.10.1-6.fc8     updates           117 k
[...]

Transaction Summary
=============================================================================
Install      4 Package(s)
Update      67 Package(s)
Remove       0 Package(s)

Total download size: 143 M
Downloading Packages:
[...]
  Updating  : gnome-desktop-devel          ##################### [ 68/138]
  Updating  : perl-devel                   ##################### [ 69/138]
  Updating  : perl-ExtUtils-MakeMaker      ##################### [ 70/138]
  Updating  : perl-ExtUtils-Embed          ##################### [ 71/138]
  Cleanup   : gnome-screensaver            ##################### [ 72/138]
  Cleanup   : slrn                         ##################### [ 73/138]
  Cleanup   : perl-Test-Harness            ##################### [ 74/138]
  Cleanup   : codeina                      ##################### [ 75/138]
  Cleanup   : libattr-devel                ##################### [ 76/138]
[...]
=============================================================================
Installing:
 perl-AppConfig          noarch     1.65-1.fc8       fedora             96 k
 perl-DateManip          noarch     5.44-4.fc8       fedora            162 k

Transaction Summary
=============================================================================
Install      2 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 258 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: perl-DateManip               ######################### [1/2]
  Installing: perl-AppConfig               ######################### [2/2]

Installed: perl-AppConfig.noarch 0:1.65-1.fc8 perl-DateManip.noarch 0:5.44-4.fc8
Complete!
20 Nov 01:45:43 ntpdate[5305]: step time server 192.168.8.55 offset 86478.362381 sec
--01:45:44--  ftp://ftp.mondorescue.org/src/project-builder-latest.tar.gz
           => `project-builder-latest.tar.gz'
Resolving ftp.mondorescue.org... 213.30.161.23
Connecting to ftp.mondorescue.org|213.30.161.23|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /src ... done.
==> PASV ... done.    ==> RETR project-builder-latest.tar.gz ... done.
Length: 52,296 (51K) (unauthoritative)

    0K .......... .......... .......... .......... .......... 97%  165.62 KB/s
   50K .                                                     100%    2.09 MB/s

01:45:45 (169.17 KB/s) - `project-builder-latest.tar.gz' saved [52296]

project-builder-0.8.11/
project-builder-0.8.11/pbconf/
project-builder-0.8.11/pbconf/suse-10.0/
project-builder-0.8.11/pbconf/suse-10.0/project-builder.spec
project-builder-0.8.11/pbconf/rhel-5/
[...]
Writing Makefile for pb
cp lib/ProjectBuilder/Changelog.pm blib/lib/ProjectBuilder/Changelog.pm
cp lib/ProjectBuilder/Base.pm blib/lib/ProjectBuilder/Base.pm
cp lib/ProjectBuilder/Distribution.pm blib/lib/ProjectBuilder/Distribution.pm
cp lib/ProjectBuilder/Version.pm blib/lib/ProjectBuilder/Version.pm
cp bin/pbvi blib/bin/pbvi
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/bin/pbvi
cp bin/pb blib/bin/pb
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/bin/pb
cp bin/pbdistrocheck blib/bin/pbdistrocheck
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/bin/pbdistrocheck
cp bin/pbg blib/bin/pbg
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/bin/pbg
Installing /usr/bin/pbdistrocheck
Installing /usr/bin/pb
Installing /usr/bin/pbvi
Installing /usr/bin/pbg
Installing /usr/lib/perl5/vendor_perl/5.8.8/ProjectBuilder/Distribution.pm
Installing /usr/lib/perl5/vendor_perl/5.8.8/ProjectBuilder/Base.pm
Installing /usr/lib/perl5/vendor_perl/5.8.8/ProjectBuilder/Changelog.pm
Installing /usr/lib/perl5/vendor_perl/5.8.8/ProjectBuilder/Version.pm
Writing /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/auto/pb/.packlist
Appending installation info to /usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod
OK

Now that Project-Builder is installed inside your VM, you may want to try to use it to build netperf packages for Fedora 8:

$ pb -p netperf -r `pwd` -m fedora_8 build2vm
Project: netperf
Action: build2vm
VMs: fedora_8
Found an existing VM /users/qemu/fedora_8.qemu (pid 28291)
Packages: netperf
Sources handled (VMs): /users/bruno/netperf/delivery/netperf-2.4.4.tar.gz /users/bruno/netperf/delivery/pbscript /users/bruno/netperf/src/pbconf/netperf.pb /users/bruno/netperf/delivery/2.4.4-1.pb /users/bruno/.pbrc
Preparing netperf/delivery on pb@localhost... /usr/bin/xauth:  creating new authority file /home/pb/.Xauthority
OK
netperf-2.4.4.tar.gz                                                       100% 1159KB   1.1MB/s   00:01
pbscript                                                                   100%  369     0.4KB/s   00:00
netperf.pb                                                                 100% 2214     2.2KB/s   00:00
2.4.4-1.pb                                                                 100%   24     0.0KB/s   00:00
.pbrc                                                                      100% 2216     2.2KB/s   00:00
OK
Executing pbscript on pb@localhost  if needed... ... Execution needed
Setting up date on pool.ntp.org...
Mon Nov 26 10:09:00 CET 2007
Building packages on VM...
Project: netperf
Action: build2pkg
Packages: netperf
Source file: /home/pb/netperf/delivery/netperf-2.4.4.tar.gz
Working directory: /home/pb/netperf/build
Extracting build files... tar: netperf-2.4.4/pbconf/fedora-8: Not found in archive
tar: Error exit delayed from previous errors
Unable to open directory netperf-2.4.4/pbconf/fedora-8/ at /usr/bin/pb line 845.
child (tar xfpz /home/pb/netperf/delivery/netperf-2.4.4.tar.gz netperf-2.4.4/pbconf/fedora-8/) exited with value 2

Project Builder didn't find in our tar file what is necessary to build an RPM on Fedora 8. This is because our configuration file doesn't indicate that we want to build on fedora 8 (of course it's a new VM). So fix your config file by adapting your vmlist entry to include also Fedora 8:

vmlist netperf = mandrake_10.1,mandrake_10.2,mandriva_2006.0,mandriva_2007.0,mandriva_2007.1,mandriva_2008.0,redhat_7.3,redhat_9,fedora_4,fedora_5,fedora_6,fedora_7,fedora_8,rhel_3,rhel_4,rhel_5,suse_10.0,suse_10.1,suse_10.2,suse_10.3,sles_9,sles_10,gentoo_nover,debian_3.1,debian_4.0,ubuntu_6.06,ubuntu_7.04,ubuntu_7.10

and then relaunch the build, starting from the CMS:

Project: netperf
Action: cms2vm
Packages: netperf

Management of netperf 2.4.4-1 (rev flat)
Exporting /users/bruno/netperf/src/netperf-2.4.4 from DIR to /users/bruno/netperf/delivery/netperf-2.4.4... OK
Generating NEWS file from /users/bruno/netperf/src/pbconf/netperf/pbcl
Empty ChangeLog file created... OK
Build files generated for mandriva-2006.0,sles-9,mandrake-10.2,mandriva-2007.0,rhel-3,mandriva-2007.1,redhat-9,ubuntu-6.06,suse-10.3,rhel-5,fedora-8,ubuntu-7.10,suse-10.2,mandrake-10.1,mandriva-2008.0,sles-10,fedora-6,suse-10.1,fedora-5,fedora-4,ubuntu-7.04,suse-10.0,fedora-7,debian-4.0,rhel-4,debian-3.1,redhat-7.3
No Build files found for gentoo-nover
Files configure.ac have been filtered
Creating netperf tar files compressed... OK
Under /users/bruno/netperf/delivery/netperf-2.4.4.tar.gz
VMs: fedora_8
Found an existing VM /users/qemu/fedora_8.qemu (pid 28291)
Packages: netperf
Sources handled (VMs): /users/bruno/netperf/delivery/netperf-2.4.4.tar.gz /users/bruno/netperf/delivery/pbscript /users/bruno/netperf/src/pbconf/netperf.pb /users/bruno/netperf/delivery/2.4.4-1.pb /users/bruno/.pbrc
Preparing netperf/delivery on pb@localhost... OK
netperf-2.4.4.tar.gz                                                       100% 1159KB   1.1MB/s   00:00
pbscript                                                                   100%  369     0.4KB/s   00:00
netperf.pb                                                                 100% 2223     2.2KB/s   00:00
2.4.4-1.pb                                                                 100%   24     0.0KB/s   00:00
.pbrc                                                                      100% 2216     2.2KB/s   00:00
OK
Executing pbscript on pb@localhost  if needed... ... Execution needed
Setting up date on pool.ntp.org...
Mon Nov 26 10:12:00 CET 2007
Building packages on VM...
Project: netperf
Action: build2pkg
Packages: netperf
Source file: /home/pb/netperf/delivery/netperf-2.4.4.tar.gz
Working directory: /home/pb/netperf/build
Extracting build files... OK
Building package with /home/pb/netperf/build/SPECS/netperf.spec under /home/pb/netperf/build... Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.44284
+ umask 022
+ cd /home/pb/netperf/build/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/pb/netperf/build/BUILD
+ rm -rf netperf-2.4.4
+ /bin/gzip -dc /home/pb/netperf/build/SOURCES/netperf-2.4.4.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd netperf-2.4.4
++ /usr/bin/id -u
+ '[' 500 = 0 ']'
++ /usr/bin/id -u
+ '[' 500 = 0 ']'
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.10486
+ umask 022
+ cd /home/pb/netperf/build/BUILD
+ cd netperf-2.4.4
+ LANG=C
+ export LANG
+ unset DISPLAY
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables'
+ export FFLAGS
++ find . -name config.guess -o -name config.sub
+ for i in '$(find . -name config.guess -o -name config.sub)'
++ basename ./config.sub
+ '[' -f /usr/lib/rpm/redhat/config.sub ']'
+ /bin/rm -f ./config.sub
++ basename ./config.sub
+ /bin/cp -fv /usr/lib/rpm/redhat/config.sub ./config.sub
`/usr/lib/rpm/redhat/config.sub' -> `./config.sub'
+ for i in '$(find . -name config.guess -o -name config.sub)'
++ basename ./config.guess
+ '[' -f /usr/lib/rpm/redhat/config.guess ']'
+ /bin/rm -f ./config.guess
++ basename ./config.guess
+ /bin/cp -fv /usr/lib/rpm/redhat/config.guess ./config.guess
`/usr/lib/rpm/redhat/config.guess' -> `./config.guess'
+ ./configure --build=i686-redhat-linux-gnu --host=i686-redhat-linux-gnu --target=i386-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info
checking build system type... i686-redhat-linux-gnu
checking host system type... i686-redhat-linux-gnu
checking target system type... i386-redhat-linux-gnu
[...]
netlib.o: In function `bind_to_specific_processor':
netlib.c:(.text+0x1d4a): undefined reference to `__CPU_ZERO'
netlib.c:(.text+0x1d56): undefined reference to `__CPU_SET'
collect2: ld returned 1 exit status

So we're not lucky as the application doesn't build natively on Fedora 8 due to the lack of some defines. So we can try with another existing VM to see if we are more lucky, after stoping our running VM:

$ ssh -p 2225 root@localhost halt
$ pb -p netperf -r `pwd` -m rhel_4 build2vm
Project: netperf
Action: build2vm
VMs: rhel_4
Launching the VM /users/qemu/rhel_4.qemu... OK
Waiting for VM rhel_4 to come up...
Packages: netperf
Sources handled (VMs): /users/bruno/netperf/delivery/netperf-2.4.4.tar.gz /users/bruno/netperf/delivery/pbscript /users/bruno/netperf/src/pbconf/netperf.pb /users/bruno/netperf/delivery/2.4.4-1.pb /users/bruno/.pbrc
Preparing netperf/delivery on pb@localhost... OK
netperf-2.4.4.tar.gz                                                       100% 1159KB   1.1MB/s   00:00
pbscript                                                                   100%  369     0.4KB/s   00:00
netperf.pb                                                                 100% 2223     2.2KB/s   00:00
2.4.4-1.pb                                                                 100%   24     0.0KB/s   00:00
.pbrc                                                                      100% 2216     2.2KB/s   00:00
OK
Executing pbscript on pb@localhost  if needed... ... Execution needed
Setting up date on pool.ntp.org...
lun nov 26 10:23:00 CET 2007
Building packages on VM...
Project: netperf
Action: build2pkg
Packages: netperf
Source file: /home/pb/netperf/delivery/netperf-2.4.4.tar.gz
Working directory: /home/pb/netperf/build
Extracting build files... OK
Building package with /home/pb/netperf/build/SPECS/netperf.spec under /home/pb/netperf/build... Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.90577
+ umask 022
+ cd /home/pb/netperf/build/BUILD
+ cd /home/pb/netperf/build/BUILD
+ rm -rf netperf-2.4.4
+ /usr/bin/gzip -dc /home/pb/netperf/build/SOURCES/netperf-2.4.4.tar.gz
[...]
gcc  -O2 -g -march=i386 -mcpu=i686   -o netperf  netperf.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o netcpu_procstat.o  -lm
netlib.o(.text+0xbb1): In function `alloc_sendfile_buf_ring':
/home/pb/netperf/build/BUILD/netperf-2.4.4/src/netlib.c:1545: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
if gcc -DHAVE_CONFIG_H -I. -I. -I..     -O2 -g -march=i386 -mcpu=i686 -MT netserver.o -MD -MP -MF ".deps/netserver.Tpo" \
  -c -o netserver.o `test -f 'netserver.c' || echo './'`netserver.c; \
then mv -f ".deps/netserver.Tpo" ".deps/netserver.Po"; \
else rm -f ".deps/netserver.Tpo"; exit 1; \
fi
gcc  -O2 -g -march=i386 -mcpu=i686   -o netserver  netserver.o netlib.o netsh.o nettest_bsd.o nettest_dlpi.o nettest_unix.o nettest_xti.o nettest_sctp.o nettest_sdp.o netcpu_procstat.o  -lm
netlib.o(.text+0xbb1): In function `alloc_sendfile_buf_ring':
/home/pb/netperf/build/BUILD/netperf-2.4.4/src/netlib.c:1545: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
make[3]: Entering directory `/home/pb/netperf/build/BUILD/netperf-2.4.4/src'
/bin/sh ../mkinstalldirs /var/tmp/netperf-2.4.4-1.rhel4-root-pb/usr/bin
mkdir -p -- /var/tmp/netperf-2.4.4-1.rhel4-root-pb/usr/bin
  /usr/bin/install -c netperf /var/tmp/netperf-2.4.4-1.rhel4-root-pb/usr/bin/netperf
  /usr/bin/install -c netserver /var/tmp/netperf-2.4.4-1.rhel4-root-pb/usr/bin/netserver
make[3]: Nothing to be done for `install-data-am'.
[...]
+ /bin/mkdir -p /var/tmp/netperf-2.4.4-1.rhel4-root-pb/usr/share/doc/netperf-2.4.4
+ cp -pr ChangeLog /var/tmp/netperf-2.4.4-1.rhel4-root-pb/usr/share/doc/netperf-2.4.4
+ cp -pr INSTALL COPYING README AUTHORS NEWS /var/tmp/netperf-2.4.4-1.rhel4-root-pb/usr/share/doc/netperf-2.4.4
+ cp -pr README.aix README.hpux README.osx README.ovms README.solaris README.windows Release_Notes doc/examples /var/tmp/netperf-2.4.4-1.rhel4-root-pb/usr/share/doc/netperf-2.4.4
+ exit 0
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /bin/sh libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.3.4) libm.so.6 libm.so.6(GLIBC_2.0)
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/netperf-2.4.4-1.rhel4-root-pb
Wrote: /home/pb/netperf/build/SRPMS/netperf-2.4.4-1.rhel4.src.rpm
Wrote: /home/pb/netperf/build/RPMS/i386/netperf-2.4.4-1.rhel4.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.25314
+ umask 022
+ cd /home/pb/netperf/build/BUILD
+ cd netperf-2.4.4
+ /bin/rm -rf /var/tmp/netperf-2.4.4-1.rhel4-root-pb
+ exit 0
OK
OK
pbgen-2.4.4-1                                                              100%   72     0.1KB/s   00:00
OK
netperf-2.4.4-1.rhel4.i386.rpm                                             100%  174KB 173.9KB/s   00:00
OK
netperf-2.4.4-1.rhel4.src.rpm                                              100% 1171KB   1.1MB/s   00:00
OK
VM cleanup on pb@localhost... OK
VM rhel_4 halt (pid 2119)... OK
Packages: netperf
Sources handled (Packages): rhel/4/netperf-2.4.4-1.rhel4.*.rpm
Preparing /mondo/ftp/rhel/4 on bruno@www.project-builder.org... OK
netperf-2.4.4-1.rhel4.i386.rpm                                             100%  174KB 173.9KB/s   00:00
netperf-2.4.4-1.rhel4.src.rpm                                              100% 1171KB  33.5KB/s   00:35
OK
Executing pbscript on bruno@www.project-builder.org  if needed... OK

This time we've been able to build our packages on RHEL 4 and at the end, as the build was successful they were automatically copied on our ftp server for public availability. In order to continue to support correctly netperf build, now that we have rpm done, we can attack the deb part. We need again to update the templates created by Project-Builder earlier: We can now try to generate packages for all the distributions supported:

$ pb -p netperf -r `pwd` build2vm
Project: netperf
Action: build2vm
VMs: mandrake_10.1,mandrake_10.2,mandriva_2006.0,mandriva_2007.0,mandriva_2007.1,mandriva_2008.0,redhat_7.3,redhat_9,fedora_4,fedora_5,fedora_6,fedora_7,fedora_8,rhel_3,rhel_4,rhel_5,suse_10.0,suse_10.1,suse_10.2,suse_10.3,sles_9,sles_10,gentoo_nover,debian_3.1,debian_4.0,ubuntu_6.06,ubuntu_7.04,ubuntu_7.10,mandrake_10.1_64,mandrake_10.2_64,mandriva_2006.0_64,mandriva_2007.0_64,mandriva_2007.1_64,mandriva_2008.0_64,redhat_7.3_64,redhat_9_64,fedora_4_64,fedora_5_64,fedora_6_64,fedora_7_64,fedora_8_64,rhel_3_64,rhel_4_64,rhel_5_64,suse_10.0_64,suse_10.1_64,suse_10.2_64,suse_10.3_64,sles_9_64,sles_10_64,gentoo_nover_64,debian_3.1_64,debian_4.0_64,ubuntu_6.06_64,ubuntu_7.04_64,ubuntu_7.10_64
Packages: netperf
[...]
$ find . -name netperf'*'
./fedora/4/netperf-2.4.4-1.fc4.i386.rpm
./fedora/4/netperf-2.4.4-1.fc4.src.rpm
./fedora/5/netperf-2.4.4-1.fc5.i386.rpm
./fedora/5/netperf-2.4.4-1.fc5.src.rpm
./fedora/6/netperf-2.4.4-1.fc6.i386.rpm
./fedora/6/netperf-2.4.4-1.fc6.src.rpm
./fedora/6/netperf-2.4.4-1.fc6.x86_64.rpm
./fedora/7/netperf-2.4.4-1.fc7.i386.rpm
./fedora/7/netperf-2.4.4-1.fc7.src.rpm
./fedora/7/netperf-2.4.4-1.fc7.x86_64.rpm
./mandrake/10.2/netperf-2.4.4-1.mdk102.i586.rpm
./mandrake/10.2/netperf-2.4.4-1.mdk102.src.rpm
./mandrake/10.1/netperf-2.4.4-1.mdk101.i586.rpm
./mandrake/10.1/netperf-2.4.4-1.mdk101.src.rpm
./mandriva/2006.0/netperf-2.4.4-1.mdv2006.0.i586.rpm
./mandriva/2006.0/netperf-2.4.4-1.mdv2006.0.src.rpm
./mandriva/2007.0/netperf-2.4.4-1.mdv2007.0.i586.rpm
./mandriva/2007.0/netperf-2.4.4-1.mdv2007.0.src.rpm
./mandriva/2007.0/netperf-2.4.4-1.mdv2007.0.x86_64.rpm
./mandriva/2007.1/netperf-2.4.4-1.mdv2007.1.i586.rpm
./mandriva/2007.1/netperf-2.4.4-1.mdv2007.1.src.rpm
./mandriva/2007.1/netperf-2.4.4-1.mdv2007.1.x86_64.rpm
./mandriva/2008.0/netperf-2.4.4-1.mdv2008.0.i586.rpm
./mandriva/2008.0/netperf-2.4.4-1.mdv2008.0.src.rpm
./mandriva/2008.0/netperf-2.4.4-1.mdv2008.0.x86_64.rpm
./redhat/7.3/netperf-2.4.4-1.rh73.i386.rpm
./redhat/7.3/netperf-2.4.4-1.rh73.src.rpm
./redhat/9/netperf-2.4.4-1.rh9.i386.rpm
./redhat/9/netperf-2.4.4-1.rh9.src.rpm
./rhel/3/netperf-2.4.4-1.rhel3.i386.rpm
./rhel/3/netperf-2.4.4-1.rhel3.src.rpm
./rhel/4/netperf-2.4.4-1.rhel4.i386.rpm
./rhel/4/netperf-2.4.4-1.rhel4.src.rpm
./rhel/4/netperf-2.4.4-1.rhel4.x86_64.rpm
./rhel/5/netperf-2.4.4-1.rhel5.i386.rpm
./rhel/5/netperf-2.4.4-1.rhel5.src.rpm
./rhel/5/netperf-2.4.4-1.rhel5.x86_64.rpm
./sles/9/netperf-2.4.4-1.sles9.i586.rpm
./sles/9/netperf-2.4.4-1.sles9.src.rpm
./sles/10/netperf-2.4.4-1.sles10.i586.rpm
./sles/10/netperf-2.4.4-1.sles10.src.rpm
./src/netperf-latest.tar.gz
./src/netperf-2.4.4.tar.gz
./suse/10.0/netperf-2.4.4-1.suse10.0.i586.rpm
./suse/10.0/netperf-2.4.4-1.suse10.0.src.rpm
./suse/10.1/netperf-2.4.4-1.suse10.1.i586.rpm
./suse/10.1/netperf-2.4.4-1.suse10.1.src.rpm
./suse/10.2/netperf-2.4.4-1.suse10.2.i586.rpm
./suse/10.2/netperf-2.4.4-1.suse10.2.src.rpm
./suse/10.2/netperf-2.4.4-1.suse10.2.x86_64.rpm
./suse/10.3/netperf-2.4.4-1.suse10.3.i586.rpm
./suse/10.3/netperf-2.4.4-1.suse10.3.src.rpm
./suse/10.3/netperf-2.4.4-1.suse10.3.x86_64.rpm

So we now have rpms built for all the distributions support (but fedora 8 !).