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 URL: http://sourceforge.net/projects/polyclipping
14 Source0: http://downloads.sourceforge.net/polyclipping/clipper_ver%{version}.zip
15 # Source0-md5: 040821e66ec529f3d78f8ff7c4e256b2
17 BuildRequires: dos2unix
20 This library primarily performs the boolean clipping operations -
21 intersection, union, difference & xor - on 2D polygons. It also
22 performs polygon offsetting. The library handles complex
23 (self-intersecting) polygons, polygons with holes and polygons with
24 overlapping co-linear edges. Input polygons for clipping can use
25 EvenOdd, NonZero, Positive and Negative filling modes. The clipping
26 code is based on the Vatti clipping algorithm, and outperforms other
30 Summary: Development files for %{name}
31 Group: Development/Libraries
32 Requires: %{name} = %{version}-%{release}
35 The %{name}-devel package contains libraries and header files for
36 developing applications that use %{name}.
43 find . \( -name "*.exe" -o -name "*.dll" \) -delete
45 # Correct line ends and encodings
46 find . -type f -exec dos2unix -k {} \;
48 for filename in perl/perl_readme.txt README; do
49 iconv -f iso8859-1 -t utf-8 "${filename}" > "${filename}".conv && \
50 touch -r "${filename}" "${filename}".conv && \
51 mv "${filename}".conv "${filename}"
55 sed -i 's|^//#define use_lines$|#define use_lines|' cpp/clipper.hpp
66 rm -rf $RPM_BUILD_ROOT
67 %{__make} -C cpp/build install \
68 DESTDIR=$RPM_BUILD_ROOT
70 # Install agg header with corrected include statement
71 sed -e 's/\.\.\/clipper\.hpp/clipper.hpp/' < cpp/cpp_agg/agg_conv_clipper.h > $RPM_BUILD_ROOT/%{_includedir}/%{name}/agg_conv_clipper.h
73 %post -p /sbin/ldconfig
74 %postun -p /sbin/ldconfig
77 %defattr(644,root,root,755)
78 %doc License.txt README
79 %doc "Third\ Party/Haskell" "Third\ Party/perl" "Third\ Party/ruby" "Third\ Party/python" Documentation
80 %attr(755,root,root) %ghost %{_libdir}/lib%{name}.so.19
81 %attr(755,root,root) %{_libdir}/lib%{name}.so.*.*
84 %defattr(644,root,root,755)
85 %{_npkgconfigdir}/%{name}.pc
86 %{_includedir}/%{name}
87 %attr(755,root,root) %{_libdir}/lib%{name}.so
92 rm -rf $RPM_BUILD_ROOT