]>
Commit | Line | Data |
---|---|---|
72198c6f JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python # Python bindings | |
4 | # | |
5 | Summary: 2Geom - easy 2D graphics library | |
6 | Summary(pl.UTF-8): 2Geom - łatwa biblioteka do grafiki 2D | |
7 | Name: lib2geom | |
8 | Version: 1.1 | |
6206caf6 | 9 | Release: 3 |
72198c6f JB |
10 | License: LGPL v2.1 or MPL v1.1 |
11 | Group: Libraries | |
12 | #Source0Download: https://gitlab.com/inkscape/lib2geom/-/tags | |
13 | Source0: https://gitlab.com/inkscape/lib2geom/-/archive/%{version}/%{name}-%{version}.tar.bz2 | |
14 | # Source0-md5: 438a95f4c92b8370b3ab00a843c8a5fa | |
15 | Patch0: %{name}-pc.patch | |
16 | Patch1: %{name}-python-install.patch | |
17 | URL: https://gitlab.com/inkscape/lib2geom | |
18 | BuildRequires: boost-devel >= 1.60 | |
19 | %{?with_python:BuildRequires: boost-python3-devel >= 1.60} | |
20 | BuildRequires: cairo-devel | |
21 | BuildRequires: cmake >= 3.12 | |
22 | BuildRequires: double-conversion-devel | |
23 | BuildRequires: glib2-devel >= 2.0 | |
24 | BuildRequires: gsl-devel | |
25 | BuildRequires: gtk+3-devel >= 3.0 | |
26 | BuildRequires: pkgconfig | |
27 | %{?with_python:BuildRequires: python3-Cython >= 0.16} | |
28 | %{?with_python:BuildRequires: python3-devel >= 1:3.2} | |
29 | BuildRequires: libstdc++-devel >= 6:7 | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | 2Geom is a C++ 2D geometry library geared towards robust processing of | |
34 | computational geometry data associated with vector graphics. The | |
35 | primary design consideration is ease of use and clarity. It is | |
36 | dual-licensed under LGPL 2.1 and MPL 1.1. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | 2Geom to biblioteka C++ do geometrii 2D, nakierowana głównie na bogate | |
40 | przetwarzanie danych geometrii obliczeniowej, związanych z grafiką | |
41 | wektorową. Główne założenia projektowe to łatwość użycia i | |
42 | przejrzystość. Kod biblioteki jest na podwójnej licencji LGPL 2.1 i | |
43 | MPL 1.1. | |
44 | ||
45 | %package devel | |
46 | Summary: Header files for 2Geom library | |
47 | Summary(pl.UTF-8): Pliki nagłówkowe biblioteki 2Geom | |
48 | Group: Development/Libraries | |
49 | Requires: %{name} = %{version}-%{release} | |
50 | Requires: boost-devel >= 1.60 | |
51 | Requires: gsl-devel | |
52 | Requires: libstdc++-devel >= 6:7 | |
53 | ||
54 | %description devel | |
55 | Header files for 2Geom library. | |
56 | ||
57 | %description devel -l pl.UTF-8 | |
58 | Pliki nagłówkowe biblioteki 2Geom. | |
59 | ||
60 | %package -n python3-py2geom | |
61 | Summary: Python bindings for lib2geom | |
62 | Summary(pl.UTF-8): Wiązania Pythona do lib2geom | |
63 | Group: Libraries/Python | |
64 | Requires: %{name} = %{version}-%{release} | |
65 | ||
66 | %description -n python3-py2geom | |
67 | Boost-based Python bindings for lib2geom. | |
68 | ||
69 | %description -n python3-py2geom -l pl.UTF-8 | |
70 | Wiązania Pythona do lib2geom oparte na bibliotece Boost. | |
71 | ||
72 | %prep | |
73 | %setup -q | |
74 | %patch0 -p1 | |
75 | %patch1 -p1 | |
76 | ||
77 | %build | |
78 | install -d build | |
79 | cd build | |
80 | %cmake .. \ | |
81 | -D2GEOM_BUILD_SHARED=ON \ | |
82 | %{?with_python:-D2GEOM_BOOST_PYTHON=ON} \ | |
83 | %{?with_python:-D2GEOM_CYTHON_BINDINGS=ON} \ | |
84 | -DCMAKE_SKIP_RPATH=ON \ | |
85 | -DPYTHON3_SITEARCH_INSTALL_DIR=%{py3_sitedir} | |
86 | ||
87 | %{__make} | |
88 | ||
89 | %if %{with python} | |
90 | # cy2geom code seems outdated | |
91 | #%{__make} -C src/cython | |
92 | ||
93 | %{__make} -C src/py2geom | |
94 | %endif | |
95 | ||
96 | %install | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %{__make} -C build install \ | |
100 | DESTDIR=$RPM_BUILD_ROOT | |
101 | ||
102 | %if %{with python} | |
103 | %{__make} -C build/src/py2geom install \ | |
104 | DESTDIR=$RPM_BUILD_ROOT | |
105 | ||
106 | %py3_comp $RPM_BUILD_ROOT%{py3_sitedir} | |
107 | %py3_ocomp $RPM_BUILD_ROOT%{py3_sitedir} | |
108 | %endif | |
109 | ||
110 | %clean | |
111 | rm -rf $RPM_BUILD_ROOT | |
112 | ||
113 | %post -p /sbin/ldconfig | |
114 | %postun -p /sbin/ldconfig | |
115 | ||
116 | %files | |
117 | %defattr(644,root,root,755) | |
118 | %doc AUTHORS.md LICENSE.md NEWS.md README.md TODO.md | |
119 | %attr(755,root,root) %{_libdir}/lib2geom.so.1.1.0 | |
120 | ||
121 | %files devel | |
122 | %defattr(644,root,root,755) | |
123 | %attr(755,root,root) %{_libdir}/lib2geom.so | |
124 | %{_includedir}/2geom-1.1.0 | |
125 | %{_pkgconfigdir}/2geom.pc | |
126 | %{_libdir}/cmake/2Geom | |
127 | ||
128 | %if %{with python} | |
129 | %files -n python3-py2geom | |
130 | %defattr(644,root,root,755) | |
131 | %dir %{py3_sitedir}/py2geom | |
132 | %{py3_sitedir}/py2geom/__pycache__ | |
133 | %{py3_sitedir}/py2geom/__init__.py | |
134 | %attr(755,root,root) %{py3_sitedir}/py2geom/_py2geom.so | |
135 | %endif |