geos/geos.spec

269 lines
8.2 KiB
RPMSpec
Raw Normal View History

#
# spec file for package geos
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define uver 3_5_0
Name: geos
Version: 3.5.0
Release: 0
Summary: Geometry Engine - Open Source
License: LGPL-2.1
Group: Development/Libraries/C and C++
Url: http://trac.osgeo.org/geos/
Source0: http://download.osgeo.org/%{name}/%{name}-%{version}.tar.bz2
Source1: %{name}-config.1
Source2: %{name}.ini
Patch0: libruby.patch
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: python-devel
BuildRequires: swig
Provides: libgeos = %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1210
BuildRequires: ruby
BuildRequires: ruby-devel
%endif
# Dependencies for opensuse but not for SLE-12
%if 0%{?suse_version} >= 1210 && 0%{?suse_version} != 1315
BuildRequires: chrpath
BuildRequires: php-devel
BuildRequires: php5-pear-phpunit
%endif
%description
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology
Suite (JTS). As such, it aims to contain the complete functionality of JTS
in C++. This includes all the OpenGIS "Simple Features for SQL" spatial
predicate functions and spatial operators, as well as specific JTS topology
functions such as IsValid().
%package -n libgeos-%{uver}
Summary: Geometry Engine library
Group: System/Libraries
%description -n libgeos-%{uver}
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology
Suite (JTS). As such, it aims to contain the complete functionality of JTS
in C++. This includes all the OpenGIS "Simple Features for SQL" spatial
predicate functions and spatial operators, as well as specific JTS topology
functions such as IsValid().
%package -n libgeos_c1
Summary: C language interface for the GEOS library
Group: System/Libraries
Provides: geos = %{version}-%{release}
Obsoletes: geos < %{version}-%{release}
%description -n libgeos_c1
This subpackage contains a shared library providing a C linkage
interface for the (C++) GEOS library.
%package -n python-%{name}
Summary: Python bindings for Geometry Engine
Group: Development/Languages/Python
%description -n python-%{name}
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology
Suite (JTS). As such, it aims to contain the complete functionality of
JTS in C++. This includes all the OpenGIS "Simple Features for SQL" spatial
predicate functions and spatial operators, as well as specific JTS topology
functions such as IsValid()
This package contains python bindings for Geometry Engine.
%if 0%{?suse_version} >= 1210 && 0%{?suse_version} != 1315
%package -n php5-%{name}
Summary: PHP bindings for Geometry Engine
Group: Development/Languages/Other
Requires: php5 >= %{phpversion}
%description -n php5-%{name}
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology
Suite (JTS). As such, it aims to contain the complete functionality of
JTS in C++. This includes all the OpenGIS "Simple Features for SQL" spatial
predicate functions and spatial operators, as well as specific JTS topology
functions such as IsValid()
This package contains php bindings for Geometry Engine.
%endif
%if 0%{?suse_version} > 1210
%package -n ruby-%{name}
Summary: Ruby bindings for Geometry Engine
Group: Development/Languages/Ruby
Requires: ruby(abi) >= %{rb_ver}
%description -n ruby-%{name}
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology
Suite (JTS). As such, it aims to contain the complete functionality of
JTS in C++. This includes all the OpenGIS "Simple Features for SQL" spatial
predicate functions and spatial operators, as well as specific JTS topology
functions such as IsValid()
This package contains ruby bindings for Geometry Engine.
%endif
%package devel
Summary: Development files for GEOS
Group: Development/Libraries/C and C++
Requires: libgeos-%{uver} = %{version}
Requires: libgeos_c1 = %{version}
Provides: lib%{name}-devel = %{version}
%description devel
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology
Suite (JTS). As such, it aims to contain the complete functionality of
JTS in C++. This includes all the OpenGIS "Simple Features for SQL" spatial
predicate functions and spatial operators, as well as specific JTS topology
functions such as IsValid()
This package contains the development files to build applications that
use GEOS.
%package doc
Summary: Development documentation for GEOS
Group: Documentation/HTML
%if 0%{?suse_version} > 1210
BuildArch: noarch
%endif
%description doc
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology
Suite (JTS). As such, it aims to contain the complete functionality of
JTS in C++. This includes all the OpenGIS "Simple Features for SQL" spatial
predicate functions and spatial operators, as well as specific JTS topology
functions such as IsValid()
This package contains the development documentation for GEOS.
%prep
%setup -q
%patch0 -p1
%build
# disable internal libtool to avoid hardcoded r-path
%if 0%{?suse_version} > 1210
for makefile in `find . -type f -name 'Makefile.in'`; do
sed -i 's|@LIBTOOL@|%{_bindir}/libtool|g' $makefile
done
%endif
%configure \
--disable-static \
%if 0%{?suse_version} > 1210
--enable-ruby \
%endif
%if 0%{?suse_version} >= 1210 && 0%{?suse_version} != 1315
--enable-php \
%endif
--enable-python
make %{?_smp_mflags}
# Make doxygen documentation files
cd doc
make %{?_smp_mflags} doxygen-html
# tests fail with older releases and non-intel architectures
# while this was reported to upstream, there has been no reply
%if 0%{?suse_version} > 1210
%ifarch %ix86 x86_64
%check
make %{?_smp_mflags} check
%endif
%endif
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
install -d -m 0755 %{buildroot}%{_mandir}/man1
install -D -m 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/
%if 0%{?suse_version} >= 1210 && 0%{?suse_version} != 1315
install -d -m 0755 %{buildroot}%{_sysconfdir}/php.d
install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/php.d/
%endif
# do not ship static libraries or la files
rm -rf %{buildroot}/%{_libdir}/*.a
find %{buildroot} -type f -name "*.la" -delete -print
rm -rf %{buildroot}/%{python_sitearch}/%{name}/*.a
rm -rf %{buildroot}/%{python_sitearch}/%{name}/*.la
rm -rf %{buildroot}/%{rb_vendorarchdir}/*.a
rm -rf %{buildroot}/%{rb_vendorarchdir}/*.la
%if 0%{?suse_version} >= 1210 && 0%{?suse_version} != 1315
chrpath --delete %{buildroot}%{_libdir}/php5/extensions/%{name}.so
%endif
%post -n libgeos-%{uver} -p /sbin/ldconfig
%postun -n libgeos-%{uver} -p /sbin/ldconfig
%post -n libgeos_c1 -p /sbin/ldconfig
%postun -n libgeos_c1 -p /sbin/ldconfig
%files -n libgeos-%{uver}
%defattr(-,root,root)
%doc COPYING
%{_libdir}/libgeos-%{version}.so*
%files -n libgeos_c1
%defattr(-,root,root)
%doc COPYING
%{_libdir}/libgeos_c.so.*
%files -n python-%{name}
%defattr(-,root,root)
%doc COPYING
%{python_sitelib}/*
%{python_sitearch}/*
%if 0%{?suse_version} >= 1210 && 0%{?suse_version} != 1315
%files -n php5-%{name}
%defattr(-,root,root)
%doc COPYING
%dir %{_sysconfdir}/php.d
%config %{_sysconfdir}/php.d/%{name}.ini
%{_libdir}/php5/extensions/%{name}.so
%endif
%if 0%{?suse_version} > 1210
%files -n ruby-%{name}
%defattr(-,root,root)
%doc COPYING
%{rb_vendorarchdir}/%{name}.so
%endif
%files devel
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README TODO
%{_mandir}/man1/%{name}-config.1.gz
%{_bindir}/%{name}-config
%{_includedir}/*
%{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}_c.so
%files doc
%defattr(-,root,root)
%doc doc/doxygen_docs
%changelog