source: ProjectBuilder/devel/pb/lib/ProjectBuilder/Env.pm@ 1256

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