]>
Commit | Line | Data |
---|---|---|
01e1d5d6 AM |
1 | # The Clipper C++ crystallographic library already uses the name "clipper". |
2 | # The developer is fine with the choosen name. | |
3 | ||
4 | # API monitoring | |
5 | # http://upstream-tracker.org/versions/clipper.html | |
6 | ||
7 | Summary: Polygon clipping library | |
ed30f6d7 | 8 | Summary(pl.UTF-8): Biblioteka do obcinania wielokątów |
01e1d5d6 | 9 | Name: polyclipping |
3ff5ab22 | 10 | Version: 6.4.2 |
ed30f6d7 | 11 | Release: 2 |
01e1d5d6 AM |
12 | License: Boost |
13 | Group: Libraries | |
01e1d5d6 | 14 | Source0: http://downloads.sourceforge.net/polyclipping/clipper_ver%{version}.zip |
3ff5ab22 | 15 | # Source0-md5: 100b4ec56c5308bac2d10f3966e35e11 |
ed30f6d7 JB |
16 | Patch0: %{name}-pc.patch |
17 | URL: https://sourceforge.net/projects/polyclipping/ | |
18 | BuildRequires: cmake >= 2.6.0 | |
01e1d5d6 | 19 | BuildRequires: dos2unix |
01869d60 ER |
20 | BuildRequires: iconv |
21 | BuildRequires: libstdc++-devel | |
22 | BuildRequires: pkgconfig | |
d06b15ed ER |
23 | BuildRequires: sed >= 4.0 |
24 | BuildRequires: unzip | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
01e1d5d6 AM |
26 | |
27 | %description | |
28 | This library primarily performs the boolean clipping operations - | |
29 | intersection, union, difference & xor - on 2D polygons. It also | |
30 | performs polygon offsetting. The library handles complex | |
31 | (self-intersecting) polygons, polygons with holes and polygons with | |
32 | overlapping co-linear edges. Input polygons for clipping can use | |
33 | EvenOdd, NonZero, Positive and Negative filling modes. The clipping | |
34 | code is based on the Vatti clipping algorithm, and outperforms other | |
35 | clipping libraries. | |
36 | ||
ed30f6d7 JB |
37 | %description -l pl.UTF-8 |
38 | Biblioteka do wykonywania logicznych operacji na wielokątach | |
39 | dwuwymiarowych - przecięć, sumy, różnicy i różnicy symetrycznej. | |
40 | Wykonuje także obcinanie marginesów. Biblioteka obsługuje wielokąty | |
41 | złożone (samoprzecinające się), wielokąty z dziurami oraz z | |
42 | nakładającymi się liniowo krawędziami. Wejściowe wielokąty mogą | |
43 | używać trybu wypełniania EvenOdd, NonZero, Positive i Negative. Kod | |
44 | obcinania jest oparty na algorytmie Vattiego i jest szybszy od wielu | |
45 | innych bibliotek. | |
46 | ||
d06b15ed | 47 | %package devel |
ed30f6d7 JB |
48 | Summary: Development files for polyclipping library |
49 | Summary(pl.UTF-8): Pliki programistyczne biblioteki polyclipping | |
01e1d5d6 AM |
50 | Group: Development/Libraries |
51 | Requires: %{name} = %{version}-%{release} | |
52 | ||
d06b15ed | 53 | %description devel |
ed30f6d7 JB |
54 | This package contains the header files for developing applications |
55 | that use polyclipping library. | |
56 | ||
57 | %description devel -l pl.UTF-8 | |
58 | Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji | |
59 | wykorzystujących bibliotekę polyclipping. | |
01e1d5d6 | 60 | |
01e1d5d6 AM |
61 | %prep |
62 | %setup -qc | |
ed30f6d7 | 63 | %patch0 -p1 |
01e1d5d6 AM |
64 | |
65 | # Delete binaries | |
d06b15ed | 66 | find . \( -name "*.exe" -o -name "*.dll" \) -print0 | xargs -0 rm -v |
01e1d5d6 AM |
67 | |
68 | # Correct line ends and encodings | |
69 | find . -type f -exec dos2unix -k {} \; | |
70 | ||
71 | for filename in perl/perl_readme.txt README; do | |
d06b15ed ER |
72 | iconv -f iso8859-1 -t utf-8 "${filename}" > "${filename}".conv && \ |
73 | touch -r "${filename}" "${filename}".conv && \ | |
ed30f6d7 | 74 | %{__mv} "${filename}".conv "${filename}" |
01e1d5d6 AM |
75 | done |
76 | ||
77 | # Enable use_lines | |
78 | sed -i 's|^//#define use_lines$|#define use_lines|' cpp/clipper.hpp | |
79 | ||
01e1d5d6 AM |
80 | %build |
81 | install -d cpp/build | |
82 | cd cpp/build | |
ed30f6d7 JB |
83 | %cmake .. \ |
84 | -DCMAKE_INSTALL_PKGCONFIGDIR=%{_pkgconfigdir} | |
01e1d5d6 | 85 | %{__make} |
01e1d5d6 AM |
86 | |
87 | %install | |
88 | rm -rf $RPM_BUILD_ROOT | |
ed30f6d7 | 89 | |
01e1d5d6 AM |
90 | %{__make} -C cpp/build install \ |
91 | DESTDIR=$RPM_BUILD_ROOT | |
92 | ||
93 | # Install agg header with corrected include statement | |
d06b15ed | 94 | sed -e 's/\.\.\/clipper\.hpp/clipper.hpp/' < cpp/cpp_agg/agg_conv_clipper.h > $RPM_BUILD_ROOT%{_includedir}/%{name}/agg_conv_clipper.h |
01e1d5d6 | 95 | |
d06b15ed ER |
96 | %clean |
97 | rm -rf $RPM_BUILD_ROOT | |
01e1d5d6 | 98 | |
ed30f6d7 JB |
99 | %post -p /sbin/ldconfig |
100 | %postun -p /sbin/ldconfig | |
101 | ||
01e1d5d6 AM |
102 | %files |
103 | %defattr(644,root,root,755) | |
ed30f6d7 | 104 | %doc License.txt README Third?Party/{Flash,Go,Haskell,Java,LuaJIT,Matlab,ObjectiveC,perl,ruby}/*_readme.txt |
d06b15ed | 105 | %attr(755,root,root) %{_libdir}/libpolyclipping.so.*.*.* |
3ff5ab22 | 106 | %attr(755,root,root) %ghost %{_libdir}/libpolyclipping.so.22 |
01e1d5d6 AM |
107 | |
108 | %files devel | |
109 | %defattr(644,root,root,755) | |
ed30f6d7 JB |
110 | %attr(755,root,root) %{_libdir}/libpolyclipping.so |
111 | %{_includedir}/polyclipping | |
112 | %{_pkgconfigdir}/polyclipping.pc |