From 01e1d5d619b3c84e5f5ad8f353e129d3a5e47ed4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 30 Apr 2015 14:43:34 +0200 Subject: [PATCH] - initial from FC --- polyclipping.spec | 92 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 polyclipping.spec diff --git a/polyclipping.spec b/polyclipping.spec new file mode 100644 index 0000000..9cb4478 --- /dev/null +++ b/polyclipping.spec @@ -0,0 +1,92 @@ +# The Clipper C++ crystallographic library already uses the name "clipper". +# The developer is fine with the choosen name. + +# API monitoring +# http://upstream-tracker.org/versions/clipper.html + +Summary: Polygon clipping library +Name: polyclipping +Version: 6.2.1 +Release: 1 +License: Boost +Group: Libraries +URL: http://sourceforge.net/projects/polyclipping +Source0: http://downloads.sourceforge.net/polyclipping/clipper_ver%{version}.zip +# Source0-md5: 040821e66ec529f3d78f8ff7c4e256b2 +BuildRequires: cmake +BuildRequires: dos2unix + +%description +This library primarily performs the boolean clipping operations - +intersection, union, difference & xor - on 2D polygons. It also +performs polygon offsetting. The library handles complex +(self-intersecting) polygons, polygons with holes and polygons with +overlapping co-linear edges. Input polygons for clipping can use +EvenOdd, NonZero, Positive and Negative filling modes. The clipping +code is based on the Vatti clipping algorithm, and outperforms other +clipping libraries. + +%package devel +Summary: Development files for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%prep +%setup -qc + +# Delete binaries +find . \( -name "*.exe" -o -name "*.dll" \) -delete + +# Correct line ends and encodings +find . -type f -exec dos2unix -k {} \; + +for filename in perl/perl_readme.txt README; do + iconv -f iso8859-1 -t utf-8 "${filename}" > "${filename}".conv && \ + touch -r "${filename}" "${filename}".conv && \ + mv "${filename}".conv "${filename}" +done + +# Enable use_lines +sed -i 's|^//#define use_lines$|#define use_lines|' cpp/clipper.hpp + + +%build +install -d cpp/build +cd cpp/build +%{cmake} .. +%{__make} +cd ../.. + +%install +rm -rf $RPM_BUILD_ROOT +%{__make} -C cpp/build install \ + DESTDIR=$RPM_BUILD_ROOT + +# Install agg header with corrected include statement +sed -e 's/\.\.\/clipper\.hpp/clipper.hpp/' < cpp/cpp_agg/agg_conv_clipper.h > $RPM_BUILD_ROOT/%{_includedir}/%{name}/agg_conv_clipper.h + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(644,root,root,755) +%doc License.txt README +%doc "Third\ Party/Haskell" "Third\ Party/perl" "Third\ Party/ruby" "Third\ Party/python" Documentation +%attr(755,root,root) %ghost %{_libdir}/lib%{name}.so.19 +%attr(755,root,root) %{_libdir}/lib%{name}.so.*.* + +%files devel +%defattr(644,root,root,755) +%{_npkgconfigdir}/%{name}.pc +%{_includedir}/%{name} +%attr(755,root,root) %{_libdir}/lib%{name}.so + +%changelog + +%clean +rm -rf $RPM_BUILD_ROOT -- 2.44.0