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