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