Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 409626f8bdb0fa1bf65d5fd7f1882394 > files > 2

cableswig-0.1.0-2mdk.src.rpm

%define name	cableswig
%define version	0.1.0
%define release	2mdk

Summary:	CableSwig is used to create interfaces to interpreted languages
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	BSDish
Group:		Development/C++
URL:		http://www.itk.org
Source0:	http://belnet.dl.sourceforge.net/sourceforge/itk/CableSwig-ITK-2.0.0.tar.bz2
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires:	swig gccxml
Provides:	cable

%description
CableSwig is used to create interfaces (i.e. "wrappers") to interpreted
languages such as Tcl and Python. It was created to produce wrappers for ITK
because the toolkit uses C++ structures that SWIG cannot parse (deeply nested
template instantiations). CableSwig is a combination tool that uses  GCC_XML as
the c++ parser. The input files are  Cable style input files. The XML produced
from the Cable/GCC_XML input files are then parsed and feed into a modified
version of  SWIG. SWIG is a software development tool that connects programs
written in C and C++ with a variety of high-level programming languages. It is
used to generate the language bindings to the target language. Currently, Tcl
and Python are supported.

%package -n gccxml
Summary:	The XML output extension to GCC
Version:	0.7
Group:		Development/C++
Epoch:		1

%description -n gccxml
Development tools that work with programming languages benefit from their
ability to understand the code with which they work at a level comparable to a
compiler. C++ has become a popular and powerful language, but parsing it is a
very challenging problem. This has discouraged the development of tools meant to
work directly with the language. 

There is one open-source C++ parser, the C++ front-end to GCC, which is
currently able to deal with the language in its entirety. The purpose of the
GCC-XML extension is to generate an XML description of a C++ program from GCC's
internal representation. Since XML is easy to parse, other development tools
will be able to work with C++ programs without the burden of a complicated C++
parser. 

GCC-XML was developed by Brad King at Kitware to be used by CABLE, which was
developed as part of the NLM Insight Segmentation and Registration Toolkit
project.

%prep

%setup -q -n CableSwig-ITK-2-0

%build
cmake -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
      -DCMAKE_CXX_FLAGS:STRING="$RPM_OPT_FLAGS" \
      -DCMAKE_SKIP_RPATH:BOOL=ON \
.

%make

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

# remove SWIG part
# rm -rf $RPM_BUILD_ROOT/%{_libdir}/CableSwig/SWIGLib
# ln -s %{_libdir}/swig1.3 $RPM_BUILD_ROOT/%{_libdir}/CableSwig/SWIGLib

# mv gccxml to std path
mv $RPM_BUILD_ROOT/%{_libdir}/CableSwig/share $RPM_BUILD_ROOT/%{_prefix}
mv $RPM_BUILD_ROOT/%{_libdir}/CableSwig/bin/* $RPM_BUILD_ROOT/%{_bindir}
rmdir $RPM_BUILD_ROOT/%{_libdir}/CableSwig/bin

# set correct path
cat > $RPM_BUILD_ROOT/%{_libdir}/CableSwig/CableSwigConfig.cmake <<EOF
SET(CableSwig_VERSION_MAJOR "0")
SET(CableSwig_VERSION_MINOR "1")
SET(CableSwig_VERSION_PATCH "0")

SET(CableSwig_cableidx_EXE "%{_bindir}/cableidx")
SET(CableSwig_cswig_EXE "%{_bindir}/cswig")
SET(CableSwig_gccxml_EXE "%{_bindir}/gccxml")
SET(CableSwig_DEFAULT_LIB "%{_libdir}/swig1.3")
EOF


%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%{_libdir}/CableSwig
%{_bindir}/cableidx
%{_bindir}/cswig

%files -n gccxml
%defattr(-,root,root)
%{_datadir}/gccxml*
%{_datadir}/doc/*
%{_mandir}/man*/*
%{_bindir}/gccxml
%{_bindir}/gccxml_cc1plus



%changelog
* Sat Feb 12 2005 Gaetan Lehmann <gaetan.lehmann@jouy.inra.fr> 0.1.0-2mdk
- fix SWIG Lib directory

* Wed Feb 09 2005 Gaetan Lehmann <gaetan.lehmann@jouy.inra.fr> 0.1.0-1mdk
- stable release from itk

* Sun Jan 30 2005 Gaetan Lehmann <gaetan.lehmann@jouy.inra.fr> 0.1.0-0.cvs20050130.1mdk
- initial contrib