Changeset 1549 in ProjectBuilder for devel/pb/bin
- Timestamp:
- May 21, 2012, 2:17:30 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r1548 r1549 492 492 =head2 build2pkg 493 493 494 The build2pkg command takes the tar files created in the cms2build step and attempts to build the binary packages for your current operating system. In order for this step to work, you may need to edit the files in one of the $pbdefdir/$project/pbconf/$version/$project/{deb,rpm,pkg} directories. Those files will be used to try to build your package. Note that if you change those files, you need to re-run the cms2build step. Then you can run a command like: 494 The build2pkg command takes the tar files created in the cms2build step and attempts to build binary packages for your current operating system. There are two steps: 495 496 =over 4 497 498 =item Update your filters and build files. 499 500 You probably need to edit the files describing the build steps in one of the $pbdefdir/$project/pbconf/$version/$project/{deb,rpm,pkg} directories and the filters in $pbdefdir/$project/pbconf/$version/pbfilter. Note that you can define additional filters and transforms in the *.pbf files. The build files will be filtered by the filters defined in the *.pbf files to generate the inputs to the build step. Therefore, if you change those files, you need to re-run the cms2build step. 501 502 =item Build the package. 503 504 Then you can run a command like: 495 505 496 506 % pb -p $project -r $version build2pkg 497 507 498 508 To create the files in $project/build that comprise your binary package(s). 509 510 =back 499 511 500 512 =head2 newve … … 513 525 vetype default = chroot 514 526 527 If you are building for rpm style OS's, update the verpmtype option, and install the appropriate tool. 528 529 verpmtype default = rpmbootstrap 530 515 531 You may also choose to specify a mirror for the OS packages, and optionally http/ftp proxies. You can specify the proxies either through environment variables ($http_proxy/$ftp_proxy) or in the configuration file. The configuration file will be used if no corresponding environment variable has been set. For example, for debian and with a local squid proxy: 516 532 … … 555 571 The build2ve command is similar to the build2pkg command in that it will take the sources created by cms2build and turn them into binary packages. The command has two differences. First, it creates the packages in a virtual environment, i.e. the one made by an earlier setupve setup. Second it copies the resulting packages to a repository and builds the repository meta-data needed. 556 572 557 T wosub-steps are needed:573 Three sub-steps are needed: 558 574 559 575 =over 4 … … 565 581 sshhost $project = localhost 566 582 sshdir $project = $home/cache-project-builder/repos 583 584 You may also need to specify additional repository files to use or rpms to install. Note the URL for repositories is not the URL of the repository, but the URL of a file that can be put in the yum.repos.d or apt.sources.d directory. 585 586 addrepo centos-5-i386 = http://localhost/pb/centos-extras.repo,http://mirror.centos.org/centos/5/extras/i386/RPMS/chrpath-0.13-3.el5.centos.i386.rpm 587 588 =item Update your filters and build files 589 590 You may need to update your filter files (*.pbf) as in the build2pkg step if you are building for a new OS or architecture. 567 591 568 592 =item Build the packages and copy them to the repository … … 2165 2189 # ssh communication if not VE or CPAN 2166 2190 # should use a hash instead... 2167 my ($shcmd,$ cpcmd,$cptarget,$cp2target);2191 my ($shcmd,$shcmdroot,$cpcmd,$cptarget,$cp2target); 2168 2192 if ($cmt =~ /^VE/) { 2169 2193 my $tp = pb_path_expand($vepath->{$ENV{'PBPROJ'}}); … … 2173 2197 my $arch = pb_get_arch(); 2174 2198 if ($vetype eq "chroot") { 2175 $shcmd = "sudo /usr/sbin/chroot $tpdir /bin/su - $mac -c "; 2199 $shcmdroot = "sudo /usr/sbin/chroot $tpdir "; 2200 $shcmd = "$shcmdroot /bin/su - $mac -c "; 2176 2201 } elsif ($vetype eq "schroot") { 2177 2202 $shcmd = "schroot $tp -u $mac -- "; 2178 2203 } 2179 $s shcmd = "setarch i386 $sshcmd" if (($pbos->{'arch'} =~ /i?86/) && ($arch eq 'x86_64'));2204 $shcmd = "setarch i386 $shcmd" if (($pbos->{'arch'} =~ /i?86/) && ($arch eq 'x86_64')); 2180 2205 $cpcmd = "sudo /bin/cp -r "; 2181 2206 # We need to get the home dir of the target account to deliver in the right place … … 2233 2258 # For VE we need to change the owner manually 2234 2259 if ($cmt =~ /^VE/) { 2235 pb_system("$shcmd \"sudo chown -R $mac $tdir\"","Adapt owner in $tdir to $mac"); 2260 if (defined $shcmdroot) { 2261 # This should help overcome a CentOS 5.8 bug as well as having a simper sequence 2262 pb_system("$shcmdroot \"chown -R $mac $tdir\"","Adapt owner in $tdir to $mac"); 2263 } else { 2264 pb_system("$shcmd \"sudo chown -R $mac $tdir\"","Adapt owner in $tdir to $mac"); 2265 } 2236 2266 } 2237 2267 … … 2421 2451 my $pbos = pb_distro_get_context($v); 2422 2452 2453 my $ftp_proxy = pb_distro_get_param($pbos,pb_conf_get_if("ftp_proxy")); 2454 my $http_proxy = pb_distro_get_param($pbos,pb_conf_get_if("http_proxy")); 2455 2456 $ENV{ftp_proxy} ||= $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne "")); 2457 $ENV{http_proxy} ||= $http_proxy if ((defined $http_proxy) && ($http_proxy ne "")); 2458 2423 2459 # Launch the VMs/VEs 2424 2460 if ($vtype eq "vm") { … … 2995 3031 2996 3032 # For VE we first need to mount some FS 2997 pb_system("mount -t proc /proc /proc") ;3033 pb_system("mount -t proc /proc /proc") unless (-d "/proc/$$"); 2998 3034 2999 3035 EOF … … 3153 3189 EOF 3154 3190 print SCRIPT << 'EOF'; 3155 s/Defaults [ \t]+requiretty//;3191 s/Defaults\s+requiretty/# disable Defaults: requiretty/; 3156 3192 print PBOUT $_; 3157 3193 } … … 3205 3241 } 3206 3242 # We may need a proxy configuration. Get it from the local env 3207 3208 # TODO: make this apply to the bootstrapping also. 3209 my ($ftp_proxy_map, $http_proxy_map) = pb_conf_get_if('ftp_proxy', 'http_proxy'); 3210 my $ftp_proxy = pb_distro_get_param($pbos, $ftp_proxy_map); 3211 my $http_proxy = pb_distro_get_param($pbos, $http_proxy_map); 3212 3213 $ENV{'ftp_proxy'} = $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne '') && (not defined $ENV{'ftp_proxy'})); 3214 $ENV{'http_proxy'} = $http_proxy if ((defined $http_proxy) && ($http_proxy ne '') && (not defined $ENV{'http_proxy'})); 3243 my $ftp_proxy = pb_distro_get_param($pbos,pb_conf_get_if("ftp_proxy")); 3244 my $http_proxy = pb_distro_get_param($pbos,pb_conf_get_if("http_proxy")); 3245 3246 $ENV{'ftp_proxy'} ||= $ftp_proxy if ((defined $ftp_proxy) && ($ftp_proxy ne "")); 3247 $ENV{'http_proxy'} ||= $http_proxy if ((defined $http_proxy) && ($http_proxy ne "")); 3215 3248 3216 3249 if (defined $ENV{'http_proxy'}) { … … 3267 3300 $cmdget = "mv /tmp/ProjectBuilder-$pbver1$pbextdir.tar.gz ProjectBuilder-latest.tar.gz ; mv /tmp/project-builder-$pbver2$pbextdir.tar.gz project-builder-latest.tar.gz"; 3268 3301 } else { 3302 # TODO: shouldn't we have a variable to specify the source file? 3303 # And shouldn't we be getting the one that matches the current pb version? 3304 # For the moment, just take the latest stable one 3269 3305 $cmdget = "wget --passive-ftp ftp://ftp.project-builder.org/src/ProjectBuilder-latest.tar.gz; wget --passive-ftp ftp://ftp.project-builder.org/src/project-builder-latest.tar.gz"; 3270 3306 }
Note:
See TracChangeset
for help on using the changeset viewer.