# You can make the package from CVS by something like:
# tar -cvzf swig-1.3.11cvs.tar.gz SWIG-1.3.11cvs && rpm -tb swig-1.3.11cvs.tar.gz
# @configure_input@

%define ver          @PACKAGE_VERSION@
%define rel          1
%define prefix       /usr
%define home_page    http://swig.sourceforge.net/
%define docprefix    %{prefix}/share

######################################################################
# Usually, nothing needs to be changed below here between releases
######################################################################
Summary: Simplified Wrapper and Interface Generator
Name: swig
Version: %{ver}
Release: %{rel}
URL: %{home_page}
Source0: %{name}-%{version}.tar.gz
License: BSD
Group: Development/Tools
BuildRoot: %{_tmppath}/%{name}-root

%description
SWIG is a software development tool that connects programs written in C and C++
with a variety of high-level programming languages. SWIG is primarily used with
common scripting languages such as Perl, Python, Tcl/Tk, and Ruby, however the
list of supported languages also includes non-scripting languages such as Java,
OCAML and C#. Also several interpreted and compiled Scheme implementations
(Guile, MzScheme, Chicken) are supported. SWIG is most commonly used to create
high-level interpreted or compiled programming environments, user interfaces,
and as a tool for testing and prototyping C/C++ software. SWIG can also export
its parse tree in the form of XML and Lisp s-expressions. 

%package runtime
Summary: Runtime libraries required for dynamically loading swig-generated modules
Group: Development/Libraries

%description runtime
The swig-runtime package contains shared libraries used to share type 
information between swig-generated modules loaded into the same application.
Dynamically loading swig-generated modules should use the swig-runtime libs.

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

%build
# so we can build package from cvs source too
[ ! -r configure ] && ./autogen.sh
%configure
make
make runtime

%install
rm -rf ${RPM_BUILD_ROOT}
# Why is exec_prefix not used in BIN_DIR in Makefile?
%makeinstall prefix=${RPM_BUILD_ROOT}%prefix BIN_DIR=${RPM_BUILD_ROOT}%{_exec_prefix}/bin

DIR=${RPM_BUILD_ROOT}
find $DIR -type f | sed -e "s#^${RPM_BUILD_ROOT}##g" > %{name}.files

%clean
rm -rf ${RPM_BUILD_ROOT}

%files
# -f %{name}.files
/usr/bin/*
/usr/lib/swig*
#%doc /usr/share/doc/swig*
#/usr/share/doc/swig*
%defattr(-,root,root)

%files runtime
/usr/lib/lib*

%changelog
* Wed Jul 24 2002 Sam Liddicott <sam@liddicott.com>
- Added runtime package of runtime libs
* Mon Sep 10 2001 Tony Seward <anthony.seward@ieee.org>
- Merge Red Hat's and Dustin Mitchell's .spec files.
- Install all of the examples in the documantation directory.
- Auto create the list of installed files.
