From ed30f6d77f6fe2e410e2cf6cab45423a0cf81bfa Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 27 Sep 2020 11:00:58 +0200 Subject: [PATCH] - added pc patch (install arch-specific .pc file in arch-dependent location) - pl - release 2 --- polyclipping-pc.patch | 11 ++++++++++ polyclipping.spec | 51 +++++++++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 polyclipping-pc.patch diff --git a/polyclipping-pc.patch b/polyclipping-pc.patch new file mode 100644 index 0000000..89f6fc6 --- /dev/null +++ b/polyclipping-pc.patch @@ -0,0 +1,11 @@ +--- polyclipping-6.4.2/cpp/CMakeLists.txt.orig 2015-04-23 09:04:20.000000000 +0200 ++++ polyclipping-6.4.2/cpp/CMakeLists.txt 2020-09-27 10:56:52.475493707 +0200 +@@ -5,7 +5,7 @@ + # The header name clipper.hpp is too generic, so install in a subdirectory + SET(CMAKE_INSTALL_INCDIR "${CMAKE_INSTALL_PREFIX}/include/polyclipping") + SET(CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") +-SET(CMAKE_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig") ++SET(CMAKE_INSTALL_PKGCONFIGDIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig") + SET(PCFILE "${CMAKE_CURRENT_BINARY_DIR}/polyclipping.pc") + + SET(BUILD_SHARED_LIBS ON CACHE BOOL diff --git a/polyclipping.spec b/polyclipping.spec index acd51d4..ee8a92b 100644 --- a/polyclipping.spec +++ b/polyclipping.spec @@ -5,15 +5,17 @@ # http://upstream-tracker.org/versions/clipper.html Summary: Polygon clipping library +Summary(pl.UTF-8): Biblioteka do obcinania wielokątów Name: polyclipping Version: 6.4.2 -Release: 1 +Release: 2 License: Boost Group: Libraries Source0: http://downloads.sourceforge.net/polyclipping/clipper_ver%{version}.zip # Source0-md5: 100b4ec56c5308bac2d10f3966e35e11 -URL: http://sourceforge.net/projects/polyclipping -BuildRequires: cmake +Patch0: %{name}-pc.patch +URL: https://sourceforge.net/projects/polyclipping/ +BuildRequires: cmake >= 2.6.0 BuildRequires: dos2unix BuildRequires: iconv BuildRequires: libstdc++-devel @@ -32,17 +34,33 @@ EvenOdd, NonZero, Positive and Negative filling modes. The clipping code is based on the Vatti clipping algorithm, and outperforms other clipping libraries. +%description -l pl.UTF-8 +Biblioteka do wykonywania logicznych operacji na wielokątach +dwuwymiarowych - przecięć, sumy, różnicy i różnicy symetrycznej. +Wykonuje także obcinanie marginesów. Biblioteka obsługuje wielokąty +złożone (samoprzecinające się), wielokąty z dziurami oraz z +nakładającymi się liniowo krawędziami. Wejściowe wielokąty mogą +używać trybu wypełniania EvenOdd, NonZero, Positive i Negative. Kod +obcinania jest oparty na algorytmie Vattiego i jest szybszy od wielu +innych bibliotek. + %package devel -Summary: Development files for %{name} +Summary: Development files for polyclipping library +Summary(pl.UTF-8): Pliki programistyczne biblioteki polyclipping Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel -The %{name}-devel package contains libraries and header files for -developing applications that use %{name}. +This package contains the header files for developing applications +that use polyclipping library. + +%description devel -l pl.UTF-8 +Ten pakiet zawiera pliki nagłówkowe do tworzenia aplikacji +wykorzystujących bibliotekę polyclipping. %prep %setup -qc +%patch0 -p1 # Delete binaries find . \( -name "*.exe" -o -name "*.dll" \) -print0 | xargs -0 rm -v @@ -53,7 +71,7 @@ find . -type f -exec dos2unix -k {} \; for filename in perl/perl_readme.txt README; do iconv -f iso8859-1 -t utf-8 "${filename}" > "${filename}".conv && \ touch -r "${filename}" "${filename}".conv && \ - mv "${filename}".conv "${filename}" + %{__mv} "${filename}".conv "${filename}" done # Enable use_lines @@ -62,32 +80,33 @@ sed -i 's|^//#define use_lines$|#define use_lines|' cpp/clipper.hpp %build install -d cpp/build cd cpp/build -%cmake .. +%cmake .. \ + -DCMAKE_INSTALL_PKGCONFIGDIR=%{_pkgconfigdir} %{__make} %install rm -rf $RPM_BUILD_ROOT + %{__make} -C cpp/build install \ DESTDIR=$RPM_BUILD_ROOT # Install agg header with corrected include statement sed -e 's/\.\.\/clipper\.hpp/clipper.hpp/' < cpp/cpp_agg/agg_conv_clipper.h > $RPM_BUILD_ROOT%{_includedir}/%{name}/agg_conv_clipper.h -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig - %clean rm -rf $RPM_BUILD_ROOT +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + %files %defattr(644,root,root,755) -%doc License.txt README -%doc "Third\ Party/Haskell" "Third\ Party/perl" "Third\ Party/ruby" "Third\ Party/python" Documentation +%doc License.txt README Third?Party/{Flash,Go,Haskell,Java,LuaJIT,Matlab,ObjectiveC,perl,ruby}/*_readme.txt %attr(755,root,root) %{_libdir}/libpolyclipping.so.*.*.* %attr(755,root,root) %ghost %{_libdir}/libpolyclipping.so.22 %files devel %defattr(644,root,root,755) -%{_npkgconfigdir}/%{name}.pc -%{_includedir}/%{name} -%{_libdir}/libpolyclipping.so +%attr(755,root,root) %{_libdir}/libpolyclipping.so +%{_includedir}/polyclipping +%{_pkgconfigdir}/polyclipping.pc -- 2.44.0