Hi,

I'm desperately trying to rebuild oscar packages in order to try newer versions 
of openmpi (and avoid the fact that in CentOS5.4, shipped openmpi is installed 
instead of oscar one due to versions)

Unfortunately, it looks like opkgc is broken at generating the rpm spec file.
There are 2 problems:
- 1st one is in the template (/usr/share/opkgc/tmpl/rpm/opkg.spec.tmpl). it 
doesn't work for centos that list version as 5.4 instead of 5 update 4. thus, 
the test command which requires integer fails.
Attached is the fixed template.

- 2nd problem: in the spec file, the computed dependencies are badly generated: 
useless "," at end of lines and %endif missing.
from config.xml:
   <requires>
      <filters>
        <dist version="5" >rhel</dist>
      </filters>
      <pkg>gcc-gfortran</pkg>
    </requires>
    <requires>
      <filters>
        <dist version="4" >rhel</dist>
      </filters>
      <pkg>gcc4-gfortran</pkg>
    </requires>

Will generate:
%if %{is_rh}
%define is_version %(test %{vtag} -eq 5 && echo 1 || echo 0)
%if %{is_version}
Requires: gcc-gfortran,
%if %{is_rh}
%define is_version %(test %{vtag} -eq 4 && echo 1 || echo 0)
%if %{is_version}
Requires: gcc4-gfortran
%endif
%endif

Notice the extra "," at end of Requires: gcc-gfortran,
Just after: there are 2 missing %endif
The file /usr/lib/python2.4/site-packages/Opkgc/Rpm.py is responsible of 
generating this code and it looks like the loop length is greater than one 
item; thus the ",", thus the missing "%endif"...

To reproduce the problem (from svn)
cd oscar/packages
opkgc -vv --dist=rhel --input=openmpi

I've attached the used config.xml (also fixed for the provides tag which is 
erroneous in the svn)
I've also attached the generated spec file (which has missing %endif)

Is somebody hears me, pleaser give advice as I'm lost here.

Best regards.

-- 
        Olivier LAHAYE
        CEAEA Saclay
        DRT-LIST-DCSI-DIR
# -*- Mode: rpm-spec -*-
#
Summary:        $summary
Name:           opkg-$name
Version:        $version('upstream')
Release:        $version('release')
License:        $license
Group:          $group:$opkg_class
Distribution:   OSCAR
Vendor:         Open Cluster Group <http://oscar.openclustergroup.org/>
Packager:       $authors('maintainer')
BuildRoot:      %{_builddir}/%{name}
BuildArch:      noarch
$exclusiveArch#slurp
AutoReqProv: no
$depends('apiDeps', 'requires')$depends('apiDeps', 
'conflicts')$depends('apiDeps', 'provides')#slurp
Source0:        opkg-${name}-${version('upstream')}.tar.gz
%define is_fc   %(test -e /etc/fedora-release && echo 1 || echo 0)
%define is_rh   %(test -e /etc/redhat-release && echo 1 || echo 0)
%define is_mdk  %(test -e /etc/mandrake-release && echo 1 || echo 0)
%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)

%if %{is_fc}
%define vtag %(sed -e 's/^.*release //' -e 's/ .*$//' -e 's/\\./_/g' < 
/etc/fedora-release)
%endif

%if %{is_rh}
%define vtag %(sed -e 's/^.*release //' -e 's/ .*$//' -e 's/\\..*$//g' < 
/etc/redhat-release)
%endif


%description
$description

%package server
Group:          $group:$opkg_class
Summary:        $summary, server part
AutoReqProv: no
Requires: opkg-$name = $version('upstream')-$version('release')
$depends('serverDeps', 'requires')$depends('serverDeps', 
'conflicts')$depends('serverDeps', 'provides')#slurp
%description server
$description 
This is the server part of $name.

%package client
Group:          $group:$opkg_class
Summary:        $summary, client part
AutoReqProv: no
$depends('clientDeps', 'requires')$depends('clientDeps', 
'conflicts')$depends('clientDeps', 'provides')#slurp
%description client
$description 
This is the client part of $name.

%prep
%setup -q

%build

%install
rm -fr \$RPM_BUILD_ROOT
#for $f in $filelist
mkdir -p \$RPM_BUILD_ROOT/$f.dest
cp -r $f.orig \$RPM_BUILD_ROOT/$f.dest/
#end for

%clean
rm -fr \$RPM_BUILD_ROOT

%files server
%defattr(-,root,root)
#for $f in $filelist('server')
/$f.dest/$f.basename
#end for

%files client
%defattr(-,root,root)
#for $f in $filelist('client')
/$f.dest/$f.basename
#end for

%files
%defattr(-,root,root)
#for $f in $filelist('api')
/$f.dest/$f.basename
#end for

%changelog
#for $versionEntry in $changelog
#for $log in $versionEntry.centries
* $formatCEntry($log)
#for $item in $log.items
  - $item
#end for
#for $bug in $log.closes
  - Closes: Bug \#$bug
#end for
#end for
#end for

#disabled#_dollar_scripts_
# -*- Mode: rpm-spec -*-
Summary:        Open MPI for OSCAR Clusters
Name:           opkg-openmpi-oscar
Version:        1.4.1
Release:        1
License: 	BSD
Group:          Development/Libraries:included
Distribution:   OSCAR
Vendor:         Open Cluster Group <http://oscar.openclustergroup.org/>
Packager:       DongInn Kim <di...@osl.iu.edu>
BuildRoot:      %{_builddir}/%{name}
BuildArch:	noarch
AutoReqProv: no
Requires: oscar-base

Source0:        opkg-openmpi-oscar-1.4.1.tar.gz
%define is_fc   %(test -e /etc/fedora-release && echo 1 || echo 0)
%define is_rh   %(test -e /etc/redhat-release && echo 1 || echo 0)
%define is_mdk  %(test -e /etc/mandrake-release && echo 1 || echo 0)
%define is_suse %(test -e /etc/SuSE-release && echo 1 || echo 0)

%if %{is_fc}
%define vtag %(sed -e 's/^.*release //' -e 's/ .*$//' -e 's/\\./_/g' < /etc/fedora-release)
%endif

%if %{is_rh}
%define vtag %(sed -e 's/^.*release //' -e 's/ .*$//' -e 's/\\..*$//g' < /etc/redhat-release)
%endif


%description
 Open MPI is a project combining technologies and resources from several other
projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in order to build the best MPI
library available. A completely new MPI-2 compliant implementation, Open MPI
offers advantages for system and software vendors, application developers and
computer science researchers. 


%package server
Group:          Development/Libraries:included
Summary:        Open MPI for OSCAR Clusters, server part
AutoReqProv: no
Requires: opkg-openmpi-oscar = 1.4.1-1
Requires: openmpi, openmpi-switcher-modulefile, oscar-base-server, 
%if %{is_rh}
%define is_version %(test %{vtag} -eq 5 && echo 1 || echo 0)
%if %{is_version}
Requires: gcc-gfortran, 
%if %{is_rh}
%define is_version %(test %{vtag} -eq 4 && echo 1 || echo 0)
%if %{is_version}
Requires: gcc4-gfortran
%endif
%endif


Provides: mpi

%description server
 Open MPI is a project combining technologies and resources from several other
projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in order to build the best MPI
library available. A completely new MPI-2 compliant implementation, Open MPI
offers advantages for system and software vendors, application developers and
computer science researchers. 
 
This is the server part of openmpi-oscar.

%package client
Group:          Development/Libraries:included
Summary:        Open MPI for OSCAR Clusters, client part
AutoReqProv: no
Requires: openmpi, openmpi-switcher-modulefile, oscar-base-client, 
%if %{is_rh}
%define is_version %(test %{vtag} -eq 4 && echo 1 || echo 0)
%if %{is_version}
Requires: gcc4-gfortran, 
%if %{is_rh}
%define is_version %(test %{vtag} -eq 5 && echo 1 || echo 0)
%if %{is_version}
Requires: gcc-gfortran
%endif
%endif


Provides: mpi

%description client
 Open MPI is a project combining technologies and resources from several other
projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in order to build the best MPI
library available. A completely new MPI-2 compliant implementation, Open MPI
offers advantages for system and software vendors, application developers and
computer science researchers. 
 
This is the client part of openmpi-oscar.

%prep
%setup -q

%build

%install
rm -fr $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar
cp -r testing/rm_script.openmpi $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar/
mkdir -p $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar
cp -r testing/cpi.c $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar/
mkdir -p $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar
cp -r testing/f77hello.f $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar/
mkdir -p $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar
cp -r testing/cxxhello.cc $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar/
mkdir -p $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar
cp -r testing/test_user $RPM_BUILD_ROOT/var/lib/oscar/testing/openmpi-oscar/
mkdir -p $RPM_BUILD_ROOT/var/lib/oscar/packages/openmpi-oscar
cp -r config.xml $RPM_BUILD_ROOT/var/lib/oscar/packages/openmpi-oscar/

%clean
rm -fr $RPM_BUILD_ROOT

%files server
%defattr(-,root,root)

%files client
%defattr(-,root,root)

%files
%defattr(-,root,root)
/var/lib/oscar/testing/openmpi-oscar/rm_script.openmpi
/var/lib/oscar/testing/openmpi-oscar/cpi.c
/var/lib/oscar/testing/openmpi-oscar/f77hello.f
/var/lib/oscar/testing/openmpi-oscar/cxxhello.cc
/var/lib/oscar/testing/openmpi-oscar/test_user
/var/lib/oscar/packages/openmpi-oscar/config.xml

%changelog
* Thu Feb 25 2010 Olivier Lahaye
  - Fixed the missing dependencies on RHEL5.
  - New upstream release.
* Sat Dec 22 2007 DongInn Kim
  - Fixed the missing dependencies on RHEL4.
* Sat Oct 6 2007 Erich Focht
  - Fixed completely wrong dependencies.
* Tue Aug 21 2007 Bernard Li
  - Convert to the new OPKG API (for OPKGC)

#disabled#_dollar_scripts_

Attachment: config.xml
Description: XML document

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to