Changes between Version 26 and Version 27 of WikiStart

Nov 19, 2007, 1:23:18 PM (13 years ago)
Bruno Cornec

Split of the LinuxCOE example on a separate page


  • WikiStart

    v26 v27  
    1818= Examples of Project-Builder usage =
    20 * NetPerfExample: Simple Example with netperf
    22 = Example of use on LinuxCOE (more complex example) =
    24 When the project was mature enough to package correctly mondorescue and itself, I then decided it was time to try it on another unrelated project to see how difficult it could be and document that experience so that others could also begin to use pb for their own project.
    26 You first have to edit your .pbrc configuration file in your home directory, which will setup things globally.
    28 Here are my .pbrc LinuxCOE relative entries:
    29 {{{
    30 $ grep -E '^#|linuxcoe|default' ~/.pbrc
    31 #
    32 # Root of the temp file used to store info on the project
    33 # Is also used to determine the root directory of the project
    34 # No default option allowed here as they need to be all different
    35 #
    36 pbrc linuxcoe = /users/bruno/LinuxCOE/cvs/pbrc
    37 }}}
    39 Then you have to go under the directory you planned to store the project you want to package (/users/bruno/LinuxCOE/cvs) and you have to create there a directory pbconf which will contain everything related to project-builder around your own project. The pbrc file you indicated in the configuation file will be managed automatically by pb and you don't have to care of it. Just to reference where it will be, which will in turn give to project-builder the information of the project's directory.
    40 {{{
    41 $ cd /users/bruno/LinuxCOE/cvs
    42 $ mkdir pbconf
    43 }}}
    45 The main configuration file under pbconf should be named with the name of the project (the one used above in the .pbrc file) with the pb extension. the one created for LinuxCOE looks like that:
    46 {{{
    47 $ cat linuxcoe.pb
    48 #
    49 # Project Builder configuration file
    50 # For project LinuxCOE
    51 #
    52 # $Id$
    53 #
    55 #
    56 # Global version/tag for the project
    57 #
    58 projver linuxcoe = devel
    59 projtag linuxcoe = 1
    61 # Adapt to your needs:
    62 # Optional if you need to overwrite the global values above
    63 #
    64 pkgver nil
    65 pkgtag nil
    68 # Hash of default package/package directory
    69 #
    70 defpkgdir systemdesigner = SystemDesigner
    72 # Hash of additional package/package directory
    73 #
    74 extpkgdir systemdesigner-docs = docs
    75 extpkgdir systemdesigner-fedora = SystemDesigner-Fedora
    77 # Hash of valid version names
    78 #
    79 version devel
    80 version stable
    82 # List of additional files on which to apply filters
    83 # Files are mentioned relatively to pbroot
    84 #
    85 filteredfiles systemdesigner =
    86 filteredfiles systemdesigner-docs =
    87 }}}
    89 I inform pb that I will produce packages with a version-tag of devel-1, that no local package should have a different version than the project version (pkgver/pkgtag), that my default package will be systemdesigner (pb will work on it by default all the time) and that additional packages it may deal with are systemdesigner-docs and systemdesigner-fedora. In addition to standard version with numbers, pb will accpet the version devel and stable. And finally, I give to the name of all files (per package) that it will have to filter to produce the packages - more on that later on.
    91 With that minimal configuration, you may begin to test project-builder. Try to produce a compressed tar file of your project.
    92 {{{
    93 $ export PBPROJ=linuxcoe
    94 $ pb -r `pwd` cms2build
    95 }}}
    96 The export order will allow you to avoid precising all the time to pb that you work on the linuxcoe project. If you prefer, you can invoke pb as follows:
    97 {{{
    98 pb -p linuxcoe -r `pwd` cms2build
    99 }}}
    100 or make a shell alias, or whatever is convenient for you.
    102 The -r option is needed at start to create the pbrc file you mentioned in your .pbrc configuration file initially. After that first invocation, you will only need to call it again, if you change the version you want to generate.
    104 cms2build is generally the first action pb will be asked to execute as it will produce a compressed tar ball from your Confoguration Management System repository. pb is CMS agnostic, and can currently handle friendly SVN and CVS, and can be easily adapted to support others.
    106 As a result of your commands you should see something like that:
    107 {{{
    108 $ pb -r `pwd` cms2build
    109 Project linuxcoe
    110 Action: cms2build
    111 Packages: systemdesigner
    113 Management of systemdesigner devel-1 (rev CVS)
    114 Exporting /users/bruno/LinuxCOE/cvs/SystemDesigner from CVS... OK
    115 Extracting log info from CVS... OK
    116 Build files generated for
    117 No Build files found for mandriva-2007.1
    118 Creating systemdesigner tar files compressed... OK
    119 Under /users/bruno/LinuxCOE/cvs/delivery/systemdesigner-devel.tar.gz
    120 }}}
    122 So it creates for you the right tar file at the right place. But it warns you that no build file was found for your project. Normal we haven't created one yet ;-) It's our next step.
    124 You'll first need to create the infrastructure needed to host the information for building packages:
    125 {{{
    126 $ mkdir -p pbconf/systemdesigner/rpm
    127 $ mkdir -p pbconf/systemdesigner/pbfilter
    128 }}}
    130 then thanks to the work done by Louis Bouchard to package LinuxCOE, you can take the spec file he created and adapt it to suit pb.
    131 {{{
    132 $ cat pbconf/systemdesigner/rpm/systemdesigner.spec
    133 }}}
     20 * NetPerfExample: Simple example with netperf
     21 * LinuxCoeExample: More complex example with LinuxCOE using CVS
     22 * MondoRescueExample: More complex example with MondoRescue using SVN
    13524== Concerning trac ==