]> git.pld-linux.org Git - packages/polyclipping.git/blob - polyclipping.spec
acd51d4f6dcfaaec8ba17b2ec4b7280171249d68
[packages/polyclipping.git] / polyclipping.spec
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
8 Name:           polyclipping
9 Version:        6.4.2
10 Release:        1
11 License:        Boost
12 Group:          Libraries
13 Source0:        http://downloads.sourceforge.net/polyclipping/clipper_ver%{version}.zip
14 # Source0-md5:  100b4ec56c5308bac2d10f3966e35e11
15 URL:            http://sourceforge.net/projects/polyclipping
16 BuildRequires:  cmake
17 BuildRequires:  dos2unix
18 BuildRequires:  iconv
19 BuildRequires:  libstdc++-devel
20 BuildRequires:  pkgconfig
21 BuildRequires:  sed >= 4.0
22 BuildRequires:  unzip
23 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24
25 %description
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
33 clipping libraries.
34
35 %package devel
36 Summary:        Development files for %{name}
37 Group:          Development/Libraries
38 Requires:       %{name} = %{version}-%{release}
39
40 %description devel
41 The %{name}-devel package contains libraries and header files for
42 developing applications that use %{name}.
43
44 %prep
45 %setup -qc
46
47 # Delete binaries
48 find . \( -name "*.exe" -o -name "*.dll" \) -print0 | xargs -0 rm -v
49
50 # Correct line ends and encodings
51 find . -type f -exec dos2unix -k {} \;
52
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}"
57 done
58
59 # Enable use_lines
60 sed -i 's|^//#define use_lines$|#define use_lines|' cpp/clipper.hpp
61
62 %build
63 install -d cpp/build
64 cd cpp/build
65 %cmake ..
66 %{__make}
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70 %{__make} -C cpp/build install \
71         DESTDIR=$RPM_BUILD_ROOT
72
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
75
76 %post   -p /sbin/ldconfig
77 %postun -p /sbin/ldconfig
78
79 %clean
80 rm -rf $RPM_BUILD_ROOT
81
82 %files
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
88
89 %files devel
90 %defattr(644,root,root,755)
91 %{_npkgconfigdir}/%{name}.pc
92 %{_includedir}/%{name}
93 %{_libdir}/libpolyclipping.so
This page took 0.062089 seconds and 2 git commands to generate.