1 # The Clipper C++ crystallographic library already uses the name "clipper".
2 # The developer is fine with the choosen name.
5 # http://upstream-tracker.org/versions/clipper.html
7 Summary: Polygon clipping library
13 Source0: http://downloads.sourceforge.net/polyclipping/clipper_ver%{version}.zip
14 # Source0-md5: 100b4ec56c5308bac2d10f3966e35e11
15 URL: http://sourceforge.net/projects/polyclipping
17 BuildRequires: dos2unix
19 BuildRequires: libstdc++-devel
20 BuildRequires: pkgconfig
21 BuildRequires: sed >= 4.0
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 This library primarily performs the boolean clipping operations -
27 intersection, union, difference & xor - on 2D polygons. It also
28 performs polygon offsetting. The library handles complex
29 (self-intersecting) polygons, polygons with holes and polygons with
30 overlapping co-linear edges. Input polygons for clipping can use
31 EvenOdd, NonZero, Positive and Negative filling modes. The clipping
32 code is based on the Vatti clipping algorithm, and outperforms other
36 Summary: Development files for %{name}
37 Group: Development/Libraries
38 Requires: %{name} = %{version}-%{release}
41 The %{name}-devel package contains libraries and header files for
42 developing applications that use %{name}.
48 find . \( -name "*.exe" -o -name "*.dll" \) -print0 | xargs -0 rm -v
50 # Correct line ends and encodings
51 find . -type f -exec dos2unix -k {} \;
53 for filename in perl/perl_readme.txt README; do
54 iconv -f iso8859-1 -t utf-8 "${filename}" > "${filename}".conv && \
55 touch -r "${filename}" "${filename}".conv && \
56 mv "${filename}".conv "${filename}"
60 sed -i 's|^//#define use_lines$|#define use_lines|' cpp/clipper.hpp
69 rm -rf $RPM_BUILD_ROOT
70 %{__make} -C cpp/build install \
71 DESTDIR=$RPM_BUILD_ROOT
73 # Install agg header with corrected include statement
74 sed -e 's/\.\.\/clipper\.hpp/clipper.hpp/' < cpp/cpp_agg/agg_conv_clipper.h > $RPM_BUILD_ROOT%{_includedir}/%{name}/agg_conv_clipper.h
76 %post -p /sbin/ldconfig
77 %postun -p /sbin/ldconfig
80 rm -rf $RPM_BUILD_ROOT
83 %defattr(644,root,root,755)
84 %doc License.txt README
85 %doc "Third\ Party/Haskell" "Third\ Party/perl" "Third\ Party/ruby" "Third\ Party/python" Documentation
86 %attr(755,root,root) %{_libdir}/libpolyclipping.so.*.*.*
87 %attr(755,root,root) %ghost %{_libdir}/libpolyclipping.so.22
90 %defattr(644,root,root,755)
91 %{_npkgconfigdir}/%{name}.pc
92 %{_includedir}/%{name}
93 %{_libdir}/libpolyclipping.so