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