qhull/qhull.spec
2017-05-26 18:19:05 +03:00

125 lines
3.3 KiB
RPMSpec

%define major 6.3.0.1483
%define libname %mklibname %{name} %{major}
%define libname6p %mklibname %{name}6_p %{major}
%define devname %mklibname %{name} -d
%define sdevname %mklibname %{name} -d -s
Summary: Compute convex hulls
Name: qhull
Version: 2012.1
Release: 9
License: GPLv2+
Group: System/Libraries
Url: http://www.qhull.org/
Source0: http://www.qhull.org/files/%{name}-%{version}-src.tgz
BuildRequires: cmake
Patch0: qhull-2012.1-format.patch
%description
Qhull computes convex hulls, Delaunay triangulations, halfspace
intersections about a point, Voronoi diagrams, furthest-site Delaunay
triangulations, and furthest-site Voronoi diagrams. It runs in 2-d, 3-d,
4-d, and higher dimensions. It implements the Quickhull algorithm for
computing the convex hull. Qhull handles roundoff errors from floating
point arithmetic. It can approximate a convex hull.
%files
%doc Announce.txt COPYING.txt README.txt REGISTER.txt
%{_bindir}/qconvex*
%{_bindir}/qdelaunay*
%{_bindir}/qhalf*
%{_bindir}/qhull*
%{_bindir}/qvoronoi*
%{_bindir}/rbox*
%{_bindir}/testqset*
%{_bindir}/user_eg*
%{_mandir}/man1/qhull.1*
%{_mandir}/man1/rbox.1*
%exclude %{_docdir}/%{name}/html
#----------------------------------------------------------------------------
%package -n %{libname}
Summary: Shared library for %{name}
Group: System/Libraries
Conflicts: %{_lib}qhull6 < 2012.1-6
Obsoletes: %{_lib}qhull6 < 2012.1-6
%description -n %{libname}
Shared library for %{name}.
%files -n %{libname}
%{_libdir}/libqhull.so.%{major}
#----------------------------------------------------------------------------
%package -n %{libname6p}
Summary: Shared library for %{name}
Group: System/Libraries
Conflicts: %{_lib}qhull6 < 2012.1-6
%description -n %{libname6p}
Shared library for %{name}.
%files -n %{libname6p}
%{_libdir}/libqhull6_p.so.%{major}
#----------------------------------------------------------------------------
%package -n %{devname}
Summary: Header files and libraries for development with %{name}
Group: Development/C
Requires: %{libname} = %{EVRD}
Requires: %{libname6p} = %{EVRD}
Provides: %{name}-devel = %{EVRD}
%description -n %{devname}
Header files and libraries for development with %{name}.
%files -n %{devname}
%{_libdir}/*.so
%{_includedir}/*
%doc %{_docdir}/%{name}/html
#----------------------------------------------------------------------------
%package -n %{sdevname}
Summary: Static library for development with %{name}
Group: Development/C
Requires: %{devname} = %{EVRD}
Provides: %{name}-static-devel = %{EVRD}
%description -n %{sdevname}
Header files and static library for development with %{name}.
%files -n %{sdevname}
%{_libdir}/*.a
#----------------------------------------------------------------------------
%prep
%setup -q
%patch0 -p1
%build
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
pushd build
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=%{buildroot}%{_prefix} \
-DLIB_INSTALL_DIR:PATH=%{buildroot}%{_libdir} \
-DMAN_INSTALL_DIR:PATH=%{buildroot}%{_mandir}/man1 \
-DDOC_INSTALL_DIR:PATH=%{buildroot}%{_docdir}/%{name} \
..
%make
popd
%install
make -C build install
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -fpa html %{buildroot}%{_docdir}/%{name}
# add some symlinks to satisfy octave configure
ln -sf libqhull %{buildroot}%{_includedir}/qhull
ln -sf libqhull.h %{buildroot}%{_includedir}/qhull/qhull.h