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