Packaging:Globus

This document describes the guidelines and conventions for packaging components from the Globus Toolkit in Fedora. The following guidelines applies to the components of the Globus Toolkit written in C. A future version of the guidelines may address the packaging of components written in java as well.

What is the Globus Toolkit?
The Globus Toolkit is a set of libraries and tools used as building blocks for grid computing applications. The toolkit is developed and maintained by the Globus Alliance.

Obtaining sources
The sources for the Globus Toolkit are distributed as one big installer tarball that contain the sources for more than 300 packages. Since including this huge tarball in every Globus source RPM and use less than 1% of it to compile a single Globus package would be extremely wasteful in terms of diskspace and bandwidth, the relevant subdirectory from the installer tarball must be extracted and repackaged for each package. The GLOBUS_LICENSE file must also be copied into the extracted source tree since it is part of the upstream installer. This must be documented using comments in the spec file according to the Packaging:SourceURL guidelines so that the source tarball can be reproduced, as in the following example:

Source: 	%{_name}-%{version}.tar.gz
 * 1) 		Source is extracted from the globus toolkit installer:
 * 2) 		wget -N http://www-unix.globus.org/ftppub/gt4/4.2.1/installers/src/gt4.2.1-all-source-installer.tar.bz2
 * 3) 		tar -jxf gt4.2.1-all-source-installer.tar.bz2
 * 4) 		mv gt4.2.1-all-source-installer/source-trees/common/source globus_common-10.2
 * 5) 		cp -p gt4.2.1-all-source-installer/source-trees/core/source/GLOBUS_LICENSE globus_common-10.2
 * 6) 		tar -zcf globus_common-10.2.tar.gz globus_common-10.2

Off-release upstream updates
Occasionally the Globus Alliance publishes an off-release update of a package. For these updates each updated package is available as a separate tarball, and the repackaging discribed above should not be done:

Source: 	http://www-unix.globus.org/ftppub/gt4/4.2.1/updates/src/%{_name}-%{version}.tar.gz

In order to keep the packaging consistent, the naming of the tarfiles extracted from the installer should use the same naming convention as upstream uses for the tarfiles for these updates, i.e. the upstream package name and version.

Grid packaging tools
The Globus Toolkit uses its own build system called the grid packaging tools (GPT). This is available in Fedora in the grid-packaging-tools package.

globus-core
The globus-core package is a development package that provides common build instructions for all globus packages. The globus-core package is not required at runtime and must not be listed as a Requires other than for -devel packages.

Creating the specfile for a Globus package
All metadata about a Globus package needed to create the specfile is available in the package's GPT source package description file, usually obtainable as pkgdata/pkg_data_src.gpt.in in the package's sources. This is an XML file that contains the package's


 * Name
 * Version
 * Description
 * Build dependencies
 * Link dependencies
 * Runtime dependencies

The underscores in the upstream package name are changed to dashes in order to comply with the Packaging/NamingGuidelines guidelines.

GPT packages vs. RPM packages
GPT has its own packaging mechanism, and automatically distributes the installed files generated from the GPT source package into several GPT binary packages. By taking advantage of this feature the split of the installed files into several binary RPMs can be automatised.

For a globus package that provides libraries the mapping between GPT and RPM packages is as follows:


 * %{flavor}_rtl.gpt → main package
 * %{flavor}_dev.gpt → -devel package
 * noflavor_doc.gpt → -doc package

And if the package provides programs as well as libraries:


 * %{flavor}_pgm.gpt → -progs package

For a globus package that provides only programs the mapping is as follows:


 * %{flavor}_pgm.gpt → main package

GPT metadata files
The grid-packaging-tools install GPT metadata about the binary packages they create. Each GPT binary package has two metadata files in /usr/share/globus/ script, which is installed as part of the globus-core package. Using this script is optional, but provides increased maintainability of the package and reduces the risk of cut and paste errors. The following examples shows the autogenerated specfiles generated by the script in a few cases.

Globus package that provides a library

 * The  option specifies the GPT source package description file
 * The  option specifies the directory in the installer from where the code was extracted
 * The  option can be used to specify the packager's e-mail address (defaults to username@host)

%ifarch alpha ia64 ppc64 s390x sparc64 x86_64 %global flavor gcc64pthr %else %global flavor gcc32pthr %endif

Name:		globus-gsi-openssl-error %global _name %(tr - _ <<< %{name}) Version:	0.14 Release:	1%{?dist} Summary:	Globus Toolkit - Globus OpenSSL Error Handling

Group:		System Environment/Libraries License:	ASL 2.0 URL:		http://www.globus.org/ Source: 	%{_name}-%{version}.tar.gz Source9:	epstopdf-2.9.5gw BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 * 1) 		Source is extracted from the globus toolkit installer:
 * 2) 		wget -N http://www-unix.globus.org/ftppub/gt4/4.2.1/installers/src/gt4.2.1-all-source-installer.tar.bz2
 * 3) 		tar -jxf gt4.2.1-all-source-installer.tar.bz2
 * 4) 		mv gt4.2.1-all-source-installer/source-trees/gsi/openssl_error/source globus_gsi_openssl_error-0.14
 * 5) 		cp -p gt4.2.1-all-source-installer/source-trees/core/source/GLOBUS_LICENSE globus_gsi_openssl_error-0.14
 * 6) 		tar -zcf globus_gsi_openssl_error-0.14.tar.gz globus_gsi_openssl_error-0.14
 * 1) 		This is a workaround for the broken epstopdf script in RHEL5
 * 2) 		See: https://bugzilla.redhat.com/show_bug.cgi?id=450388

Requires:	globus-openssl >= 1 BuildRequires:	grid-packaging-tools BuildRequires:	globus-common-devel >= 3 BuildRequires:	globus-openssl-devel >= 1 BuildRequires:	globus-core >= 4 BuildRequires:	doxygen BuildRequires:	graphviz BuildRequires:	ghostscript %if "%{?rhel}" == "5" BuildRequires:	graphviz-gd %endif %if %{?fedora}%{!?fedora:0} >= 9 BuildRequires:	tex(latex) %else %if %{?rhel}%{!?rhel:0} >= 6 BuildRequires:	tex(latex) %else BuildRequires:	tetex-latex %endif %endif

%package devel Summary:	Globus Toolkit - Globus OpenSSL Error Handling Development Files Group:		Development/Libraries Requires:	%{name} = %{version}-%{release} Requires:	globus-common-devel >= 3 Requires:	globus-openssl-devel >= 1 Requires:	globus-core >= 4

%package doc Summary:	Globus Toolkit - Globus OpenSSL Error Handling Documentation Files Group:		Documentation Requires:	%{name} = %{version}-%{release}

%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: Globus OpenSSL Error Handling

%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: Globus OpenSSL Error Handling Development Files

%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: Globus OpenSSL Error Handling Documentation Files

%prep %setup -q -n %{_name}-%{version}

%if "%{rhel}" == "5" mkdir bin install %{SOURCE9} bin/epstopdf %endif

%build %if "%{rhel}" == "5" export PATH=$PWD/bin:$PATH %endif

rm -f doxygen/Doxyfile* rm -f doxygen/Makefile.am rm -f pkgdata/Makefile.am rm -f globus_automake* rm -rf autom4te.cache
 * 1) Remove files that should be replaced during bootstrap

for f in `find. -name Makefile.am` ; do sed -e 's!^flavorinclude_HEADERS!include_HEADERS!' \ -e 's!\(lib[a-zA-Z_]*\)_$(GLOBUS_FLAVOR_NAME)\.la!\1.la!g' \ -e 's!^\(lib[a-zA-Z_]*\)___GLOBUS_FLAVOR_NAME__la_!\1_la_!' -i $f done sed -e "s!<With_Flavors!<With_Flavors ColocateLibraries=\"no\"!" \ -i pkgdata/pkg_data_src.gpt.in
 * 1) Remove flavor tags

%{_datadir}/globus/globus-bootstrap.sh

%configure --with-flavor=%{flavor} --enable-doxygen

make %{?_smp_mflags}

%install %if "%{rhel}" == "5" export PATH=$PWD/bin:$PATH %endif

rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT

GLOBUSPACKAGEDIR=$RPM_BUILD_ROOT%{_datadir}/globus/packages

find $RPM_BUILD_ROOT%{_libdir} -name 'lib*.la' -exec rm -v '{}' \; sed '/lib.*\.la$/d' -i $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_rtl.filelist
 * 1) Remove libtool archives (.la files)

find $RPM_BUILD_ROOT%{_libdir} -name 'lib*.a' -exec rm -v '{}' \; sed '/lib.*\.a$/d' -i $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist
 * 1) Remove static libraries (.a files)

mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig %{_datadir}/globus/globus-gpt2pkg-config pkgdata/pkg_data_%{flavor}_dev.gpt > \ $RPM_BUILD_ROOT%{_libdir}/pkgconfig/%{name}.pc
 * 1) Generate pkg-config file from GPT metadata

mv $RPM_BUILD_ROOT%{_docdir}/%{_name} \ $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} sed s!doc/%{_name}!doc/%{name}-%{version}! \ -i $GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist
 * 1) Move documentation to default RPM location

rm -f $RPM_BUILD_ROOT%{_mandir}/man3/*_%{_name}-%{version}_*.3 sed -e '/_%{_name}-%{version}_.*\.3/d' \ -i $GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist
 * 1) Remove unwanted documentation (needed for RHEL4)

mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} install -m 644 -p GLOBUS_LICENSE $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
 * 1) Install license file

cat $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_rtl.filelist \ | sed s!^!%{_prefix}! > package.filelist cat $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist \ | sed s!^!%{_prefix}! > package-devel.filelist cat $GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist \ | sed -e 's!/man/.*!&*!' -e 's!^!%doc %{_prefix}!' > package-doc.filelist
 * 1) Generate package filelists

%clean rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f package.filelist %dir %{_datadir}/globus/packages/%{_name} %dir %{_docdir}/%{name}-%{version} %doc %{_docdir}/%{name}-%{version}/GLOBUS_LICENSE

%files -f package-devel.filelist devel %{_libdir}/pkgconfig/%{name}.pc

%files -f package-doc.filelist doc %dir %{_docdir}/%{name}-%{version}/html

%changelog - Autogenerated
 * Tue May 5 2009 Mattias Ellert  - 0.14-1

Globus package that only provides programs
%ifarch alpha ia64 ppc64 s390x sparc64 x86_64 %global flavor gcc64pthr %else %global flavor gcc32pthr %endif

Name:		globus-proxy-utils %global _name %(tr - _ <<< %{name}) Version:	2.5 Release:	1%{?dist} Summary:	Globus Toolkit - Globus GSI Proxy Utility Programs

Group:		Applications/Internet License:	ASL 2.0 URL:		http://www.globus.org/ Source: 	%{_name}-%{version}.tar.gz BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 * 1) 		Source is extracted from the globus toolkit installer:
 * 2) 		wget -N http://www-unix.globus.org/ftppub/gt4/4.2.1/installers/src/gt4.2.1-all-source-installer.tar.bz2
 * 3) 		tar -jxf gt4.2.1-all-source-installer.tar.bz2
 * 4) 		mv gt4.2.1-all-source-installer/source-trees/gsi/proxy/proxy_utils/source globus_proxy_utils-2.5
 * 5) 		cp -p gt4.2.1-all-source-installer/source-trees/core/source/GLOBUS_LICENSE globus_proxy_utils-2.5
 * 6) 		tar -zcf globus_proxy_utils-2.5.tar.gz globus_proxy_utils-2.5

Requires:	globus-openssl >= 1 BuildRequires:	grid-packaging-tools BuildRequires:	globus-gsi-proxy-ssl-devel >= 1 BuildRequires:	globus-gsi-credential-devel >= 1 BuildRequires:	globus-gsi-callback-devel BuildRequires:	globus-openssl-module-devel BuildRequires:	globus-gss-assist-devel >= 3 BuildRequires:	globus-gsi-openssl-error-devel BuildRequires:	globus-openssl-devel >= 1 BuildRequires:	globus-gsi-proxy-core-devel >= 1 BuildRequires:	globus-core >= 4 BuildRequires:	globus-gsi-cert-utils-devel >= 1 BuildRequires:	globus-common-devel >= 3 BuildRequires:	globus-gsi-sysconfig-devel >= 1

%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: Globus GSI Proxy Utility Programs

%prep %setup -q -n %{_name}-%{version}

%build rm -f doxygen/Doxyfile* rm -f doxygen/Makefile.am rm -f pkgdata/Makefile.am rm -f globus_automake* rm -rf autom4te.cache
 * 1) Remove files that should be replaced during bootstrap

%{_datadir}/globus/globus-bootstrap.sh

%configure --with-flavor=%{flavor}

make %{?_smp_mflags}

%install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT

GLOBUSPACKAGEDIR=$RPM_BUILD_ROOT%{_datadir}/globus/packages

mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} install -m 644 -p GLOBUS_LICENSE $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
 * 1) Install license file

cat $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_pgm.filelist \ | sed s!^!%{_prefix}! > package.filelist
 * 1) Generate package filelists

%clean rm -rf $RPM_BUILD_ROOT

%files -f package.filelist %dir %{_datadir}/globus/packages/%{_name} %dir %{_docdir}/%{name}-%{version} %doc %{_docdir}/%{name}-%{version}/GLOBUS_LICENSE

%changelog - Autogenerated
 * Tue May 5 2009 Mattias Ellert  - 2.5-1

Globus package containing a plugin

 * The  option is used to set the release version of the specfile to 2 (default is 1, as in the previous examples)
 * The  option can be used to disable the generation of a doc package for Globus packages that don't have any doxygen markup in the sources.

In this case the autogenerated specfile will instead of the commands for deleting the .la files contain a comment explaining why the .la files can not be removed.

This example also illustrates that the names of patches can be listed as arguments to the script. For each patch listed on the command line the autogenerated specfile will contain a stub comment saying "INSERT PATCH DESCRIPTION HERE" and an incomplete reference to the upstream bugzilla where the bug number should be entered.

%ifarch alpha ia64 ppc64 s390x sparc64 x86_64 %global flavor gcc64pthr %else %global flavor gcc32pthr %endif

Name:		globus-xio-popen-driver %global _name %(tr - _ <<< %{name}) Version:	0.2 Release:	2%{?dist} Summary:	Globus Toolkit - Globus XIO Pipe Open Driver

Group:		System Environment/Libraries License:	ASL 2.0 URL:		http://www.globus.org/ Source: 	%{_name}-%{version}.tar.gz Patch0: 	%{name}-wrong-dep.patch Patch1: 	%{name}-wrong-desc.patch BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 * 1) 		Source is extracted from the globus toolkit installer:
 * 2) 		wget -N http://www-unix.globus.org/ftppub/gt4/4.2.1/installers/src/gt4.2.1-all-source-installer.tar.bz2
 * 3) 		tar -jxf gt4.2.1-all-source-installer.tar.bz2
 * 4) 		mv gt4.2.1-all-source-installer/source-trees/xio/drivers/popen/source globus_xio_popen_driver-0.2
 * 5) 		cp -p gt4.2.1-all-source-installer/source-trees/core/source/GLOBUS_LICENSE globus_xio_popen_driver-0.2
 * 6) 		tar -zcf globus_xio_popen_driver-0.2.tar.gz globus_xio_popen_driver-0.2
 * 1) 		### INSERT PATCH DESCRIPTION HERE ###:
 * 2) 		http://bugzilla.globus.org/bugzilla/show_bug.cgi?id=###BUG NUMBER###
 * 1) 		### INSERT PATCH DESCRIPTION HERE ###:
 * 2) 		http://bugzilla.globus.org/bugzilla/show_bug.cgi?id=###BUG NUMBER###

Requires:	globus-common BuildRequires:	grid-packaging-tools BuildRequires:	globus-xio-devel

%package devel Summary:	Globus Toolkit - Globus XIO Pipe Open Driver Development Files Group:		Development/Libraries Requires:	%{name} = %{version}-%{release} Requires:	globus-xio-devel

%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: Globus XIO Pipe Open Driver

%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: Globus XIO Pipe Open Driver Development Files

%prep %setup -q -n %{_name}-%{version} %patch0 -p1 %patch1 -p1

%build rm -f doxygen/Doxyfile* rm -f doxygen/Makefile.am rm -f pkgdata/Makefile.am rm -f globus_automake* rm -rf autom4te.cache
 * 1) Remove files that should be replaced during bootstrap

for f in `find. -name Makefile.am` ; do sed -e 's!^flavorinclude_HEADERS!include_HEADERS!' \ -e 's!\(lib[a-zA-Z_]*\)_$(GLOBUS_FLAVOR_NAME)\.la!\1.la!g' \ -e 's!^\(lib[a-zA-Z_]*\)___GLOBUS_FLAVOR_NAME__la_!\1_la_!' -i $f done sed -e "s!<With_Flavors!<With_Flavors ColocateLibraries=\"no\"!" \ -i pkgdata/pkg_data_src.gpt.in
 * 1) Remove flavor tags

%{_datadir}/globus/globus-bootstrap.sh

%configure --with-flavor=%{flavor}

make %{?_smp_mflags}

%install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT

GLOBUSPACKAGEDIR=$RPM_BUILD_ROOT%{_datadir}/globus/packages

for lib in `find $RPM_BUILD_ROOT%{_libdir} -name 'lib*.la'` ; do sed "s!^libdir=.*!libdir=\'%{_libdir}\'!" -i $lib done
 * 1) This library is opened using lt_dlopenext, so the libtool archives
 * 2) (.la files) can not be removed - fix the libdir...

find $RPM_BUILD_ROOT%{_libdir} -name 'lib*.a' -exec rm -v '{}' \; sed '/lib.*\.a$/d' -i $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist
 * 1) Remove static libraries (.a files)

mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig %{_datadir}/globus/globus-gpt2pkg-config pkgdata/pkg_data_%{flavor}_dev.gpt > \ $RPM_BUILD_ROOT%{_libdir}/pkgconfig/%{name}.pc
 * 1) Generate pkg-config file from GPT metadata

mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} install -m 644 -p GLOBUS_LICENSE $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
 * 1) Install license file

cat $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_rtl.filelist \ | sed s!^!%{_prefix}! > package.filelist cat $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist \ | sed s!^!%{_prefix}! > package-devel.filelist
 * 1) Generate package filelists

%clean rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f package.filelist %dir %{_datadir}/globus/packages/%{_name} %dir %{_docdir}/%{name}-%{version} %doc %{_docdir}/%{name}-%{version}/GLOBUS_LICENSE

%files -f package-devel.filelist devel %{_libdir}/pkgconfig/%{name}.pc

%changelog - Autogenerated
 * Tue May 5 2009 Mattias Ellert  - 0.2-2

Globus package that provides both a library and programs and that has a corresponding setup package

 * The  option is used to indicate the GPT source package description file for the setup package

The patches have been excluded from this example to keep it short. For this package some additional editing is needed. Compare the autogenerated file below with the specfile in the actual package to see the differences.

%ifarch alpha ia64 ppc64 s390x sparc64 x86_64 %global flavor gcc64pthr %else %global flavor gcc32pthr %endif

Name:		globus-common %global _name %(tr - _ <<< %{name}) Version:	10.2 %global setupversion 2.6 Release:	3%{?dist} Summary:	Globus Toolkit - Common Library

Group:		System Environment/Libraries License:	ASL 2.0 URL:		http://www.globus.org/ Source: 	%{_name}-%{version}.tar.gz Source1:	%{_name}_setup-%{setupversion}.tar.gz Source9:	epstopdf-2.9.5gw BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 * 1) 		Source is extracted from the globus toolkit installer:
 * 2) 		wget -N http://www-unix.globus.org/ftppub/gt4/4.2.1/installers/src/gt4.2.1-all-source-installer.tar.bz2
 * 3) 		tar -jxf gt4.2.1-all-source-installer.tar.bz2
 * 4) 		mv gt4.2.1-all-source-installer/source-trees/common/source globus_common-10.2
 * 5) 		cp -p gt4.2.1-all-source-installer/source-trees/core/source/GLOBUS_LICENSE globus_common-10.2
 * 6) 		tar -zcf globus_common-10.2.tar.gz globus_common-10.2
 * 1) 		Source1 is extracted from the globus toolkit installer:
 * 2) 		wget -N http://www-unix.globus.org/ftppub/gt4/4.2.1/installers/src/gt4.2.1-all-source-installer.tar.bz2
 * 3) 		tar -jxf gt4.2.1-all-source-installer.tar.bz2
 * 4) 		mv gt4.2.1-all-source-installer/source-trees/common/setup globus_common_setup-2.6
 * 5) 		cp -p gt4.2.1-all-source-installer/source-trees/core/source/GLOBUS_LICENSE globus_common_setup-2.6
 * 6) 		tar -zcf globus_common_setup-2.6.tar.gz globus_common_setup-2.6
 * 1) 		This is a workaround for the broken epstopdf script in RHEL5
 * 2) 		See: https://bugzilla.redhat.com/show_bug.cgi?id=450388

Requires:	globus-libtool >= 1 BuildRequires:	grid-packaging-tools BuildRequires:	globus-libtool-devel >= 1 BuildRequires:	globus-core >= 4 BuildRequires:	doxygen BuildRequires:	graphviz BuildRequires:	ghostscript %if "%{?rhel}" == "5" BuildRequires:	graphviz-gd %endif %if %{?fedora}%{!?fedora:0} >= 9 BuildRequires:	tex(latex) %else %if %{?rhel}%{!?rhel:0} >= 6 BuildRequires:	tex(latex) %else BuildRequires:	tetex-latex %endif %endif

%package progs Summary:	Globus Toolkit - Common Library Programs Group:		Applications/Internet Provides:	%{name}-setup = %{setupversion} Requires:	%{name} = %{version}-%{release} Requires:	globus-libtool >= 1 Requires:	globus-common-progs >= 3 Requires:	globus-common-setup >= 2

%package devel Summary:	Globus Toolkit - Common Library Development Files Group:		Development/Libraries Requires:	%{name} = %{version}-%{release} Requires:	globus-libtool-devel >= 1 Requires:	globus-core >= 4

%package doc Summary:	Globus Toolkit - Common Library Documentation Files Group:		Documentation Requires:	%{name} = %{version}-%{release}

%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: Common Library

%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: Common Library Programs Common Setup

%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: Common Library Development Files

%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: Common Library Documentation Files

%prep %setup -q -n %{_name}-%{version} %setup -D -T -q -n %{_name}-%{version} -a 1

%if "%{rhel}" == "5" mkdir bin install %{SOURCE9} bin/epstopdf %endif

%build %if "%{rhel}" == "5" export PATH=$PWD/bin:$PATH %endif

rm -f doxygen/Doxyfile* rm -f doxygen/Makefile.am rm -f pkgdata/Makefile.am rm -f globus_automake* rm -rf autom4te.cache
 * 1) Remove files that should be replaced during bootstrap

for f in `find. -name Makefile.am` ; do sed -e 's!^flavorinclude_HEADERS!include_HEADERS!' \ -e 's!\(lib[a-zA-Z_]*\)_$(GLOBUS_FLAVOR_NAME)\.la!\1.la!g' \ -e 's!^\(lib[a-zA-Z_]*\)___GLOBUS_FLAVOR_NAME__la_!\1_la_!' -i $f done sed -e "s!<With_Flavors!<With_Flavors ColocateLibraries=\"no\"!" \ -i pkgdata/pkg_data_src.gpt.in
 * 1) Remove flavor tags

%{_datadir}/globus/globus-bootstrap.sh

%configure --with-flavor=%{flavor} --enable-doxygen

make %{?_smp_mflags}

cd %{_name}_setup-%{setupversion}
 * 1) setup package

rm -f doxygen/Doxyfile* rm -f doxygen/Makefile.am rm -f pkgdata/Makefile.am rm -f globus_automake* rm -rf autom4te.cache
 * 1) Remove files that should be replaced during bootstrap

%{_datadir}/globus/globus-bootstrap.sh

%configure --without-flavor

make %{?_smp_mflags}

cd -

%install %if "%{rhel}" == "5" export PATH=$PWD/bin:$PATH %endif

rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT

cd %{_name}_setup-%{setupversion} make install DESTDIR=$RPM_BUILD_ROOT cd -
 * 1) setup package

perl -MGrid::GPT::Setup < "%{_name}_setup",				    globusdir => "$RPM_BUILD_ROOT%{_prefix}"); \$metadata->finish; EOF
 * 1) Register setup


 * 1) Create setup files


 * 1) INSERT RELEVANT PARTS OF setup-globus-common HERE ###

GLOBUSPACKAGEDIR=$RPM_BUILD_ROOT%{_datadir}/globus/packages

find $RPM_BUILD_ROOT%{_libdir} -name 'lib*.la' -exec rm -v '{}' \; sed '/lib.*\.la$/d' -i $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_rtl.filelist
 * 1) Remove libtool archives (.la files)

find $RPM_BUILD_ROOT%{_libdir} -name 'lib*.a' -exec rm -v '{}' \; sed '/lib.*\.a$/d' -i $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist
 * 1) Remove static libraries (.a files)

mkdir -p $RPM_BUILD_ROOT%{_libdir}/pkgconfig %{_datadir}/globus/globus-gpt2pkg-config pkgdata/pkg_data_%{flavor}_dev.gpt > \ $RPM_BUILD_ROOT%{_libdir}/pkgconfig/%{name}.pc
 * 1) Generate pkg-config file from GPT metadata

mv $RPM_BUILD_ROOT%{_docdir}/%{_name} \ $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} sed s!doc/%{_name}!doc/%{name}-%{version}! \ -i $GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist
 * 1) Move documentation to default RPM location

rm -f $RPM_BUILD_ROOT%{_mandir}/man3/*_%{_name}-%{version}_*.3 sed -e '/_%{_name}-%{version}_.*\.3/d' \ -i $GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist
 * 1) Remove unwanted documentation (needed for RHEL4)

mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} install -m 644 -p GLOBUS_LICENSE $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}
 * 1) Install license file

cat $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_rtl.filelist \ | sed s!^!%{_prefix}! > package.filelist cat $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_pgm.filelist \ $GLOBUSPACKAGEDIR/%{_name}_setup/noflavor_pgm.filelist \ | sed s!^!%{_prefix}! > package-progs.filelist cat $GLOBUSPACKAGEDIR/%{_name}/%{flavor}_dev.filelist \ | sed s!^!%{_prefix}! > package-devel.filelist cat $GLOBUSPACKAGEDIR/%{_name}/noflavor_doc.filelist \ | sed -e 's!/man/.*!&*!' -e 's!^!%doc %{_prefix}!' > package-doc.filelist
 * 1) Generate package filelists

%clean rm -rf $RPM_BUILD_ROOT

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f package.filelist %dir %{_datadir}/globus/packages/%{_name} %dir %{_docdir}/%{name}-%{version} %doc %{_docdir}/%{name}-%{version}/GLOBUS_LICENSE

%files -f package-progs.filelist progs %dir %{_datadir}/globus/packages/%{_name}_setup %{_datadir}/globus/packages/setup %dir %{_datadir}/globus/setup

%files -f package-devel.filelist devel %{_libdir}/pkgconfig/%{name}.pc

%files -f package-doc.filelist doc %dir %{_docdir}/%{name}-%{version}/html

%changelog - Autogenerated
 * Tue May 5 2009 Mattias Ellert  - 10.2-3