Initial package

This commit is contained in:
Sandro Mani 2022-05-11 15:35:07 +02:00
parent 8bb5b7fae9
commit 3e5e551dc9
4 changed files with 133 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/lerc-b1de4cd.tar.gz

13
lerc-dllver.patch Normal file
View File

@ -0,0 +1,13 @@
diff -rupN lerc-b1de4cd146f73e9a679682e209de1ecde1ca094e/CMakeLists.txt lerc-b1de4cd146f73e9a679682e209de1ecde1ca094e-new/CMakeLists.txt
--- lerc-b1de4cd146f73e9a679682e209de1ecde1ca094e/CMakeLists.txt 2022-05-05 21:45:53.000000000 +0200
+++ lerc-b1de4cd146f73e9a679682e209de1ecde1ca094e-new/CMakeLists.txt 2022-05-06 17:59:32.035158986 +0200
@@ -30,6 +30,9 @@ if(BUILD_SHARED_LIBS)
PROPERTIES
SOVERSION ${CMAKE_PROJECT_VERSION_MAJOR}
DEFINE_SYMBOL LERC_EXPORTS)
+ if(WIN32)
+ set_target_properties(Lerc PROPERTIES SUFFIX "-${CMAKE_PROJECT_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ endif(WIN32)
else()
set_target_properties(Lerc
PROPERTIES

118
liblerc.spec Normal file
View File

@ -0,0 +1,118 @@
%global commit b1de4cd146f73e9a679682e209de1ecde1ca094e
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: liblerc
Version: 3.1
Release: 0.1%{?commit:.git%{shortcommit}}%{?dist}
Summary: Library for Limited Error Raster Compression
License: ASL 2.0
URL: https://github.com/Esri/lerc
%if 0%{?commit:1}
Source0: https://github.com/Esri/lerc/archive/%{commit}/lerc-%{shortcommit}.tar.gz
%else
Source0: https://github.com/Esri/lerc/archive/v%{version}/lerc-%{version}.tar.gz
%endif
# Add version suffix to mingw dll
Patch0: lerc-dllver.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: python3-devel
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc-c++
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc-c++
%description
LERC is an open-source image or raster format which supports rapid encoding and
decoding for any pixel type (not just RGB or Byte). Users set the maximum
compression error per pixel while encoding, so the precision of the original
input image is preserved (within user defined error bounds).
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package -n mingw32-%{name}
Summary: MinGW Windows %{name} library
BuildArch: noarch
%description -n mingw32-%{name}
%{summary}.
%package -n mingw64-%{name}
Summary: MinGW Windows %{name} library
BuildArch: noarch
%description -n mingw64-%{name}
%{summary}.
%prep
%if 0%{?commit:1}
%autosetup -p1 -n lerc-%{commit}
%else
%autosetup -p1 -n lerc-v%{version}
%endif
# Fix line endings
sed -i 's/\r$//' NOTICE README.md doc/MORE.md
%build
# Native build
%cmake
%cmake_build
# MinGW build
%mingw_cmake
%mingw_make_build
%install
%cmake_install
%mingw_make_install
%files
%license LICENSE
%doc README.md CHANGELOG.md NOTICE
%{_libdir}/libLerc.so.3
%files devel
%doc doc/*
%{_includedir}/Lerc_c_api.h
%{_includedir}/Lerc_types.h
%{_libdir}/libLerc.so
%{_libdir}/pkgconfig/Lerc.pc
%files -n mingw32-%{name}
%license LICENSE
%{mingw32_bindir}/libLerc-3.dll
%{mingw32_includedir}/Lerc_c_api.h
%{mingw32_includedir}/Lerc_types.h
%{mingw32_libdir}/libLerc.dll.a
%{mingw32_libdir}/pkgconfig/Lerc.pc
%files -n mingw64-%{name}
%license LICENSE
%{mingw64_bindir}/libLerc-3.dll
%{mingw64_includedir}/Lerc_c_api.h
%{mingw64_includedir}/Lerc_types.h
%{mingw64_libdir}/libLerc.dll.a
%{mingw64_libdir}/pkgconfig/Lerc.pc
%changelog
* Fri May 06 2022 Sandro Mani <manisandro@gmail.com> - 3.1-0.1.gitb1de4cd
- Initial package b1de4cd

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (lerc-b1de4cd.tar.gz) = c7dad83b68a39523d35462ef7a0edf659d09605d8233a714a0977cf3dada153b8f113b17f7b80641999ecc205e3ef5be9715d62bf565d09317fbcc61896dda0d