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