File freesteam.spec of Package freesteam

%define pyver %(python -c 'import sys ; print sys.version[:3]')
%define ascendversion %(ascend-config --version)
%define ASCEND_MODELS %(ascend-config --models)

# comment out the following line if you want a monolithic RPM
%define freesteam_split 1

Name:		freesteam
Summary:	Steam tables library (implements IAPWS-IF97 and IAPWS-95 correlations)
Version:	0.8.1

# Following values are filled in by SCons when .spec.in file converted to .spec:
%define SONAME_MAJOR .0
%define SONAME_MINOR .0

# Use release 0.* so that other users can do patch releases with a higher number
# and still have the update occur automatically.
Release:	0%{?dist}

License:	GPL
Group:		Applications/Engineering
Source:		%{name}-%{version}.tar.bz2
URL:		http://pye.dyndns.org/freesteam/

Prefix:		%{_prefix}
Packager:	John Pye
Vendor:		John Pye
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

# shouldn't be required by needed because of apparent bug in Build Service:
BuildRequires: desktop-file-utils

BuildRequires: python >= 2.4, python-devel
BuildRequires: scons >= 0.96.1
BuildRequires: swig >= 1.3.24
BuildRequires: blas, ascend-devel >= 0.9.5.100
BuildRequires: gcc-c++

%description
freesteam is an open source implementation of international-standard steam tables 
from the International Association for the Properties of Water and Steam (IAPWS). 
See http://freesteam.sf.net for more information.

#----------------------------------
%if %{defined freesteam_split}
%package ascend
Summary: freesteam external library for use with ASCEND
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
Requires: ascend = %{ascendversion}
%description ascend
ASCEND bindings for the freesteam steam tables library. This package allows
IAPWS-IF97 steam tables to be used in ASCEND for modelling of water/steam
equipment models.

%package python
Summary: freesteam external library for use with Python
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
Requires: python
%description python
Python bindings for the freesteam steam tables library. This package allows
IAPWS-IF97 steam tables to be calculated using the Python scripting language.
%endif

%package devel
Summary: Developer files for freesteam
Group: Applications/Engineering
Requires: %{name} = %{version}-%{release}
%description devel
Developer files for the freesteam IAPWS steam properties library, including
C++ header files and shared library symlinks.
#-----------------------------------

%prep
%setup -q 

%build
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_prefix}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_datadir}
mkdir -p %{buildroot}%{ASCEND_MODELS}
scons %{?_smp_mflags} \
		CXX="%{?ccache} g++" \
	ascend python

%install
scons %{?_smp_mflags} \
		INSTALL_ROOT=%{buildroot} \
		INSTALL_PREFIX=%{_prefix} \
		INSTALL_BIN=%{_bindir} \
		LIBDIR=%{_libdir} \
		INCDIR=%{_includedir} \
		INSTALL_SHARE=%{_datadir} \
	install

# Fix uninstalled files
mkdir -p %{buildroot}%{_libdir}/python%{pyver}/site-packages/
cp python/freesteam.py %{buildroot}%{_libdir}/python%{pyver}/site-packages/
cp python/_freesteam.so %{buildroot}%{_libdir}/python%{pyver}/site-packages/

%clean
rm -rf %{buildroot} 

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files
%defattr(-, root, root)
%doc CHANGELOG.txt README.html LICENSE.txt
%{_libdir}/lib%{name}.so%{SONAME_MAJOR}%{SONAME_MINOR}

#----------------------------
%if %{defined freesteam_split}
%files ascend
%defattr(-, root, root)
%endif
%{ASCEND_MODELS}/libfreesteam_ascend.so
%{ASCEND_MODELS}/testfreesteam.a4c
%{ASCEND_MODELS}/iapwssatprops.a4c
%{ASCEND_MODELS}/moistair.a4c

%if %{defined freesteam_split}
%files python
%defattr(-, root, root)
%endif
%{_libdir}/python%{pyver}/site-packages/freesteam.py*
%{_libdir}/python%{pyver}/site-packages/_freesteam.so

%if %{defined freesteam_split}
%files devel
%defattr(-, root, root)
%endif
%{_bindir}/freesteam-config
%{_includedir}/%{name}/*.h
%{_includedir}/%{name}/freesteam.i
%{_libdir}/lib%{name}.so%{SONAME_MAJOR}
%{_libdir}/lib%{name}.so

#-----------------------------

%changelog
* Mon Aug 20 2007 John Pye <john@curioussymbols.com> 0.7.3
- Starting work on 0.7.3

* Sun Aug 19 2007 John Pye <john@curioussymbols.com> 0.7.2
- Updated for 0.7.2
- Split ASCEND and Python parts into sub-packages.
- Renamed ASCEND external library
- Implemented correct 'soname' library versioning for libfreesteam.
- Fixed detection of ascend-config.

* Wed Oct 25 2006 John Pye <john.pye@student.unsw.edu.au> 0.6.1
- Added to sf.net CVS repository, updating for use with scons

* Wed Sep 27 2006 Christophe Trophime <christophe.trophime@grenoble.cnrs.fr>
- Initial build for fc5

openSUSE Build Service is sponsored by