[416] | 1 | #!/usr/bin/perl -w
|
---|
| 2 | #
|
---|
| 3 | # Project Builder Env module
|
---|
| 4 | # Env subroutines brought by the the Project-Builder project
|
---|
| 5 | # which can be easily used by pbinit scripts
|
---|
| 6 | #
|
---|
[1528] | 7 | # Copyright B. Cornec 2007-2012
|
---|
| 8 | # Eric Anderson's changes are (c) Copyright 2012 Hewlett Packard
|
---|
| 9 | # Provided under the GPL v2
|
---|
| 10 | #
|
---|
[416] | 11 | # $Id$
|
---|
| 12 | #
|
---|
| 13 |
|
---|
| 14 | package ProjectBuilder::Env;
|
---|
| 15 |
|
---|
| 16 | use strict 'vars';
|
---|
| 17 | use Data::Dumper;
|
---|
| 18 | use English;
|
---|
| 19 | use File::Basename;
|
---|
[424] | 20 | use File::stat;
|
---|
[416] | 21 | use POSIX qw(strftime);
|
---|
| 22 | use lib qw (lib);
|
---|
[1148] | 23 | use ProjectBuilder::Version;
|
---|
[416] | 24 | use ProjectBuilder::Base;
|
---|
| 25 | use ProjectBuilder::Conf;
|
---|
[417] | 26 | use ProjectBuilder::CMS;
|
---|
[1469] | 27 | use ProjectBuilder::VCS;
|
---|
[416] | 28 |
|
---|
| 29 | # Inherit from the "Exporter" module which handles exporting functions.
|
---|
| 30 |
|
---|
[1156] | 31 | use vars qw($VERSION $REVISION @ISA @EXPORT);
|
---|
[416] | 32 | use Exporter;
|
---|
| 33 |
|
---|
| 34 | # Export, by default, all the functions into the namespace of
|
---|
| 35 | # any code which uses this module.
|
---|
| 36 |
|
---|
| 37 | our @ISA = qw(Exporter);
|
---|
[973] | 38 | our @EXPORT = qw(pb_env_init pb_env_init_pbrc);
|
---|
[1156] | 39 | ($VERSION,$REVISION) = pb_version_init();
|
---|
[416] | 40 |
|
---|
| 41 | =pod
|
---|
| 42 |
|
---|
| 43 | =head1 NAME
|
---|
| 44 |
|
---|
| 45 | ProjectBuilder::Env, part of the project-builder.org
|
---|
| 46 |
|
---|
| 47 | =head1 DESCRIPTION
|
---|
| 48 |
|
---|
| 49 | This modules provides environment functions suitable for pbinit calls.
|
---|
| 50 |
|
---|
| 51 | =head1 USAGE
|
---|
| 52 |
|
---|
| 53 | =over 4
|
---|
| 54 |
|
---|
[973] | 55 | =item B<pb_env_init_pbrc>
|
---|
[416] | 56 |
|
---|
[973] | 57 | This function setup/use the configuration file in the HOME directory
|
---|
| 58 | It sets up environment variables (PBETC)
|
---|
[416] | 59 |
|
---|
| 60 | =cut
|
---|
| 61 |
|
---|
[973] | 62 | sub pb_env_init_pbrc {
|
---|
[416] | 63 |
|
---|
[1348] | 64 | # if sudo, then get the real id of the user launching the context
|
---|
[1181] | 65 | # to point to the right conf file
|
---|
| 66 | # Mandatory for rpmbootstrap calls
|
---|
| 67 | my $dir;
|
---|
[416] | 68 |
|
---|
[1181] | 69 | if (defined $ENV{'SUDO_USER'}) {
|
---|
| 70 | # Home dir is the 8th field in list context
|
---|
| 71 | $dir = (getpwnam($ENV{'SUDO_USER'}))[7];
|
---|
| 72 | } else {
|
---|
| 73 | $dir = $ENV{'HOME'};
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | $ENV{'PBETC'} = "$dir/.pbrc";
|
---|
| 77 |
|
---|
[851] | 78 | if (! -f $ENV{'PBETC'}) {
|
---|
[933] | 79 | pb_log(0, "No existing $ENV{'PBETC'} found, creating one as template\n");
|
---|
[851] | 80 | open(PBRC, "> $ENV{'PBETC'}") || die "Unable to create $ENV{'PBETC'}";
|
---|
| 81 | print PBRC << "EOF";
|
---|
| 82 | #
|
---|
| 83 | # Define for each project the URL of its pbconf repository
|
---|
| 84 | # No default option allowed here as they need to be all different
|
---|
| 85 | #
|
---|
| 86 | #pbconfurl example = svn+ssh://svn.example.org/svn/pb/projects/example/pbconf
|
---|
| 87 | #pbconfurl pb = svn+ssh://svn.project-builder.org/mondo/svn/pb/pbconf
|
---|
| 88 |
|
---|
| 89 | # Under that dir will take place everything related to pb
|
---|
| 90 | # If you want to use VMs/chroot/..., then use \$ENV{'HOME'} to make it portable
|
---|
| 91 | # to your VMs/chroot/...
|
---|
| 92 | # if not defined then /var/cache
|
---|
| 93 | #pbdefdir default = \$ENV{'HOME'}/pb/projects
|
---|
| 94 | #pbdefdir pb = \$ENV{'HOME'}
|
---|
| 95 |
|
---|
| 96 | # If not defined, pbconfdir is under pbdefdir/pbproj/pbconf
|
---|
| 97 | #pbconfdir pb = \$ENV{'HOME'}/pb/pbconf
|
---|
| 98 |
|
---|
| 99 | # If not defined, pbprojdir is under pbdefdir/pbproj
|
---|
| 100 | # Only defined if we have access to the dev of the project
|
---|
| 101 | #pbprojdir example = \$ENV{'HOME'}/example/svn
|
---|
| 102 |
|
---|
| 103 | # We have commit acces to these
|
---|
| 104 | #pburl example = cvs+ssh://user\@example.cvs.sourceforge.net:/cvsroot/example
|
---|
| 105 | #pburl pb = svn+ssh://svn.project-builder.org/mondo/svn/pb
|
---|
| 106 |
|
---|
| 107 | # I mask my real login on the ssh machines here
|
---|
| 108 | #sshlogin example = user
|
---|
| 109 |
|
---|
| 110 | # where to find Build System infos:
|
---|
| 111 | #vmpath default = /home/qemu
|
---|
[1176] | 112 | #vepath default = /home/rpmbootstrap
|
---|
| 113 | #rmpath default = /home/remote
|
---|
[851] | 114 |
|
---|
| 115 | # Overwrite generic setup
|
---|
| 116 | #vmport pb = 2223
|
---|
| 117 | #vmport example = 2224
|
---|
[1278] | 118 |
|
---|
| 119 | # Info on who is packaging
|
---|
| 120 | #pbpackager default = William Porte <bill\@porte.org>
|
---|
| 121 | #pbpassphrase default = TheScretePassPhrase
|
---|
| 122 | #pbpassfile default = /home/williamporte/secret/passfile
|
---|
[851] | 123 | EOF
|
---|
| 124 | }
|
---|
| 125 |
|
---|
[416] | 126 | # We only have one configuration file for now.
|
---|
| 127 | pb_conf_add("$ENV{'PBETC'}");
|
---|
[973] | 128 | }
|
---|
[416] | 129 |
|
---|
[973] | 130 | =item B<pb_env_init>
|
---|
| 131 |
|
---|
| 132 | This function setup the environment for project-builder.
|
---|
| 133 | The first parameter is the project if given on the command line.
|
---|
| 134 | The second parameter is a flag indicating whether we should setup up the pbconf environment or not.
|
---|
| 135 | The third parameter is the action passed to pb.
|
---|
| 136 | It sets up environement variables (PBETC, PBPROJ, PBDEFDIR, PBBUILDDIR, PBROOTDIR, PBDESTDIR, PBCONFDIR, PBPROJVER)
|
---|
| 137 |
|
---|
| 138 | =cut
|
---|
| 139 |
|
---|
| 140 | sub pb_env_init {
|
---|
| 141 |
|
---|
| 142 | my $proj=shift || undef;
|
---|
| 143 | my $pbinit=shift || undef;
|
---|
| 144 | my $action=shift;
|
---|
[1425] | 145 | my $pbkeep=shift || 0;
|
---|
[973] | 146 | my $ver;
|
---|
| 147 | my $tag;
|
---|
| 148 |
|
---|
[1495] | 149 | pb_conf_init($proj);
|
---|
[973] | 150 | pb_env_init_pbrc();
|
---|
| 151 |
|
---|
[416] | 152 | #
|
---|
| 153 | # We get the pbconf file for that project
|
---|
| 154 | # and use its content
|
---|
| 155 | #
|
---|
| 156 | my ($pbconf) = pb_conf_get("pbconfurl");
|
---|
| 157 | pb_log(2,"DEBUG pbconfurl: ".Dumper($pbconf)."\n");
|
---|
| 158 |
|
---|
| 159 | my %pbconf = %$pbconf;
|
---|
| 160 | if (not defined $proj) {
|
---|
| 161 | # Take the first as the default project
|
---|
| 162 | $proj = (keys %pbconf)[0];
|
---|
| 163 | if (defined $proj) {
|
---|
| 164 | pb_log(1,"WARNING: using $proj as default project as none has been specified\n");
|
---|
| 165 | pb_log(1," Please either create a pbconfurl reference for project $proj in $ENV{'PBETC'}\n");
|
---|
| 166 | pb_log(1," or call pb with the -p project option or use the env var PBPROJ\n");
|
---|
| 167 | pb_log(1," if you want to use another project\n");
|
---|
| 168 | }
|
---|
| 169 | }
|
---|
| 170 | die "No project defined - use env var PBPROJ or -p proj or a pbconfurl entry in $ENV{'PBETC'}" if (not (defined $proj));
|
---|
| 171 |
|
---|
| 172 | # That's always the environment variable that will be used
|
---|
| 173 | $ENV{'PBPROJ'} = $proj;
|
---|
| 174 | pb_log(2,"PBPROJ: $ENV{'PBPROJ'}\n");
|
---|
| 175 |
|
---|
| 176 | if (not defined ($pbconf{$ENV{'PBPROJ'}})) {
|
---|
| 177 | die "Please create a pbconfurl reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n";
|
---|
| 178 | }
|
---|
| 179 |
|
---|
[736] | 180 | # Adds a potential conf file now as it's less
|
---|
[416] | 181 | # important than the project conf file
|
---|
[1176] | 182 | my ($vmpath,$vepath,$rmpath) = pb_conf_get_if("vmpath","vepath","rmpath");
|
---|
[1584] | 183 | foreach my $p ($vmpath,$vepath,$rmpath) {
|
---|
| 184 | if ((defined $p) && (defined $p->{$ENV{'PBPROJ'}})) {
|
---|
| 185 | $p->{$ENV{'PBPROJ'}} = pb_path_expand($p->{$ENV{'PBPROJ'}});
|
---|
| 186 | pb_conf_add("$p->{$ENV{'PBPROJ'}}/.pbrc") if (-f "$p->{$ENV{'PBPROJ'}}/.pbrc");
|
---|
| 187 | }
|
---|
| 188 | }
|
---|
[416] | 189 |
|
---|
| 190 | #
|
---|
| 191 | # Detect the root dir for hosting all the content generated with pb
|
---|
| 192 | #
|
---|
[1083] | 193 | =pod
|
---|
[416] | 194 |
|
---|
[539] | 195 | Tree will look like this:
|
---|
| 196 |
|
---|
| 197 | maint pbdefdir PBDEFDIR dev dir (optional)
|
---|
| 198 | | |
|
---|
| 199 | ------------------------ --------------------
|
---|
| 200 | | | | |
|
---|
| 201 | pbproj1 pbproj2 PBPROJ pbproj1 pbproj2 PBPROJDIR
|
---|
| 202 | | |
|
---|
| 203 | --------------------------------------------- ----------
|
---|
| 204 | * * * | | | * *
|
---|
| 205 | tag dev pbconf ... build delivery PBCONFDIR dev tag
|
---|
| 206 | | | | PBDESTDIR |
|
---|
| 207 | --- ------ pbrc PBBUILDDIR -------
|
---|
| 208 | | | | | |
|
---|
| 209 | 1.1 dev tag 1.0 1.1 PBDIR
|
---|
| 210 | |
|
---|
| 211 | -------
|
---|
| 212 | | |
|
---|
| 213 | 1.0 1.1 PBROOTDIR
|
---|
| 214 | |
|
---|
| 215 | ----------------------------------
|
---|
| 216 | | | | |
|
---|
| 217 | pkg1 pbproj1.pb pbfilter pbcl
|
---|
| 218 | |
|
---|
| 219 | -----------------
|
---|
| 220 | | | |
|
---|
| 221 | rpm deb pbfilter
|
---|
| 222 |
|
---|
| 223 |
|
---|
| 224 | (*) By default, if no relocation in .pbrc, dev dir is taken in the maint pbdefdir (when appropriate)
|
---|
| 225 | Names under a pbproj and the corresponding pbconf should be similar
|
---|
| 226 |
|
---|
[1083] | 227 | =back
|
---|
| 228 |
|
---|
[539] | 229 | =cut
|
---|
| 230 |
|
---|
[416] | 231 | my ($pbdefdir) = pb_conf_get_if("pbdefdir");
|
---|
| 232 |
|
---|
| 233 | if (not defined $ENV{'PBDEFDIR'}) {
|
---|
| 234 | if ((not defined $pbdefdir) || (not defined $pbdefdir->{$ENV{'PBPROJ'}})) {
|
---|
| 235 | pb_log(1,"WARNING: no pbdefdir defined, using /var/cache\n");
|
---|
| 236 | pb_log(1," Please create a pbdefdir reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n");
|
---|
| 237 | pb_log(1," if you want to use another directory\n");
|
---|
| 238 | $ENV{'PBDEFDIR'} = "/var/cache";
|
---|
| 239 | } else {
|
---|
| 240 | # That's always the environment variable that will be used
|
---|
| 241 | $ENV{'PBDEFDIR'} = $pbdefdir->{$ENV{'PBPROJ'}};
|
---|
| 242 | }
|
---|
| 243 | }
|
---|
| 244 | # Expand potential env variable in it
|
---|
[1506] | 245 | $ENV{PBDEFDIR} = pb_path_expand($ENV{PBDEFDIR});
|
---|
[416] | 246 | pb_log(2,"PBDEFDIR: $ENV{'PBDEFDIR'}\n");
|
---|
[452] | 247 |
|
---|
[1469] | 248 | # Need to do that earlier as it's used potentialy in pb_vcs_add
|
---|
[1425] | 249 | pb_temp_init($pbkeep);
|
---|
[595] | 250 | pb_log(2,"PBTMP: $ENV{'PBTMP'}\n");
|
---|
| 251 |
|
---|
[452] | 252 | # Put under CMS the PBPROJ dir
|
---|
[736] | 253 | if ($action =~ /^newproj$/) {
|
---|
[452] | 254 | if (! -d "$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}") {
|
---|
[933] | 255 | # TODO: There is also the need to do
|
---|
| 256 | # svn import "$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}" svn://repo
|
---|
| 257 | # in case it doesn't exist there
|
---|
[1212] | 258 | pb_mkdir_p("$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}");
|
---|
[452] | 259 | }
|
---|
[1469] | 260 | pb_vcs_add($pbconf{$ENV{'PBPROJ'}},"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}");
|
---|
[452] | 261 | }
|
---|
| 262 |
|
---|
[416] | 263 | #
|
---|
| 264 | # Set delivery directory
|
---|
| 265 | #
|
---|
| 266 | $ENV{'PBDESTDIR'}="$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/delivery";
|
---|
| 267 |
|
---|
| 268 | pb_log(2,"PBDESTDIR: $ENV{'PBDESTDIR'}\n");
|
---|
| 269 | #
|
---|
| 270 | # Removes all directory existing below the delivery dir
|
---|
[417] | 271 | # as they are temp dir only except when called from pbinit
|
---|
[416] | 272 | # Files stay and have to be cleaned up manually if needed
|
---|
| 273 | # those files serves as communication channels between pb phases
|
---|
| 274 | # Removing them prevents a following phase to detect what has been done before
|
---|
| 275 | #
|
---|
[417] | 276 | if ((-d $ENV{'PBDESTDIR'}) && ($action !~ /pbinit/)) {
|
---|
[416] | 277 | opendir(DIR,$ENV{'PBDESTDIR'}) || die "Unable to open directory $ENV{'PBDESTDIR'}: $!";
|
---|
| 278 | foreach my $d (readdir(DIR)) {
|
---|
| 279 | next if ($d =~ /^\./);
|
---|
| 280 | next if (-f "$ENV{'PBDESTDIR'}/$d");
|
---|
| 281 | pb_rm_rf("$ENV{'PBDESTDIR'}/$d") if (-d "$ENV{'PBDESTDIR'}/$d");
|
---|
| 282 | }
|
---|
| 283 | closedir(DIR);
|
---|
| 284 | }
|
---|
| 285 | if (! -d "$ENV{'PBDESTDIR'}") {
|
---|
[1212] | 286 | pb_mkdir_p($ENV{'PBDESTDIR'});
|
---|
[416] | 287 | }
|
---|
| 288 |
|
---|
| 289 | #
|
---|
| 290 | # Set build directory
|
---|
| 291 | #
|
---|
| 292 | $ENV{'PBBUILDDIR'}="$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/build";
|
---|
| 293 | if (! -d "$ENV{'PBBUILDDIR'}") {
|
---|
[1212] | 294 | pb_mkdir_p($ENV{'PBBUILDDIR'});
|
---|
[416] | 295 | }
|
---|
| 296 |
|
---|
| 297 | pb_log(2,"PBBUILDDIR: $ENV{'PBBUILDDIR'}\n");
|
---|
| 298 |
|
---|
[1176] | 299 | return if ($action =~ /^clean$/);
|
---|
[416] | 300 | #
|
---|
[1176] | 301 | # The following part is only useful when in sbx|cms2something or newsomething
|
---|
| 302 | # In VMs/VEs/RMs we want to skip that by providing good env vars.
|
---|
[416] | 303 | # return values in that case are useless
|
---|
| 304 | #
|
---|
[1094] | 305 |
|
---|
[1584] | 306 | if ($action =~ /^(cms2|sbx2|newver|pbinit|newproj|announce|checkssh|cleanssh|getconf)/) {
|
---|
[416] | 307 |
|
---|
| 308 | #
|
---|
| 309 | # Check pbconf cms compliance
|
---|
| 310 | #
|
---|
| 311 | pb_cms_compliant("pbconfdir",'PBCONFDIR',"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}/pbconf",$pbconf{$ENV{'PBPROJ'}},$pbinit);
|
---|
| 312 |
|
---|
| 313 | # Check where is our PBROOTDIR (release tag name can't be guessed the first time)
|
---|
| 314 | #
|
---|
| 315 | if (not defined $ENV{'PBROOTDIR'}) {
|
---|
| 316 | if (! -f ("$ENV{'PBDESTDIR'}/pbrc")) {
|
---|
[736] | 317 | $ENV{'PBROOTDIR'} = "$ENV{'PBCONFDIR'}";
|
---|
[416] | 318 | pb_log(1,"WARNING: no pbroot defined, using $ENV{'PBROOTDIR'}\n");
|
---|
| 319 | pb_log(1," Please use -r release if you want to use another release\n");
|
---|
[452] | 320 | die "No directory found under $ENV{'PBCONFDIR'}" if (not defined $ENV{'PBROOTDIR'});
|
---|
[416] | 321 | } else {
|
---|
| 322 | my ($pbroot) = pb_conf_read_if("$ENV{'PBDESTDIR'}/pbrc","pbroot");
|
---|
| 323 | # That's always the environment variable that will be used
|
---|
| 324 | die "Please remove inconsistent $ENV{'PBDESTDIR'}/pbrc" if ((not defined $pbroot) || (not defined $pbroot->{$ENV{'PBPROJ'}}));
|
---|
| 325 | $ENV{'PBROOTDIR'} = $pbroot->{$ENV{'PBPROJ'}};
|
---|
| 326 | }
|
---|
| 327 | } else {
|
---|
| 328 | # transform in full path if relative
|
---|
| 329 | $ENV{'PBROOTDIR'} = "$ENV{'PBCONFDIR'}/$ENV{'PBROOTDIR'}" if ($ENV{'PBROOTDIR'} !~ /^\//);
|
---|
| 330 | pb_mkdir_p($ENV{'PBROOTDIR'}) if (defined $pbinit);
|
---|
| 331 | die "$ENV{'PBROOTDIR'} is not a directory" if (not -d $ENV{'PBROOTDIR'});
|
---|
| 332 | }
|
---|
[1363] | 333 | pb_log(1,"PBROOTDIR=$ENV{'PBROOTDIR'}\n");
|
---|
[416] | 334 |
|
---|
| 335 | # Adds that conf file to the list to consider
|
---|
| 336 | pb_conf_add("$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb") if (-f "$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb");
|
---|
| 337 |
|
---|
[1584] | 338 | return if ($action =~ /^(newver|getconf)$/);
|
---|
[416] | 339 |
|
---|
| 340 | my %version = ();
|
---|
| 341 | my %defpkgdir = ();
|
---|
| 342 | my %extpkgdir = ();
|
---|
| 343 | my %filteredfiles = ();
|
---|
| 344 | my %supfiles = ();
|
---|
| 345 |
|
---|
| 346 | if ((-f "$ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb") and (not defined $pbinit)) {
|
---|
| 347 |
|
---|
| 348 | # List of pkg to build by default (mandatory)
|
---|
[933] | 349 | # TODO: projtag could be with a 1 default value
|
---|
[416] | 350 | my ($defpkgdir,$pbpackager, $pkgv, $pkgt) = pb_conf_get("defpkgdir","pbpackager","projver","projtag");
|
---|
| 351 | # List of additional pkg to build when all is called (optional)
|
---|
| 352 | # Valid version names (optional)
|
---|
| 353 | # List of files to filter (optional)
|
---|
| 354 | # Project version and tag (optional)
|
---|
| 355 | my ($extpkgdir, $version, $filteredfiles, $supfiles) = pb_conf_get_if("extpkgdir","version","filteredfiles","supfiles");
|
---|
| 356 | pb_log(2,"DEBUG: defpkgdir: ".Dumper($defpkgdir)."\n");
|
---|
| 357 | pb_log(2,"DEBUG: extpkgdir: ".Dumper($extpkgdir)."\n");
|
---|
| 358 | pb_log(2,"DEBUG: version: ".Dumper($version)."\n");
|
---|
| 359 | pb_log(2,"DEBUG: filteredfiles: ".Dumper($filteredfiles)."\n");
|
---|
| 360 | pb_log(2,"DEBUG: supfiles: ".Dumper($supfiles)."\n");
|
---|
| 361 | # Global
|
---|
| 362 | %defpkgdir = %$defpkgdir;
|
---|
| 363 | %extpkgdir = %$extpkgdir if (defined $extpkgdir);
|
---|
| 364 | %version = %$version if (defined $version);
|
---|
| 365 | %filteredfiles = %$filteredfiles if (defined $filteredfiles);
|
---|
| 366 | %supfiles = %$supfiles if (defined $supfiles);
|
---|
| 367 | #
|
---|
| 368 | # Get global Version/Tag
|
---|
| 369 | #
|
---|
| 370 | if (not defined $ENV{'PBPROJVER'}) {
|
---|
| 371 | if ((defined $pkgv) && (defined $pkgv->{$ENV{'PBPROJ'}})) {
|
---|
| 372 | $ENV{'PBPROJVER'}=$pkgv->{$ENV{'PBPROJ'}};
|
---|
| 373 | } else {
|
---|
| 374 | die "No projver found in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
|
---|
| 375 | }
|
---|
| 376 | }
|
---|
| 377 | die "Invalid version name $ENV{'PBPROJVER'} in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb" if (($ENV{'PBPROJVER'} !~ /[0-9.]+/) && (not defined $version) && ($ENV{'PBPROJVER'} =~ /$version{$ENV{'PBPROJ'}}/));
|
---|
| 378 |
|
---|
| 379 | if (not defined $ENV{'PBPROJTAG'}) {
|
---|
| 380 | if ((defined $pkgt) && (defined $pkgt->{$ENV{'PBPROJ'}})) {
|
---|
| 381 | $ENV{'PBPROJTAG'}=$pkgt->{$ENV{'PBPROJ'}};
|
---|
| 382 | } else {
|
---|
| 383 | die "No projtag found in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
|
---|
| 384 | }
|
---|
| 385 | }
|
---|
| 386 | die "Invalid tag name $ENV{'PBPROJTAG'} in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb" if ($ENV{'PBPROJTAG'} !~ /[0-9.]+/);
|
---|
| 387 |
|
---|
| 388 |
|
---|
| 389 | if (not defined $ENV{'PBPACKAGER'}) {
|
---|
| 390 | if ((defined $pbpackager) && (defined $pbpackager->{$ENV{'PBPROJ'}})) {
|
---|
| 391 | $ENV{'PBPACKAGER'}=$pbpackager->{$ENV{'PBPROJ'}};
|
---|
| 392 | } else {
|
---|
| 393 | die "No pbpackager found in $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
|
---|
| 394 | }
|
---|
| 395 | }
|
---|
| 396 | } else {
|
---|
| 397 | if (defined $pbinit) {
|
---|
[452] | 398 | my @pkgs = @ARGV;
|
---|
[416] | 399 | @pkgs = ("pkg1") if (not @pkgs);
|
---|
| 400 |
|
---|
| 401 | open(CONF,"> $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb") || die "Unable to create $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
|
---|
| 402 | print CONF << "EOF";
|
---|
| 403 | #
|
---|
| 404 | # Project Builder configuration file
|
---|
| 405 | # For project $ENV{'PBPROJ'}
|
---|
| 406 | #
|
---|
| 407 | # \$Id\$
|
---|
| 408 | #
|
---|
| 409 |
|
---|
| 410 | #
|
---|
| 411 | # What is the project URL
|
---|
| 412 | #
|
---|
| 413 | #pburl $ENV{'PBPROJ'} = svn://svn.$ENV{'PBPROJ'}.org/$ENV{'PBPROJ'}/devel
|
---|
| 414 | #pburl $ENV{'PBPROJ'} = svn://svn+ssh.$ENV{'PBPROJ'}.org/$ENV{'PBPROJ'}/devel
|
---|
| 415 | #pburl $ENV{'PBPROJ'} = cvs://cvs.$ENV{'PBPROJ'}.org/$ENV{'PBPROJ'}/devel
|
---|
| 416 | #pburl $ENV{'PBPROJ'} = http://www.$ENV{'PBPROJ'}.org/src/$ENV{'PBPROJ'}-devel.tar.gz
|
---|
| 417 | #pburl $ENV{'PBPROJ'} = ftp://ftp.$ENV{'PBPROJ'}.org/src/$ENV{'PBPROJ'}-devel.tar.gz
|
---|
| 418 | #pburl $ENV{'PBPROJ'} = file:///src/$ENV{'PBPROJ'}-devel.tar.gz
|
---|
| 419 | #pburl $ENV{'PBPROJ'} = dir:///src/$ENV{'PBPROJ'}-devel
|
---|
| 420 |
|
---|
[453] | 421 | # Repository
|
---|
| 422 | #pbrepo $ENV{'PBPROJ'} = ftp://ftp.$ENV{'PBPROJ'}.org
|
---|
[481] | 423 | #pbml $ENV{'PBPROJ'} = $ENV{'PBPROJ'}-announce\@lists.$ENV{'PBPROJ'}.org
|
---|
| 424 | #pbsmtp $ENV{'PBPROJ'} = localhost
|
---|
[1526] | 425 | #pbgpgcheck $ENV{'PBPROJ'} = 1
|
---|
[1555] | 426 | # For distro supporting it, which area is used
|
---|
[1526] | 427 | #projcomponent $ENV{'PBPROJ'} = main
|
---|
[453] | 428 |
|
---|
[416] | 429 | # Check whether project is well formed
|
---|
[456] | 430 | # when downloading from ftp/http/...
|
---|
[416] | 431 | # (containing already a directory with the project-version name)
|
---|
| 432 | #pbwf $ENV{'PBPROJ'} = 1
|
---|
| 433 |
|
---|
[1556] | 434 | # Do we check GPG keys
|
---|
| 435 | #pbgpgcheck $ENV{'PBPROJ'} = 1
|
---|
| 436 |
|
---|
[416] | 437 | #
|
---|
| 438 | # Packager label
|
---|
| 439 | #
|
---|
| 440 | #pbpackager $ENV{'PBPROJ'} = William Porte <bill\@$ENV{'PBPROJ'}.org>
|
---|
| 441 | #
|
---|
| 442 |
|
---|
| 443 | # For delivery to a machine by SSH (potentially the FTP server)
|
---|
| 444 | # Needs hostname, account and directory
|
---|
| 445 | #
|
---|
| 446 | #sshhost $ENV{'PBPROJ'} = www.$ENV{'PBPROJ'}.org
|
---|
| 447 | #sshlogin $ENV{'PBPROJ'} = bill
|
---|
| 448 | #sshdir $ENV{'PBPROJ'} = /$ENV{'PBPROJ'}/ftp
|
---|
| 449 | #sshport $ENV{'PBPROJ'} = 22
|
---|
| 450 |
|
---|
| 451 | #
|
---|
| 452 | # For Virtual machines management
|
---|
| 453 | # Naming convention to follow: distribution name (as per ProjectBuilder::Distribution)
|
---|
| 454 | # followed by '-' and by release number
|
---|
| 455 | # followed by '-' and by architecture
|
---|
| 456 | # a .vmtype extension will be added to the resulting string
|
---|
| 457 | # a QEMU rhel-3-i286 here means that the VM will be named rhel-3-i386.qemu
|
---|
| 458 | #
|
---|
[890] | 459 | #vmlist $ENV{'PBPROJ'} = mandrake-10.1-i386,mandrake-10.2-i386,mandriva-2006.0-i386,mandriva-2007.0-i386,mandriva-2007.1-i386,mandriva-2008.0-i386,redhat-7.3-i386,redhat-9-i386,fedora-4-i386,fedora-5-i386,fedora-6-i386,fedora-7-i386,fedora-8-i386,rhel-3-i386,rhel-4-i386,rhel-5-i386,suse-10.0-i386,suse-10.1-i386,suse-10.2-i386,suse-10.3-i386,sles-9-i386,sles-10-i386,gentoo-nover-i386,debian-3.1-i386,debian-4.0-i386,ubuntu-6.06-i386,ubuntu-7.04-i386,ubuntu-7.10-i386,mandriva-2007.0-x86_64,mandriva-2007.1-x86_64,mandriva-2008.0-x86_64,fedora-6-x86_64,fedora-7-x86_64,fedora-8-x86_64,rhel-4-x86_64,rhel-5-x86_64,suse-10.2-x86_64,suse-10.3-x86_64,sles-10-x86_64,gentoo-nover-x86_64,debian-4.0-x86_64,ubuntu-7.04-x86_64,ubuntu-7.10-x86_64,solaris-10-x86_64
|
---|
[416] | 460 |
|
---|
| 461 | #
|
---|
| 462 | # Valid values for vmtype are
|
---|
| 463 | # qemu, (vmware, xen, ... TBD)
|
---|
| 464 | #vmtype $ENV{'PBPROJ'} = qemu
|
---|
| 465 |
|
---|
| 466 | # Hash for VM stuff on vmtype
|
---|
| 467 | #vmntp default = pool.ntp.org
|
---|
| 468 |
|
---|
| 469 | # We suppose we can commmunicate with the VM through SSH
|
---|
| 470 | #vmhost $ENV{'PBPROJ'} = localhost
|
---|
| 471 | #vmlogin $ENV{'PBPROJ'} = pb
|
---|
| 472 | #vmport $ENV{'PBPROJ'} = 2222
|
---|
| 473 |
|
---|
| 474 | # Timeout to wait when VM is launched/stopped
|
---|
| 475 | #vmtmout default = 120
|
---|
| 476 |
|
---|
| 477 | # per VMs needed paramaters
|
---|
| 478 | #vmopt $ENV{'PBPROJ'} = -m 384 -daemonize
|
---|
| 479 | #vmpath $ENV{'PBPROJ'} = /home/qemu
|
---|
| 480 | #vmsize $ENV{'PBPROJ'} = 5G
|
---|
| 481 |
|
---|
| 482 | #
|
---|
| 483 | # For Virtual environment management
|
---|
| 484 | # Naming convention to follow: distribution name (as per ProjectBuilder::Distribution)
|
---|
| 485 | # followed by '-' and by release number
|
---|
| 486 | # followed by '-' and by architecture
|
---|
| 487 | # a .vetype extension will be added to the resulting string
|
---|
| 488 | # a chroot rhel-3-i286 here means that the VE will be named rhel-3-i386.chroot
|
---|
| 489 | #
|
---|
| 490 | #velist $ENV{'PBPROJ'} = fedora-7-i386
|
---|
| 491 |
|
---|
| 492 | # VE params
|
---|
| 493 | #vetype $ENV{'PBPROJ'} = chroot
|
---|
| 494 | #ventp default = pool.ntp.org
|
---|
| 495 | #velogin $ENV{'PBPROJ'} = pb
|
---|
[986] | 496 | #vepath $ENV{'PBPROJ'} = /var/cache/rpmbootstrap
|
---|
| 497 | #rbsconf $ENV{'PBPROJ'} = /etc/mock
|
---|
[416] | 498 | #verebuild $ENV{'PBPROJ'} = false
|
---|
| 499 |
|
---|
| 500 | #
|
---|
| 501 | # Global version/tag for the project
|
---|
| 502 | #
|
---|
| 503 | #projver $ENV{'PBPROJ'} = devel
|
---|
| 504 | #projtag $ENV{'PBPROJ'} = 1
|
---|
| 505 |
|
---|
| 506 | # Hash of valid version names
|
---|
[709] | 507 |
|
---|
| 508 | # Additional repository to add at build time
|
---|
[1066] | 509 | # addrepo centos-5-x86_64 = http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm,ftp://ftp.project-builder.org/centos/5/pb.repo
|
---|
| 510 | # addrepo centos-5-x86_64 = http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm,ftp://ftp.project-builder.org/centos/5/pb.repo
|
---|
[416] | 511 | #version $ENV{'PBPROJ'} = devel,stable
|
---|
| 512 |
|
---|
[456] | 513 | # Is it a test version or a production version
|
---|
| 514 | testver $ENV{'PBPROJ'} = true
|
---|
[1066] | 515 | # Which upper target dir for delivery
|
---|
| 516 | delivery $ENV{'PBPROJ'} = test
|
---|
[456] | 517 |
|
---|
[703] | 518 | # Additional repository to add at build time
|
---|
[1066] | 519 | # addrepo centos-5-x86_64 = http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm,ftp://ftp.project-builder.org/centos/5/pb.repo
|
---|
| 520 | # addrepo centos-4-x86_64 = http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el4.rf.x86_64.rpm,ftp://ftp.project-builder.org/centos/4/pb.repo
|
---|
[703] | 521 |
|
---|
[416] | 522 | # Adapt to your needs:
|
---|
| 523 | # Optional if you need to overwrite the global values above
|
---|
| 524 | #
|
---|
| 525 | EOF
|
---|
| 526 |
|
---|
| 527 | foreach my $pp (@pkgs) {
|
---|
| 528 | print CONF << "EOF";
|
---|
| 529 | #pkgver $pp = stable
|
---|
| 530 | #pkgtag $pp = 3
|
---|
| 531 | EOF
|
---|
| 532 | }
|
---|
| 533 | foreach my $pp (@pkgs) {
|
---|
| 534 | print CONF << "EOF";
|
---|
| 535 | # Hash of default package/package directory
|
---|
| 536 | #defpkgdir $pp = dir-$pp
|
---|
| 537 | EOF
|
---|
| 538 | }
|
---|
| 539 |
|
---|
| 540 | print CONF << "EOF";
|
---|
| 541 | # Hash of additional package/package directory
|
---|
| 542 | #extpkgdir minor-pkg = dir-minor-pkg
|
---|
| 543 |
|
---|
| 544 | # List of files per pkg on which to apply filters
|
---|
| 545 | # Files are mentioned relatively to pbroot/defpkgdir
|
---|
| 546 | EOF
|
---|
| 547 | foreach my $pp (@pkgs) {
|
---|
| 548 | print CONF << "EOF";
|
---|
| 549 | #filteredfiles $pp = Makefile.PL,configure.in,install.sh,$pp.8
|
---|
| 550 | #supfiles $pp = $pp.init
|
---|
[592] | 551 |
|
---|
| 552 | # For perl modules, names are different depending on distro
|
---|
| 553 | # Here perl-xxx for RPMs, libxxx-perl for debs, ...
|
---|
| 554 | # So the package name is indeed virtual
|
---|
| 555 | #namingtype $pp = perl
|
---|
[416] | 556 | EOF
|
---|
| 557 | }
|
---|
| 558 | close(CONF);
|
---|
[1212] | 559 | pb_mkdir_p("$ENV{'PBROOTDIR'}/pbfilter");
|
---|
[416] | 560 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/all.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/all.pbf";
|
---|
| 561 | print CONF << "EOF";
|
---|
| 562 | #
|
---|
| 563 | # \$Id\$
|
---|
| 564 | #
|
---|
| 565 | # Filter for all files
|
---|
| 566 | #
|
---|
[430] | 567 | #
|
---|
| 568 | # PBREPO is replaced by the root URL to access the repository
|
---|
[500] | 569 | filter PBREPO = \$pb->{'repo'}
|
---|
[416] | 570 |
|
---|
[430] | 571 | # PBSRC is replaced by the source package location after the repo
|
---|
| 572 | #filter PBSRC = src/%{name}-%{version}.tar.gz
|
---|
[540] | 573 | # Used if virtual name != real name (perl, ...)
|
---|
| 574 | #filter PBSRC = src/%{srcname}-%{version}.tar.gz
|
---|
[430] | 575 |
|
---|
[500] | 576 | # PBVER is replaced by the version (\$pb->{'ver'} in code)
|
---|
[1469] | 577 | filter PBVER = \$pb->{'ver'}\$pb->{'extdir'}
|
---|
[416] | 578 |
|
---|
[500] | 579 | # PBDATE is replaced by the date (\$pb->{'date'} in code)
|
---|
| 580 | filter PBDATE = \$pb->{'date'}
|
---|
[416] | 581 |
|
---|
[1443] | 582 | # PBEXTDIR is replaced by the testdir extension if needed (\$pb->{'extdir'} in code)
|
---|
| 583 | filter PBEXTDIR = \$pb->{'extdir'}
|
---|
| 584 |
|
---|
[1130] | 585 | # PBPATCHSRC is replaced by the patches names if value is yes. Patches are located under the pbpatch dir of the pkg.
|
---|
[500] | 586 | #filter PBPATCHSRC = yes
|
---|
[416] | 587 |
|
---|
[500] | 588 | # PBPATCHCMD is replaced by the patches commands if value is yes
|
---|
| 589 | #filter PBPATCHCMD = yes
|
---|
[416] | 590 |
|
---|
[1130] | 591 | # PBMULTISRC is replaced by the sources names if value is yes. Sources are located under the pbsrc dir of the pkg.
|
---|
| 592 | #filter PBMULTISRC = yes
|
---|
| 593 |
|
---|
[500] | 594 | # PBTAG is replaced by the tag (\$pb->{'tag'} in code)
|
---|
| 595 | filter PBTAG = \$pb->{'tag'}
|
---|
[416] | 596 |
|
---|
[500] | 597 | # PBREV is replaced by the revision (\$pb->{'rev'} in code)
|
---|
| 598 | filter PBREV = \$pb->{'rev'}
|
---|
[416] | 599 |
|
---|
[540] | 600 | # PBREALPKG is replaced by the package name (\$pb->{'realpkg'} in code)
|
---|
| 601 | filter PBREALPKG = \$pb->{'realpkg'}
|
---|
| 602 |
|
---|
[500] | 603 | # PBPKG is replaced by the package name (\$pb->{'pkg'} in code)
|
---|
| 604 | filter PBPKG = \$pb->{'pkg'}
|
---|
| 605 |
|
---|
[594] | 606 | # PBPROJ is replaced by the project name (\$pb->{'proj'} in code)
|
---|
[593] | 607 | filter PBPROJ = \$pb->{'proj'}
|
---|
[592] | 608 |
|
---|
[500] | 609 | # PBPACKAGER is replaced by the packager name (\$pb->{'packager'} in code)
|
---|
| 610 | filter PBPACKAGER = \$pb->{'packager'}
|
---|
| 611 |
|
---|
[416] | 612 | # PBDESC contains the description of the package
|
---|
[1517] | 613 | #filter PBDESC = Bla-Bla \
|
---|
| 614 | # with a trailing \, the variable can be multi-line. \
|
---|
| 615 | # only the trailing \'s will be removed, the leading spaces, \
|
---|
| 616 | # trailing spaces, and newlines will remain except on the \
|
---|
| 617 | # last line. You can use dollar slash as a way to introduce carraige \
|
---|
| 618 | # return (perl syntax). \
|
---|
| 619 | # You can use transform e.g. in rpm.pbf to adjust spaces
|
---|
[416] | 620 |
|
---|
[916] | 621 | # PBSUMMARY contains a short single line description of the package
|
---|
[933] | 622 | #filter PBSUMMARY = Bla
|
---|
[916] | 623 |
|
---|
[416] | 624 | # PBURL contains the URL of the Web site of the project
|
---|
| 625 | #filter PBURL = http://www.$ENV{'PBPROJ'}.org
|
---|
[916] | 626 |
|
---|
| 627 | # PBLOG is replaced by the changelog if value is yes
|
---|
| 628 | # and should be last as when used we need the %pb hash filled
|
---|
| 629 | #filter PBLOG = yes
|
---|
| 630 |
|
---|
[416] | 631 | EOF
|
---|
| 632 | close(CONF);
|
---|
| 633 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/rpm.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/rpm.pbf";
|
---|
| 634 | print CONF << "EOF";
|
---|
| 635 | #
|
---|
| 636 | # \$Id\$
|
---|
| 637 | #
|
---|
| 638 | # Filter for rpm build
|
---|
| 639 | #
|
---|
| 640 |
|
---|
| 641 | # PBGRP is replaced by the RPM group of apps
|
---|
| 642 | #filter PBGRP = Applications/Archiving
|
---|
| 643 |
|
---|
| 644 | # PBLIC is replaced by the license of the application
|
---|
| 645 | #filter PBLIC = GPL
|
---|
| 646 |
|
---|
| 647 | # PBDEP is replaced by the list of dependencies
|
---|
| 648 | #filter PBDEP =
|
---|
| 649 |
|
---|
[500] | 650 | # PBSUF is replaced by the package suffix (\$pb->{'suf'} in code)
|
---|
| 651 | filter PBSUF = \$pb->{'suf'}
|
---|
[416] | 652 |
|
---|
| 653 | # PBOBS is replaced by the Obsolete line
|
---|
| 654 | #filter PBOBS =
|
---|
| 655 |
|
---|
[1517] | 656 | # transform a variable from the key on the right to the key on the left using the perl expression
|
---|
| 657 | # after the input key name. Useful for taking multi-line documentation and removing trailing spaces
|
---|
| 658 | # or leading spaces.
|
---|
[1518] | 659 | #transform PBDESC = PBDESC_raw s/\\s+\\n/\\n/go;
|
---|
[1517] | 660 |
|
---|
[416] | 661 | EOF
|
---|
| 662 | close(CONF);
|
---|
[484] | 663 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/fedora.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/fedora.pbf";
|
---|
| 664 | print CONF << "EOF";
|
---|
| 665 | #
|
---|
| 666 | # \$Id\$
|
---|
| 667 | #
|
---|
| 668 | # Filter for rpm build
|
---|
| 669 | #
|
---|
| 670 |
|
---|
| 671 | # PBGRP is replaced by the RPM group of apps
|
---|
| 672 | # Cf: http://fedoraproject.org/wiki/RPMGroups
|
---|
| 673 | #filter PBGRP = Applications/Archiving
|
---|
| 674 |
|
---|
| 675 | # PBLIC is replaced by the license of the application
|
---|
| 676 | # Cf: http://fedoraproject.org/wiki/Licensing
|
---|
| 677 | #filter PBLIC = GPLv2+
|
---|
| 678 |
|
---|
| 679 | # PBDEP is replaced by the list of dependencies
|
---|
| 680 | #filter PBDEP =
|
---|
| 681 |
|
---|
[736] | 682 | # PBSUF is replaced by the package suffix (\$pb->{'suf'} in code)
|
---|
[484] | 683 | filter PBSUF = %{dist}
|
---|
| 684 |
|
---|
| 685 | # PBOBS is replaced by the Obsolete line
|
---|
| 686 | #filter PBOBS =
|
---|
| 687 |
|
---|
| 688 | EOF
|
---|
| 689 | close(CONF);
|
---|
[592] | 690 | foreach my $i (1..7) {
|
---|
| 691 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/fedora-$i.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/fedora-$i.pbf";
|
---|
| 692 | print CONF << "EOF";
|
---|
| 693 | #
|
---|
| 694 | # \$Id\$
|
---|
| 695 | #
|
---|
| 696 | # Filter for old fedora build
|
---|
| 697 | #
|
---|
| 698 |
|
---|
[593] | 699 | # PBSUF is replaced by the package suffix (\$pb->{'suf'} in code)
|
---|
[592] | 700 | filter PBSUF = \$pb->{'suf'}
|
---|
| 701 |
|
---|
| 702 | EOF
|
---|
| 703 | close(CONF);
|
---|
| 704 | }
|
---|
[416] | 705 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/deb.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/deb.pbf";
|
---|
| 706 | print CONF << "EOF";
|
---|
| 707 | #
|
---|
| 708 | # \$Id\$
|
---|
| 709 | #
|
---|
| 710 | # Filter for debian build
|
---|
| 711 | #
|
---|
| 712 | # PBGRP is replaced by the group of apps
|
---|
| 713 | filter PBGRP = utils
|
---|
| 714 |
|
---|
| 715 | # PBLIC is replaced by the license of the application
|
---|
[904] | 716 | # Cf: http://www.debian.org/legal/licenses/
|
---|
[416] | 717 | #filter PBLIC = GPL
|
---|
| 718 |
|
---|
| 719 | # PBDEP is replaced by the list of dependencies
|
---|
| 720 | #filter PBDEP =
|
---|
| 721 |
|
---|
| 722 | # PBSUG is replaced by the list of suggestions
|
---|
| 723 | #filter PBSUG =
|
---|
| 724 |
|
---|
| 725 | # PBREC is replaced by the list of recommandations
|
---|
| 726 | #filter PBREC =
|
---|
| 727 |
|
---|
| 728 | EOF
|
---|
| 729 | close(CONF);
|
---|
[916] | 730 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/debian-4.0.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/debian-4.0.pbf";
|
---|
| 731 | print CONF << "EOF";
|
---|
| 732 | #
|
---|
| 733 | # \$Id\$
|
---|
| 734 | #
|
---|
| 735 | # Filter for debian build
|
---|
| 736 | #
|
---|
| 737 | # PBDEBSTD is replaced by the Debian standard version
|
---|
| 738 | filter PBDEBSTD = 3.6.1
|
---|
| 739 |
|
---|
| 740 | # PBDEBCOMP is replaced by the Debian Compatibility value
|
---|
| 741 | filter PBDEBCOMP = 5
|
---|
| 742 |
|
---|
| 743 | EOF
|
---|
| 744 | close(CONF);
|
---|
| 745 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/debian-5.0.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/debian-5.0.pbf";
|
---|
| 746 | print CONF << "EOF";
|
---|
| 747 | #
|
---|
| 748 | # \$Id\$
|
---|
| 749 | #
|
---|
| 750 | # Filter for debian build
|
---|
| 751 | #
|
---|
| 752 | # PBDEBSTD is replaced by the Debian standard version
|
---|
| 753 | filter PBDEBSTD = 3.8.0
|
---|
| 754 |
|
---|
| 755 | # PBDEBCOMP is replaced by the Debian Compatibility value
|
---|
| 756 | filter PBDEBCOMP = 7
|
---|
| 757 |
|
---|
| 758 | EOF
|
---|
| 759 | close(CONF);
|
---|
[1257] | 760 | # 6?
|
---|
[1256] | 761 | foreach my $ubv ("debian.pbf") {
|
---|
| 762 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/$ubv") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/$ubv";
|
---|
| 763 | print CONF << "EOF";
|
---|
| 764 | #
|
---|
| 765 | # \$Id\$
|
---|
| 766 | #
|
---|
| 767 | # Filter for debian build
|
---|
| 768 | #
|
---|
| 769 | # PBDEBSTD is replaced by the Debian standard version
|
---|
| 770 | filter PBDEBSTD = 3.8.0
|
---|
| 771 |
|
---|
| 772 | # PBDEBCOMP is replaced by the Debian Compatibility value
|
---|
| 773 | filter PBDEBCOMP = 7
|
---|
| 774 |
|
---|
| 775 | EOF
|
---|
| 776 | close(CONF);
|
---|
| 777 | }
|
---|
| 778 | foreach my $ubv ("ubuntu-6.06.pbf","ubuntu-7.04.pbf","ubuntu-7.10.pbf") {
|
---|
| 779 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/$ubv") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/$ubv";
|
---|
| 780 | print CONF << "EOF";
|
---|
| 781 | #
|
---|
| 782 | # \$Id\$
|
---|
| 783 | #
|
---|
| 784 | # Filter for ubuntu build
|
---|
| 785 | #
|
---|
| 786 | # PBDEBSTD is replaced by the Debian standard version
|
---|
| 787 | filter PBDEBSTD = 3.6.2
|
---|
| 788 |
|
---|
| 789 | # PBDEBCOMP is replaced by the Debian Compatibility value
|
---|
| 790 | filter PBDEBCOMP = 4
|
---|
| 791 |
|
---|
| 792 | EOF
|
---|
| 793 | close(CONF);
|
---|
| 794 | }
|
---|
| 795 | foreach my $ubv ("ubuntu-8.04.pbf","ubuntu-8.10.pbf") {
|
---|
| 796 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/$ubv") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/$ubv";
|
---|
| 797 | print CONF << "EOF";
|
---|
| 798 | #
|
---|
| 799 | # \$Id\$
|
---|
| 800 | #
|
---|
| 801 | # Filter for ubuntu build
|
---|
| 802 | #
|
---|
| 803 | # PBDEBSTD is replaced by the Debian standard version
|
---|
| 804 | filter PBDEBSTD = 3.7.3
|
---|
| 805 |
|
---|
| 806 | # PBDEBCOMP is replaced by the Debian Compatibility value
|
---|
| 807 | filter PBDEBCOMP = 4
|
---|
| 808 |
|
---|
| 809 | EOF
|
---|
| 810 | close(CONF);
|
---|
| 811 | }
|
---|
| 812 | foreach my $ubv ("ubuntu-9.04.pbf") {
|
---|
| 813 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/$ubv") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/$ubv";
|
---|
| 814 | print CONF << "EOF";
|
---|
| 815 | #
|
---|
| 816 | # \$Id\$
|
---|
| 817 | #
|
---|
| 818 | # Filter for ubuntu build
|
---|
| 819 | #
|
---|
| 820 | # PBDEBSTD is replaced by the Debian standard version
|
---|
| 821 | filter PBDEBSTD = 3.8.0
|
---|
| 822 |
|
---|
| 823 | # PBDEBCOMP is replaced by the Debian Compatibility value
|
---|
| 824 | filter PBDEBCOMP = 4
|
---|
| 825 |
|
---|
| 826 | EOF
|
---|
| 827 | close(CONF);
|
---|
| 828 | }
|
---|
| 829 | # 9.10, 10.04, 10.10
|
---|
| 830 | foreach my $ubv ("ubuntu.pbf") {
|
---|
| 831 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/$ubv") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/$ubv";
|
---|
| 832 | print CONF << "EOF";
|
---|
| 833 | #
|
---|
| 834 | # \$Id\$
|
---|
| 835 | #
|
---|
| 836 | # Filter for ubuntu build
|
---|
| 837 | #
|
---|
| 838 | # PBDEBSTD is replaced by the Debian standard version
|
---|
| 839 | filter PBDEBSTD = 3.8.3
|
---|
| 840 |
|
---|
| 841 | # PBDEBCOMP is replaced by the Debian Compatibility value
|
---|
| 842 | filter PBDEBCOMP = 7
|
---|
| 843 |
|
---|
| 844 | EOF
|
---|
| 845 | close(CONF);
|
---|
| 846 | }
|
---|
[416] | 847 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/md.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/md.pbf";
|
---|
| 848 | print CONF << "EOF";
|
---|
| 849 | # Specific group for Mandriva for $ENV{'PBPROJ'}
|
---|
| 850 | # Cf: http://wiki.mandriva.com/en/Development/Packaging/Groups
|
---|
| 851 | #filter PBGRP = Archiving/Backup
|
---|
| 852 |
|
---|
| 853 | # PBLIC is replaced by the license of the application
|
---|
| 854 | # Cf: http://wiki.mandriva.com/en/Development/Packaging/Licenses
|
---|
| 855 | #filter PBLIC = GPL
|
---|
| 856 |
|
---|
| 857 | EOF
|
---|
| 858 | close(CONF);
|
---|
| 859 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/novell.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/novell.pbf";
|
---|
| 860 | print CONF << "EOF";
|
---|
| 861 | # Specific group for SuSE for $ENV{'PBPROJ'}
|
---|
| 862 | # Cf: http://en.opensuse.org/SUSE_Package_Conventions/RPM_Groups
|
---|
| 863 | #filter PBGRP = Productivity/Archiving/Backup
|
---|
| 864 |
|
---|
| 865 | # PBLIC is replaced by the license of the application
|
---|
| 866 | # Cf: http://en.opensuse.org/Packaging/SUSE_Package_Conventions/RPM_Style#1.6._License_Tag
|
---|
| 867 | #filter PBLIC = GPL
|
---|
| 868 |
|
---|
| 869 | EOF
|
---|
| 870 | close(CONF);
|
---|
| 871 | foreach my $pp (@pkgs) {
|
---|
[1212] | 872 | pb_mkdir_p("$ENV{'PBROOTDIR'}/$pp/deb");
|
---|
[416] | 873 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/control") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/control";
|
---|
| 874 | print CONF << "EOF";
|
---|
| 875 | Source: PBPKG
|
---|
[916] | 876 | # http://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
|
---|
[416] | 877 | Section: PBGRP
|
---|
| 878 | Priority: optional
|
---|
| 879 | Maintainer: PBPACKAGER
|
---|
| 880 | Build-Depends: debhelper (>= 4.2.20), PBDEP
|
---|
[916] | 881 | Standards-Version: PBDEBSTD
|
---|
| 882 | Vcs-Svn: svn://svn.PBPROJ.org/svn/PBVER/PBPKG
|
---|
| 883 | Vcs-Browser: http://trac.PBPROJ.org/browser/PBVER/PBPKG
|
---|
| 884 | Homepage: PBURL
|
---|
[416] | 885 |
|
---|
| 886 | Package: PBPKG
|
---|
| 887 | Architecture: amd64 i386 ia64
|
---|
[916] | 888 | # http://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
|
---|
[416] | 889 | Section: PBGRP
|
---|
| 890 | Priority: optional
|
---|
| 891 | Depends: \${shlibs:Depends}, \${misc:Depends}, PBDEP
|
---|
| 892 | Recommends: PBREC
|
---|
| 893 | Suggests: PBSUG
|
---|
[916] | 894 | Description: PBSUMMARY
|
---|
[416] | 895 | PBDESC
|
---|
| 896 | .
|
---|
| 897 |
|
---|
| 898 | EOF
|
---|
| 899 | close(CONF);
|
---|
| 900 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/copyright") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/copyright";
|
---|
| 901 | print CONF << "EOF";
|
---|
| 902 | This package is debianized by PBPACKAGER
|
---|
| 903 | `date`
|
---|
| 904 |
|
---|
| 905 | The current upstream source was downloaded from
|
---|
[430] | 906 | PBREPO.
|
---|
[416] | 907 |
|
---|
| 908 | Upstream Authors: Put their name here
|
---|
| 909 |
|
---|
| 910 | Copyright:
|
---|
| 911 |
|
---|
| 912 | This package is free software; you can redistribute it and/or modify
|
---|
| 913 | it under the terms of the GNU General Public License as published by
|
---|
| 914 | the Free Software Foundation; version 2 dated June, 1991.
|
---|
| 915 |
|
---|
| 916 | This package is distributed in the hope that it will be useful,
|
---|
| 917 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 918 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 919 | GNU General Public License for more details.
|
---|
| 920 |
|
---|
| 921 | You should have received a copy of the GNU General Public License
|
---|
| 922 | along with this package; if not, write to the Free Software
|
---|
| 923 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
---|
| 924 | MA 02110-1301, USA.
|
---|
| 925 |
|
---|
| 926 | On Debian systems, the complete text of the GNU General
|
---|
| 927 | Public License can be found in /usr/share/common-licenses/GPL.
|
---|
| 928 |
|
---|
| 929 | EOF
|
---|
| 930 | close(CONF);
|
---|
| 931 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/changelog") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/changelog";
|
---|
| 932 | print CONF << "EOF";
|
---|
| 933 | PBLOG
|
---|
| 934 | EOF
|
---|
| 935 | close(CONF);
|
---|
| 936 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/compat") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/compat";
|
---|
| 937 | print CONF << "EOF";
|
---|
[933] | 938 | PBDEBCOMP
|
---|
[416] | 939 | EOF
|
---|
| 940 | close(CONF);
|
---|
| 941 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/$pp.dirs") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/$pp.dirs";
|
---|
| 942 | print CONF << "EOF";
|
---|
| 943 | EOF
|
---|
| 944 | close(CONF);
|
---|
| 945 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/$pp.docs") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/$pp.docs";
|
---|
| 946 | print CONF << "EOF";
|
---|
| 947 | INSTALL
|
---|
| 948 | COPYING
|
---|
| 949 | AUTHORS
|
---|
| 950 | NEWS
|
---|
| 951 | README
|
---|
| 952 | EOF
|
---|
| 953 | close(CONF);
|
---|
| 954 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/deb/rules") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/deb/rules";
|
---|
| 955 | print CONF << 'EOF';
|
---|
| 956 | #!/usr/bin/make -f
|
---|
| 957 | # -*- makefile -*-
|
---|
| 958 | # Sample debian/rules that uses debhelper.
|
---|
| 959 | # GNU copyright 1997 to 1999 by Joey Hess.
|
---|
| 960 | #
|
---|
| 961 | # $Id$
|
---|
| 962 | #
|
---|
| 963 |
|
---|
| 964 | # Uncomment this to turn on verbose mode.
|
---|
| 965 | #export DH_VERBOSE=1
|
---|
| 966 |
|
---|
| 967 | # Define package name variable for a one-stop change.
|
---|
| 968 | PACKAGE_NAME = PBPKG
|
---|
| 969 |
|
---|
| 970 | # These are used for cross-compiling and for saving the configure script
|
---|
| 971 | # from having to guess our platform (since we know it already)
|
---|
| 972 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
---|
| 973 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
---|
| 974 |
|
---|
| 975 | CFLAGS = -Wall -g
|
---|
| 976 |
|
---|
| 977 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
---|
[933] | 978 | CFLAGS += -O0
|
---|
[416] | 979 | else
|
---|
[933] | 980 | CFLAGS += -O2
|
---|
[416] | 981 | endif
|
---|
| 982 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
---|
[933] | 983 | INSTALL_PROGRAM += -s
|
---|
[416] | 984 | endif
|
---|
| 985 | config.status: configure
|
---|
[933] | 986 | dh_testdir
|
---|
[416] | 987 |
|
---|
[933] | 988 | # Configure the package.
|
---|
| 989 | CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr
|
---|
[416] | 990 | --mandir=\$${prefix}/share/man
|
---|
| 991 |
|
---|
| 992 | # Build both architecture dependent and independent
|
---|
| 993 | build: build-arch build-indep
|
---|
| 994 |
|
---|
| 995 | # Build architecture dependent
|
---|
| 996 | build-arch: build-arch-stamp
|
---|
| 997 |
|
---|
| 998 | build-arch-stamp: config.status
|
---|
[933] | 999 | dh_testdir
|
---|
[416] | 1000 |
|
---|
[933] | 1001 | # Compile the package.
|
---|
| 1002 | $(MAKE)
|
---|
[416] | 1003 |
|
---|
[933] | 1004 | touch build-stamp
|
---|
[416] | 1005 |
|
---|
| 1006 | # Build architecture independent
|
---|
| 1007 | build-indep: build-indep-stamp
|
---|
| 1008 |
|
---|
| 1009 | build-indep-stamp: config.status
|
---|
[933] | 1010 | # Nothing to do, the only indep item is the manual which is available as html in original source
|
---|
| 1011 | touch build-indep-stamp
|
---|
[416] | 1012 |
|
---|
| 1013 | # Clean up
|
---|
| 1014 | clean:
|
---|
[933] | 1015 | dh_testdir
|
---|
| 1016 | dh_testroot
|
---|
| 1017 | rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#
|
---|
| 1018 | # Clean temporary document directory
|
---|
| 1019 | rm -rf debian/doc-temp
|
---|
| 1020 | # Clean up.
|
---|
| 1021 | -$(MAKE) distclean
|
---|
| 1022 | rm -f config.log
|
---|
[416] | 1023 | ifneq "$(wildcard /usr/share/misc/config.sub)" ""
|
---|
[933] | 1024 | cp -f /usr/share/misc/config.sub config.sub
|
---|
[416] | 1025 | endif
|
---|
| 1026 | ifneq "$(wildcard /usr/share/misc/config.guess)" ""
|
---|
[933] | 1027 | cp -f /usr/share/misc/config.guess config.guess
|
---|
[416] | 1028 | endif
|
---|
| 1029 |
|
---|
[933] | 1030 | dh_clean
|
---|
[416] | 1031 |
|
---|
| 1032 | # Install architecture dependent and independent
|
---|
| 1033 | install: install-arch install-indep
|
---|
| 1034 |
|
---|
| 1035 | # Install architecture dependent
|
---|
| 1036 | install-arch: build-arch
|
---|
[933] | 1037 | dh_testdir
|
---|
| 1038 | dh_testroot
|
---|
| 1039 | dh_clean -k -s
|
---|
| 1040 | dh_installdirs -s
|
---|
[416] | 1041 |
|
---|
[933] | 1042 | # Install the package files into build directory:
|
---|
| 1043 | # - start with upstream make install
|
---|
| 1044 | $(MAKE) install prefix=$(CURDIR)/debian/$(PACKAGE_NAME)/usr mandir=$(CURDIR)/debian/$(PACKAGE_NAME)/usr/share/man
|
---|
| 1045 | # - copy html manual to temporary location for renaming
|
---|
| 1046 | mkdir -p debian/doc-temp
|
---|
| 1047 | dh_install -s
|
---|
[416] | 1048 |
|
---|
| 1049 | # Install architecture independent
|
---|
| 1050 | install-indep: build-indep
|
---|
[933] | 1051 | dh_testdir
|
---|
| 1052 | dh_testroot
|
---|
| 1053 | dh_clean -k -i
|
---|
| 1054 | dh_installdirs -i
|
---|
| 1055 | dh_install -i
|
---|
[416] | 1056 |
|
---|
| 1057 | # Must not depend on anything. This is to be called by
|
---|
| 1058 | # binary-arch/binary-indep
|
---|
| 1059 | # in another 'make' thread.
|
---|
| 1060 | binary-common:
|
---|
[933] | 1061 | dh_testdir
|
---|
| 1062 | dh_testroot
|
---|
| 1063 | dh_installchangelogs ChangeLog
|
---|
| 1064 | dh_installdocs
|
---|
| 1065 | dh_installman
|
---|
| 1066 | dh_link
|
---|
| 1067 | dh_strip
|
---|
| 1068 | dh_compress
|
---|
| 1069 | dh_fixperms
|
---|
| 1070 | dh_installdeb
|
---|
| 1071 | dh_shlibdeps
|
---|
| 1072 | dh_gencontrol
|
---|
| 1073 | dh_md5sums
|
---|
| 1074 | dh_builddeb
|
---|
[416] | 1075 |
|
---|
| 1076 | # Build architecture independant packages using the common target.
|
---|
| 1077 | binary-indep: build-indep install-indep
|
---|
[933] | 1078 | $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
|
---|
[416] | 1079 |
|
---|
| 1080 | # Build architecture dependant packages using the common target.
|
---|
| 1081 | binary-arch: build-arch install-arch
|
---|
[933] | 1082 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
|
---|
[416] | 1083 |
|
---|
| 1084 | # Build architecture depdendent and independent packages
|
---|
| 1085 | binary: binary-arch binary-indep
|
---|
| 1086 | .PHONY: clean binary
|
---|
| 1087 |
|
---|
| 1088 | EOF
|
---|
| 1089 | close(CONF);
|
---|
[1212] | 1090 | pb_mkdir_p("$ENV{'PBROOTDIR'}/$pp/rpm");
|
---|
[416] | 1091 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/rpm/$pp.spec") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/rpm/$pp.spec";
|
---|
| 1092 | print CONF << 'EOF';
|
---|
| 1093 | #
|
---|
| 1094 | # $Id$
|
---|
| 1095 | #
|
---|
[1088] | 1096 | # Used if virtual name != real name (perl, ...) - replace hash by percent in the below line
|
---|
| 1097 | #define srcname PBPKG
|
---|
[416] | 1098 |
|
---|
[916] | 1099 | Summary: PBSUMMARY
|
---|
[416] | 1100 | Summary(fr): french bla-bla
|
---|
| 1101 |
|
---|
[540] | 1102 | Name: PBREALPKG
|
---|
[416] | 1103 | Version: PBVER
|
---|
| 1104 | Release: PBTAGPBSUF
|
---|
| 1105 | License: PBLIC
|
---|
| 1106 | Group: PBGRP
|
---|
| 1107 | Url: PBURL
|
---|
[430] | 1108 | Source: PBREPO/PBSRC
|
---|
[500] | 1109 | #PBPATCHSRC
|
---|
[416] | 1110 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
|
---|
| 1111 | #Requires: PBDEP
|
---|
| 1112 |
|
---|
| 1113 | %description
|
---|
| 1114 | PBDESC
|
---|
| 1115 |
|
---|
| 1116 | %description -l fr
|
---|
| 1117 | french desc
|
---|
| 1118 |
|
---|
| 1119 | %prep
|
---|
| 1120 | %setup -q
|
---|
[540] | 1121 | # Used if virtual name != real name (perl, ...)
|
---|
| 1122 | #%setup -q -n %{srcname}-%{version}
|
---|
[500] | 1123 | #PBPATCHCMD
|
---|
[416] | 1124 |
|
---|
| 1125 | %build
|
---|
| 1126 | %configure
|
---|
| 1127 | make %{?_smp_mflags}
|
---|
| 1128 |
|
---|
| 1129 | %install
|
---|
| 1130 | %{__rm} -rf $RPM_BUILD_ROOT
|
---|
| 1131 | make DESTDIR=$RPM_BUILD_ROOT install
|
---|
| 1132 |
|
---|
| 1133 | %clean
|
---|
| 1134 | %{__rm} -rf $RPM_BUILD_ROOT
|
---|
| 1135 |
|
---|
| 1136 | %files
|
---|
| 1137 | %defattr(-,root,root)
|
---|
| 1138 | %doc ChangeLog
|
---|
| 1139 | %doc INSTALL COPYING README AUTHORS NEWS
|
---|
| 1140 |
|
---|
| 1141 | %changelog
|
---|
| 1142 | PBLOG
|
---|
| 1143 |
|
---|
| 1144 | EOF
|
---|
| 1145 | close(CONF);
|
---|
[1136] | 1146 | open(CONF,"> $ENV{'PBROOTDIR'}/pbfilter/pkg.pbf") || die "Unable to create $ENV{'PBROOTDIR'}/pbfilter/pkg.pbf";
|
---|
| 1147 | print CONF << "EOF";
|
---|
| 1148 | #
|
---|
| 1149 | # \$Id\$
|
---|
| 1150 | #
|
---|
| 1151 | # Filter for pkg build
|
---|
| 1152 | #
|
---|
| 1153 | # Solaris package name (VENDOR : 4 letters in uppercase, SOFT : 8 letters in lowercase)
|
---|
| 1154 | filter PBSOLPKG = SUNWsoftware
|
---|
| 1155 |
|
---|
| 1156 | EOF
|
---|
| 1157 | close(CONF);
|
---|
[1212] | 1158 | pb_mkdir_p("$ENV{'PBROOTDIR'}/$pp/pbfilter");
|
---|
| 1159 | pb_mkdir_p("$ENV{'PBROOTDIR'}/$pp/pkg");
|
---|
[890] | 1160 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/pkg/pkginfo") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/pkg/pkginfo";
|
---|
| 1161 | print CONF << 'EOF';
|
---|
| 1162 | #
|
---|
| 1163 | # $Id$
|
---|
| 1164 | #
|
---|
[1136] | 1165 | PKG="PBSOLPKG"
|
---|
| 1166 | NAME="PBREALPKG"
|
---|
[890] | 1167 | VERSION="PBVER"
|
---|
[1136] | 1168 | # all or i386
|
---|
[890] | 1169 | ARCH="all"
|
---|
| 1170 | CATEGORY="application"
|
---|
[1136] | 1171 | DESC="PBSUMMARY"
|
---|
[890] | 1172 | EMAIL="PBPACKAGER"
|
---|
| 1173 | VENDOR="PBPACKAGER"
|
---|
| 1174 | HOTLINE="PBURL"
|
---|
| 1175 | EOF
|
---|
| 1176 | close(CONF);
|
---|
| 1177 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/pkg/pbbuild") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/pkg/pbbuild";
|
---|
| 1178 | print CONF << 'EOF';
|
---|
| 1179 | #
|
---|
| 1180 | # $Id$
|
---|
| 1181 | #
|
---|
| 1182 | #perl Makefile.PL INSTALLDIRS=vendor
|
---|
| 1183 | ./configure --prefix=/usr
|
---|
| 1184 | make
|
---|
| 1185 | make install DESTDIR=\$1
|
---|
| 1186 | EOF
|
---|
| 1187 | close(CONF);
|
---|
| 1188 | open(CONF,"> $ENV{'PBROOTDIR'}/$pp/pkg/depend") || die "Unable to create $ENV{'PBROOTDIR'}/$pp/pkg/depend";
|
---|
| 1189 | print CONF << 'EOF';
|
---|
| 1190 | #
|
---|
| 1191 | # $Id$
|
---|
| 1192 | #
|
---|
| 1193 | #P SUNWperl584core Perl 5.8.4 (core)
|
---|
| 1194 | EOF
|
---|
| 1195 | close(CONF);
|
---|
[416] | 1196 |
|
---|
| 1197 | }
|
---|
[1469] | 1198 | pb_vcs_add($pbconf{$ENV{'PBPROJ'}},$ENV{'PBCONFDIR'});
|
---|
[452] | 1199 | pb_cms_checkin($pbconf{$ENV{'PBPROJ'}},"$ENV{'PBDEFDIR'}/$ENV{'PBPROJ'}",$pbinit);
|
---|
[416] | 1200 | } else {
|
---|
[736] | 1201 | pb_log(0,"ERROR: no pbroot defined, used $ENV{'PBROOTDIR'}, without finding $ENV{'PBPROJ'}.pb in it\n");
|
---|
| 1202 | pb_log(0," Please use -r release in order to be able to initialize your environment correctly\n");
|
---|
[416] | 1203 | die "Unable to open $ENV{'PBROOTDIR'}/$ENV{'PBPROJ'}.pb";
|
---|
| 1204 | }
|
---|
| 1205 | }
|
---|
| 1206 | umask 0022;
|
---|
| 1207 | return(\%filteredfiles, \%supfiles, \%defpkgdir, \%extpkgdir);
|
---|
[1543] | 1208 | } elsif ($action =~ /^(newv|setupv)/) {
|
---|
[1540] | 1209 | # No PBDESTDIR yet so doing nothing
|
---|
| 1210 | return;
|
---|
[416] | 1211 | } else {
|
---|
| 1212 | # Setup the variables from what has been stored at the end of cms2build
|
---|
| 1213 | my ($var) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc","pbroot");
|
---|
| 1214 | $ENV{'PBROOTDIR'} = $var->{$ENV{'PBPROJ'}};
|
---|
| 1215 |
|
---|
| 1216 | ($var) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc","projver");
|
---|
| 1217 | $ENV{'PBPROJVER'} = $var->{$ENV{'PBPROJ'}};
|
---|
| 1218 |
|
---|
| 1219 | ($var) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc","projtag");
|
---|
| 1220 | $ENV{'PBPROJTAG'} = $var->{$ENV{'PBPROJ'}};
|
---|
| 1221 |
|
---|
| 1222 | ($var) = pb_conf_read("$ENV{'PBDESTDIR'}/pbrc","pbpackager");
|
---|
| 1223 | $ENV{'PBPACKAGER'} = $var->{$ENV{'PBPROJ'}};
|
---|
| 1224 |
|
---|
| 1225 | return;
|
---|
| 1226 | }
|
---|
| 1227 | }
|
---|
| 1228 |
|
---|
| 1229 | =head1 WEB SITES
|
---|
| 1230 |
|
---|
| 1231 | The main Web site of the project is available at L<http://www.project-builder.org/>. Bug reports should be filled using the trac instance of the project at L<http://trac.project-builder.org/>.
|
---|
| 1232 |
|
---|
| 1233 | =head1 USER MAILING LIST
|
---|
| 1234 |
|
---|
| 1235 | None exists for the moment.
|
---|
| 1236 |
|
---|
| 1237 | =head1 AUTHORS
|
---|
| 1238 |
|
---|
| 1239 | The Project-Builder.org team L<http://trac.project-builder.org/> lead by Bruno Cornec L<mailto:bruno@project-builder.org>.
|
---|
| 1240 |
|
---|
| 1241 | =head1 COPYRIGHT
|
---|
| 1242 |
|
---|
| 1243 | Project-Builder.org is distributed under the GPL v2.0 license
|
---|
| 1244 | described in the file C<COPYING> included with the distribution.
|
---|
| 1245 |
|
---|
| 1246 | =cut
|
---|
| 1247 |
|
---|
| 1248 | 1;
|
---|