/usr/bin/globus-spec-creator is in globus-core 8.16-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 | #!/usr/bin/perl
use Getopt::Long;
use POSIX;
use XML::Parser;
use User::pwent;
use Sys::Hostname;
use Pod::Usage;
my $gptfile;
my $setupfile;
my $release = "1";
my $directory;
my $setupdirectory;
my $toolkitversion = "5.2.5";
my $email;
my $nodoc;
my $help;
GetOptions('gptfile=s' => \$gptfile,
'setupfile=s' => \$setupfile,
'release=s' => \$release,
'directory=s' => \$directory,
'toolkitversion=s' => \$toolkitversion,
'email=s' => \$email,
'nodoc' => \$nodoc,
'help' => \$help);
Pod::Usage::pod2usage() if defined $help;
die "Missing --gptfile option" unless defined $gptfile;
setlocale(LC_TIME, 'C');
my $login = getlogin || getpwuid($<);
my $pw = getpwnam($login);
my ($fullname, $location, $phone) = split(/,/, $pw->gecos);
my $host = hostname;
$email = "$login\@$host" unless defined $email;
@versions = split(/\./, $toolkitversion);
if (@versions[0] < 5) {
$sourcedir = "gt@versions[0]/$toolkitversion";
}
else {
$sourcedir = "gt@versions[0]/@versions[0].@versions[1]/$toolkitversion";
}
if (defined $directory) {
$setupdirectory = $directory;
$setupdirectory =~ s![^/]*$!setup!;
}
my $parser = new XML::Parser(Style => 'Objects', Pkg => 'GPT');
my %srcdeps;
my %setupdeps;
my $gptdoc = $parser->parsefile($gptfile);
my $gptmeta = $gptdoc->[0];
my $gptname = $gptmeta->{Name};
my $gptagingver = (grep {$_->isa('GPT::Aging_Version')} @{$gptmeta->{Kids}})[0];
my $gptmajorver = $gptagingver->{Major};
my $gptminorver = $gptagingver->{Minor};
my $gptdesc = (grep {$_->isa('GPT::Description')} @{$gptmeta->{Kids}})[0];
my $description = $gptdesc->{Kids}->[0]->{Text};
$description =~ s!^\s+|\s+$!!g;
my $gptfuncgroup = (grep {$_->isa('GPT::Functional_Group')} @{$gptmeta->{Kids}})[0];
my $funcgroup = $gptfuncgroup->{Kids}->[0]->{Text};
$funcgroup =~ s!^\s+|\s+$!!g;
my $srcpkg = (grep {$_->isa('GPT::src_pkg')} @{$gptmeta->{Kids}})[0];
for my $srcdep (grep {$_->isa('GPT::Source_Dependencies')} @{$srcpkg->{Kids}})
{
my $type = $srcdep->{Type};
$srcdeps{$type} = {} unless defined $srcdeps{$type};
for my $dep (grep {$_->isa('GPT::Dependency')} @{$srcdep->{Kids}})
{
my $depname = $dep->{Name};
my $deppkg = $dep->{Package} if defined $dep->{Package};
$depname = $depname . "-progs" if ($deppkg eq "pgm");
$depname = $depname . "-doc" if ($deppkg eq "doc");
$depname =~ tr/_/-/;
my $depversion = (grep {$_->isa('GPT::Version')} @{$dep->{Kids}})[0];
my $depverel = (grep {$_->isa('GPT::Simple_Version')}
@{$depversion->{Kids}})[0];
my $depver = $depverel->{Major};
$srcdeps{$type}{$depname} = $depver
unless (defined $srcdeps{$type}{$depname}
and $srcdeps{$type}{$depname} >= $depver);
}
}
for my $setupdep (grep {$_->isa('GPT::Source_Setup_Dependency')}
@{$gptmeta->{Kids}})
{
my $type = $setupdep->{PkgType};
$setupdeps{$type} = {} unless defined $setupdeps{$type};
for my $dep (grep {$_->isa('Setup_Dependency')} @{$setupdep->{Kids}})
{
my $depname = $dep->{Name};
$depname =~ tr/_/-/;
my $depversion = (grep {$_->isa('GPT::Version')} @{$dep->{Kids}})[0];
my $depverel = (grep {$_->isa('GPT::Simple_Version')}
@{$depversion->{Kids}})[0];
my $depver = $depverel->{Major};
$setupdeps{$type}{$depname} = $depver
unless (defined $setupdeps{$type}{$depname}
and $setupdeps{$type}{$depname} >= $depver);
}
}
my $buildenv = (grep {$_->isa('GPT::Build_Environment')} @{$srcpkg->{Kids}})[0];
my $pkglibsel = (grep {$_->isa('GPT::pkg_libs')} @{$buildenv->{Kids}})[0];
$pkglibs = $pkglibsel->{Kids}->[0]->{Text} if defined $pkglibsel;
my $setupname;
my $setupversion;
my $setupdescription;
my $postinstall;
if (defined $setupfile) {
my $setupdoc = $parser->parsefile($setupfile);
my $setupmeta = $setupdoc->[0];
$setupname = $setupmeta->{Name};
die "Setup package name does not match main package name"
if ($setupname ne $gptname . '_setup');
my $setupagingver = (grep {$_->isa('GPT::Aging_Version')}
@{$setupmeta->{Kids}})[0];
my $setupmajorver = $setupagingver->{Major};
my $setupminorver = $setupagingver->{Minor};
my $setupdesc = (grep {$_->isa('GPT::Description')} @{$setupmeta->{Kids}})[0];
$setupdescription = $setupdesc->{Kids}->[0]->{Text};
$setupdescription =~ s!^\s+|\s+$!!g;
my $setupsrcpkg = (grep {$_->isa('GPT::src_pkg')} @{$setupmeta->{Kids}})[0];
for my $srcdep (grep {$_->isa('GPT::Source_Dependencies')} @{$setupsrcpkg->{Kids}})
{
my $type = $srcdep->{Type};
$srcdeps{$type} = {} unless defined $srcdeps{$type};
for my $dep (grep {$_->isa('GPT::Dependency')} @{$srcdep->{Kids}})
{
my $depname = $dep->{Name};
my $deppkg = $dep->{Package}
if defined $dep->{Package};
$depname = $depname . "-progs" if ($deppkg eq "pgm");
$depname =~ tr/_/-/;
my $depversion = (grep {$_->isa('GPT::Version')}
@{$dep->{Kids}})[0];
my $depverel = (grep {$_->isa('GPT::Simple_Version')}
@{$depversion->{Kids}})[0];
my $depver = $depverel->{Major};
$srcdeps{$type}{$depname} = $depver
unless (defined $srcdeps{$type}{$depname}
and $srcdeps{$type}{$depname} >= $depver);
}
}
for my $setupdep (grep {$_->isa('Source_Setup_Dependency')} @{$setupsrcpkg->{Kids}})
{
my $type = $setupdep->{PkgType};
$setupdeps{$type} = {} unless defined $setupdeps{$type};
for my $dep (grep {$_->isa('GPT::Setup_Dependency')} @{$setupdep->{Kids}})
{
my $depname = $dep->{Name};
$depname =~ tr/_/-/;
my $depversion = (grep {$_->isa('GPT::Version')}
@{$dep->{Kids}})[0];
my $depverel = (grep {$_->isa('GPT::Simple_Version')}
@{$depversion->{Kids}})[0];
my $depver = $depverel->{Major};
$setupdeps{$type}{$depname} = $depver
unless (defined $setupdeps{$type}{$depname}
and $setupdeps{$type}{$depname} >= $depver);
}
}
my $setuppostinstall = (grep {$_->isa('GPT::Post_Install_Program')} @{$setupsrcpkg->{Kids}})[0];
$postinstall = $setuppostinstall->{Kids}->[0]->{Text}
if defined $setuppostinstall->{Kids}->[0];
$postinstall =~ s!^\s+|\s+$!!g;
$setupversion = $setupmajorver . '.' . $setupminorver;
}
my $name = $gptname;
$name =~ tr/_/-/;
my $version = $gptmajorver . '.' . $gptminorver;
my $libs = 1;
if (!defined $srcdeps{'lib_link'} and !defined $srcdeps{'rtl_runtime'}) {
$libs = 0;
}
my $develpkg = 1;
my $docpkg = 1;
my $progspkg = 0;
if (!$libs) {
$develpkg = 0;
$docpkg = 0;
}
else {
$docpkg = 0 if defined $nodoc;
$progspkg = 1 if (defined $srcdeps{'pgm_link'} or
defined $srcdeps{'pgm_runtime'});
}
print "%ifarch aarch64 alpha ia64 ppc64 s390x sparc64 x86_64\n";
print "%global flavor gcc64\n";
print "%else\n";
print "%global flavor gcc32\n";
print "%endif\n\n";
print "%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}\n\n";
print "Name:\t\t$name\n";
print "%global _name %(tr - _ <<< %{name})\n";
print "Version:\t$version\n";
print "%global setupversion $setupversion\n" if defined $setupfile;
print "Release:\t$release%{?dist}\n";
print "Summary:\tGlobus Toolkit - $description\n";
print "\n";
if ($libs) {
print "Group:\t\tSystem Environment/Libraries\n";
}
else {
print "Group:\t\tApplications/Internet\n";
}
print "License:\tASL 2.0\n";
print "URL:\t\thttp://www.globus.org/\n";
print "Source:\t\thttp://www.globus.org/ftppub/$sourcedir/packages/src/%{_name}-%{version}.tar.gz\n";
if (defined $setupfile) {
print "Source1:\thttp://www.globus.org/ftppub/$sourcedir/packages/src/%{_name}_setup-%{setupversion}.tar.gz\n";
}
print "#\t\tREADME file\n";
print "Source8:\t";
print "GLOBUS-CCOMMONLIB" if ($funcgroup eq 'Common');
print "GLOBUS-CCOMMONLIB" if ($funcgroup eq 'Core');
print "GLOBUS-GRAM5" if ($funcgroup eq 'GRAM');
print "GLOBUS-GRAM5" if ($funcgroup eq 'Pre-WS GRAM');
print "GLOBUS-GRAM5" if ($funcgroup eq 'ResourceManagement');
print "GLOBUS-GRAM5" if ($funcgroup eq 'WS GRAM');
print "GLOBUS-GRIDFTP" if ($funcgroup eq 'FileAccess');
print "GLOBUS-GRIDFTP" if ($funcgroup eq 'GridFTP');
print "GLOBUS-GSIC" if ($funcgroup eq 'Security');
print "GLOBUS-RLS" if ($funcgroup eq 'Data');
print "GLOBUS-XIO" if ($funcgroup eq 'Communication');
print "\n";
my $p = 0;
while ($ARGV[$p]) {
print "#\t\t### INSERT PATCH DESCRIPTION HERE ###:\n";
print "#\t\thttp://bugzilla.globus.org/bugzilla/show_bug.cgi?id=###BUG NUMBER###\n";
print "Patch$p:" . ($p < 10 ? "\t\t" : "\t") . "$ARGV[$p]\n";
$p++;
}
print "BuildRoot:\t%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)\n";
print "\n";
if (!$libs) {
my $hasrequires = 0;
if (defined $setupfile) {
print "Provides:\t%{name}-setup = %{setupversion}\n";
print "Requires:\tglobus-common >= 11.5\n";
$hasrequires = 1;
}
while (($key, $value) = each(%{$srcdeps{'pgm_link'}})) {
# Explicit Requires for libraries should not be used according to the
# packaging guidelines. The autogenerated Requires on sonames make them
# redundant. Only add Requires for XIO plugins.
if ($key =~ /^globus-xio-/) {
print "Requires:\t$key%{?_isa}" .
($value > 0 ? " >= $value\n" : "\n");
$hasrequires = 1;
}
}
# Need at least one Requires to own directories
print "Requires:\tglobus-common\n" unless $hasrequires;
while (($key, $value) = each(%{$srcdeps{'pgm_runtime'}})) {
print "Requires:\t$key" . ($value > 0 ? " >= $value\n" : "\n");
}
while (($key, $value) = each(%{$setupdeps{'pgm'}})) {
print "Requires:\t$key" . ($value > 0 ? " >= $value\n" : "\n")
unless $key eq 'trusted-ca-setup';
}
print "BuildRequires:\tgrid-packaging-tools >= 3.4\n";
print "BuildRequires:\tglobus-core >= 8\n";
while (($key, $value) = each(%{$srcdeps{'compile'}})) {
if ($key ne "globus-core") {
print "BuildRequires:\t$key-devel" .
($value > 0 ? " >= $value\n" : "\n");
}
}
}
else {
my $hasrequires = 0;
while (($key, $value) = each(%{$srcdeps{'lib_link'}})) {
# Explicit Requires for libraries should not be used according to the
# packaging guidelines. The autogenerated Requires on sonames make them
# redundant. Only add Requires for XIO plugins.
if ($key =~ /^globus-xio-/) {
print "Requires:\t$key%{?_isa}" .
($value > 0 ? " >= $value\n" : "\n");
$hasrequires = 1;
}
}
# Need at least one Requires to own directories
print "Requires:\tglobus-common\n" unless $hasrequires;
while (($key, $value) = each(%{$srcdeps{'rtl_runtime'}})) {
print "Requires:\t$key%{?_isa}" . ($value > 0 ? " >= $value\n" : "\n");
}
while (($key, $value) = each(%{$setupdeps{'rtl'}})) {
print "Requires:\t$key" . ($value > 0 ? " >= $value\n" : "\n")
unless $key eq 'trusted-ca-setup';
}
print "BuildRequires:\tgrid-packaging-tools >= 3.4\n";
print "BuildRequires:\tglobus-core >= 8\n";
while (($key, $value) = each(%{$srcdeps{'compile'}})) {
if ($key ne "globus-core") {
print "BuildRequires:\t$key-devel" .
($value > 0 ? " >= $value\n" : "\n");
}
}
while (($key, $value) = each(%{$srcdeps{'doc_runtime'}})) {
print "BuildRequires:\t$key" . ($value > 0 ? " >= $value\n" : "\n");
}
if ($docpkg) {
print "BuildRequires:\tdoxygen\n";
print "BuildRequires:\tgraphviz\n";
print "%if \"%{?rhel}\" == \"5\"\n";
print "BuildRequires:\tgraphviz-gd\n";
print "%endif\n";
print "BuildRequires:\tghostscript\n";
print "BuildRequires:\ttex(latex)\n";
print "%if %{?fedora}%{!?fedora:0} >= 18 || %{?rhel}%{!?rhel:0} >= 7\n";
print "BuildRequires:\ttex(fullpage.sty)\n";
print "BuildRequires:\ttex(multirow.sty)\n";
print "BuildRequires:\ttex(sectsty.sty)\n";
print "BuildRequires:\ttex(tocloft.sty)\n";
print "BuildRequires:\ttex(xtab.sty)\n";
print "BuildRequires:\ttex-ec\n";
print "BuildRequires:\ttex-courier\n";
print "BuildRequires:\ttex-helvetic\n";
print "BuildRequires:\ttex-times\n";
print "BuildRequires:\ttex-symbol\n";
print "BuildRequires:\ttex-rsfs\n";
print "%endif\n";
}
if ($progspkg) {
print "\n";
print "%package progs\n";
print "Summary:\tGlobus Toolkit - $description Programs\n";
print "Group:\t\tApplications/Internet\n";
print "Provides:\t%{name}-setup = %{setupversion}\n"
if defined $setupfile;
print "Requires:\t%{name}%{?_isa} = %{version}-%{release}\n";
print "Requires:\tglobus-common >= 11.5\n" if defined $setupfile;
while (($key, $value) = each(%{$srcdeps{'pgm_link'}})) {
# Explicit Requires for libraries should not be used according
# to the packaging guidelines. The autogenerated Requires on
# sonames make them redundant.
# Only add Requires for XIO plugins.
print "Requires:\t$key%{?_isa}" .
($value > 0 ? " >= $value\n" : "\n")
if $key =~ /^globus-xio-/;
}
while (($key, $value) = each(%{$srcdeps{'pgm_runtime'}})) {
print "Requires:\t$key" . ($value > 0 ? " >= $value\n" : "\n")
unless $key eq $name;
}
while (($key, $value) = each(%{$setupdeps{'pgm'}})) {
print "Requires:\t$key" . ($value > 0 ? " >= $value\n" : "\n")
unless $key eq 'trusted-ca-setup' or $key eq $name;
}
}
}
if ($develpkg) {
print "\n";
print "%package devel\n";
print "Summary:\tGlobus Toolkit - $description Development Files\n";
print "Group:\t\tDevelopment/Libraries\n";
print "Requires:\t%{name}%{?_isa} = %{version}-%{release}\n";
while (($key, $value) = each(%{$srcdeps{'compile'}})) {
if ($key eq "globus-core") {
print "Requires:\t$key%{?_isa}" .
($value > 0 ? " >= $value\n" : "\n");
}
else {
print "Requires:\t$key-devel%{?_isa}" .
($value > 0 ? " >= $value\n" : "\n");
}
}
}
if ($docpkg) {
print "\n";
print "%package doc\n";
print "Summary:\tGlobus Toolkit - $description Documentation Files\n";
print "Group:\t\tDocumentation\n";
print "%if %{?fedora}%{!?fedora:0} >= 10 || %{?rhel}%{!?rhel:0} >= 6\n";
print "BuildArch:\tnoarch\n";
print "%endif\n";
print "Requires:\t%{name} = %{version}-%{release}\n";
}
print "
%description
The Globus Toolkit is an open source software toolkit used for building Grid
systems and applications. It is being developed by the Globus Alliance and
many others all over the world. A growing number of projects and companies are
using the Globus Toolkit to unlock the potential of grids for their cause.
The %{name} package contains:
$description
";
print "
%description progs
The Globus Toolkit is an open source software toolkit used for building Grid
systems and applications. It is being developed by the Globus Alliance and
many others all over the world. A growing number of projects and companies are
using the Globus Toolkit to unlock the potential of grids for their cause.
The %{name}-progs package contains:
$description Programs
" if ($progspkg);
print "$setupdescription\n" if defined $setupfile;
print "
%description devel
The Globus Toolkit is an open source software toolkit used for building Grid
systems and applications. It is being developed by the Globus Alliance and
many others all over the world. A growing number of projects and companies are
using the Globus Toolkit to unlock the potential of grids for their cause.
The %{name}-devel package contains:
$description Development Files
" if ($develpkg);
print "
%description doc
The Globus Toolkit is an open source software toolkit used for building Grid
systems and applications. It is being developed by the Globus Alliance and
many others all over the world. A growing number of projects and companies are
using the Globus Toolkit to unlock the potential of grids for their cause.
The %{name}-doc package contains:
$description Documentation Files
" if ($docpkg);
print "
%prep
%setup -q -n %{_name}-%{version}
";
print "%setup -D -T -q -n %{_name}-%{version} -a 1\n" if defined $setupfile;
$p = 0;
while ($ARGV[$p]) {
print "%patch$p -p1\n";
$p++;
}
print "
%build
# Remove files that should be replaced during bootstrap
rm -f doxygen/Doxyfile*
rm -f doxygen/Makefile.am
rm -f pkgdata/Makefile.am
rm -f globus_automake*
rm -rf autom4te.cache
unset GLOBUS_LOCATION
unset GPT_LOCATION
%{_datadir}/globus/globus-bootstrap.sh
";
if ($docpkg) {
print "
%configure --disable-static --with-flavor=%{flavor} \\
--enable-doxygen --with-docdir=%{_pkgdocdir}
";
}
else {
print "
%configure --disable-static --with-flavor=%{flavor} \\
--with-docdir=%{_pkgdocdir}
";
}
print "
# Reduce overlinking
sed 's!CC -shared !CC \\\${wl}--as-needed -shared !g' -i libtool
make %{?_smp_mflags}
";
print "
# setup package
cd %{_name}_setup-%{setupversion}
# Remove files that should be replaced during bootstrap
rm -f doxygen/Doxyfile*
rm -f doxygen/Makefile.am
rm -f pkgdata/Makefile.am
rm -f globus_automake*
rm -rf autom4te.cache
%{_datadir}/globus/globus-bootstrap.sh
%configure --without-flavor --with-docdir=%{_pkgdocdir}
make %{?_smp_mflags}
cd -
" if defined $setupfile;
print "
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
";
print "
# setup package
cd %{_name}_setup-%{setupversion}
make install DESTDIR=%{buildroot}
cd -
# Register setup
perl -MGrid::GPT::Setup <<EOF
my \\\$metadata = new Grid::GPT::Setup(package_name => \"%{_name}_setup\",
globusdir => \"%{buildroot}%{_prefix}\");
\\\$metadata->finish();
EOF
# Create setup files
### INSERT RELEVANT PARTS OF $postinstall HERE ###
" if defined $setupfile;
print "
GLOBUSPACKAGEDIR=%{buildroot}%{_datadir}/globus/packages
";
if (not defined $pkglibs) {
print "
# This library is opened using lt_dlopenext, so the libtool archive
# (.la file) can not be removed - fix the libdir and clear dependency_libs
# ... and move it to the main package
for lib in `find %{buildroot}%{_libdir} -name 'lib*.la'` ; do
sed -e \"s!^libdir=.*!libdir=\\'%{_libdir}\\'!\" \\
-e \"s!^dependency_libs=.*!dependency_libs=\\'\\'!\" -i \$lib
done
grep 'lib.*\\.la\$' \$GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist \\
>> \$GLOBUSPACKAGEDIR/%{_name}/%{flavor}_rtl.filelist
sed '/lib.*\\.la\$/d' -i \$GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist
" if ($libs);
}
else {
print "
# Remove libtool archives (.la files)
find %{buildroot}%{_libdir} -name 'lib*.la' -exec rm -v '{}' \\;
sed '/lib.*\\.la\$/d' -i \$GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist
" if ($libs);
}
print "
# Move license file to main package
grep GLOBUS_LICENSE \$GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist \\
>> \$GLOBUSPACKAGEDIR/%{_name}/%{flavor}_rtl.filelist
sed /GLOBUS_LICENSE/d -i \$GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist
" if ($docpkg);
print "
# Install README file
install -m 644 -p %{SOURCE8} %{buildroot}%{_pkgdocdir}/README
# Generate package filelists
";
if (!$libs) {
print "cat \$GLOBUSPACKAGEDIR/%{_name}/%{flavor}_pgm.filelist \\\n";
print " \$GLOBUSPACKAGEDIR/%{_name}_setup/noflavor_pgm.filelist \\\n"
if defined $setupfile;
print " | sed s!^!%{_prefix}! > package.filelist\n";
}
else {
print "cat \$GLOBUSPACKAGEDIR/%{_name}/%{flavor}_rtl.filelist \\\n";
print " | sed s!^!%{_prefix}! > package.filelist\n";
}
if (!$docpkg) {
print "cat \$GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist \\\n";
print " | sed -e 's!/man/.*!&\*!' -e 's!^!%doc %{_prefix}!' >> package.filelist\n";
}
if ($progspkg) {
print "cat \$GLOBUSPACKAGEDIR/%{_name}/%{flavor}_pgm.filelist \\\n";
print " \$GLOBUSPACKAGEDIR/%{_name}_setup/noflavor_pgm.filelist \\\n"
if defined $setupfile;
print " | sed s!^!%{_prefix}! > package-progs.filelist\n";
}
if ($develpkg) {
print "cat \$GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist \\\n";
print " | sed s!^!%{_prefix}! > package-devel.filelist\n";
}
if ($docpkg) {
print "cat \$GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist \\\n";
print " | sed -e 's!/man/.*!&\*!' -e 's!^!%doc %{_prefix}!' > package-doc.filelist\n";
}
print "
%clean
rm -rf %{buildroot}
";
print "
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
" if ($libs);
print "
%files -f package.filelist
%dir %{_datadir}/globus/packages/%{_name}
%dir %{_pkgdocdir}
%doc %{_pkgdocdir}/README
";
print "
%files -f package-progs.filelist progs
" if ($progspkg);
print "%dir %{_datadir}/globus/packages/%{_name}_setup
%{_datadir}/globus/packages/setup/%{_name}_setup
" if defined $setupfile;
print "
%files -f package-devel.filelist devel
" if ($develpkg);
print "
%files -f package-doc.filelist doc
%dir %{_pkgdocdir}/html
" if ($docpkg);
print "
%changelog
* " . strftime('%a %b %d %Y', localtime) . " $fullname <$email> - $version-$release
- Autogenerated
"
__END__
=head1 NAME
B<globus-spec-creator> - Generate an RPM spec file from a GPT source
package description
=head1 SYNOPSIS
B<globus-spec-creator> [options] [patches ...]
Options:
=over
=item B<-gptfile> filename
The package's GPT source package description file (mandatory)
=item B<-setupfile> filename
The corresponding setup package's GPT source package description file
(default: none)
=item B<-release> releasenumber
The RPM release number (default: 1)
=item B<-directory> directory
The package's source directory in the toolkit installer
=item B<-toolkitversion> versionnumber
Globus toolkit version (default: 5.2.5)
=item B<-email> emailaddress
The packagers e-mail address (default: username@hostname)
=item B<-nodoc>
Disable the generation of the doc RPM
=item B<-help>
Show help
=back
Arguments:
Each additional argument will be added as a patch in the generated
specfile.
=head1 EXAMPLE
globus-spec-creator -g globus_common-10.2/pkgdata/pkg_data_src.gpt.in
-s globus_common_setup-2.6/pkgdata/pkg_data_src.gpt.in -r 3 -d
common/source
=head1 SEE ALSO
See http://fedoraproject.org/wiki/PackagingDrafts/Globus for
additional information and examples.
=head1 AUTHOR
Mattias Ellert E<lt>mattias.ellert@fysast.uu.seE<gt>
=cut
|