upgrade upstream version 2.0.0

This commit is contained in:
tanyulong2021 2022-03-22 11:43:41 +08:00
parent 2787d8825d
commit 8d0b047a18
6 changed files with 37 additions and 109 deletions

Binary file not shown.

BIN
CharLS-2.0.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,70 +1,71 @@
Name: CharLS Name: CharLS
Version: 1.0 Version: 2.0.0
Release: 1 Release: 1
Summary: An optimized implementation of the JPEG-LS standard Summary: An optimized implementation of the JPEG-LS standard
License: BSD License: BSD
URL: https://github.com/team-charls/charls URL: https://github.com/team-charls/charls
Source0: https://github.com/team-charls/charls/archive/%{version}.tar.gz Source0: https://github.com/team-charls/charls/archive/%{version}/%{name}-%{version}.tar.gz
Patch0: charls_add_cmake_install_target.patch
Patch1: charls_add_sharedlib_soname.patch BuildRequires: gcc
Patch2: charls_fix_tests.patch BuildRequires: gcc-c++
BuildRequires: gcc BuildRequires: cmake >= 2.6.0
BuildRequires: gcc-c++
BuildRequires: cmake >= 2.6.0
BuildRequires: dos2unix
%description %description
An optimized implementation of the JPEG-LS standard for loss less and An optimized implementation of the JPEG-LS standard for loss less and
near loss less image compression. JPEG-LS is a low-complexity standard that near loss less image compression. JPEG-LS is a low-complexity standard that
matches JPEG 2000 compression ratios. In terms of speed, CharLS outperforms matches JPEG 2000 compression ratios. In terms of speed, CharLS outperforms
open source and commercial JPEG LS implementations. open source and commercial JPEG LS implementations.
JPEG-LS (ISO-14495-1/ITU-T.87) is a standard derived from the Hewlett Packard JPEG-LS (ISO-14495-1/ITU-T.87) is a standard derived from the Hewlett Packard
LOCO algorithm. JPEG LS has low complexity (meaning fast compression) and high LOCO algorithm. JPEG LS has low complexity (meaning fast compression) and high
compression ratios, similar to JPEG 2000. JPEG-LS is more similar to the old compression ratios, similar to JPEG 2000. JPEG-LS is more similar to the old
loss less JPEG than to JPEG 2000, but interestingly the two different techniques loss less JPEG than to JPEG 2000, but interestingly the two different techniques
result in vastly different performance characteristics. result in vastly different performance characteristics.
%package devel
Summary: Libraries and headers for CharLS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
CharLS Library Header Files and Link Libraries.
%prep %prep
%setup -q -n charls-%{version} %autosetup -n charls-%{version}
rm CharLS.vcproj %{__rm} CharLS*.sln* -v
rm CharLS.sln
dos2unix *.h
dos2unix *.c*
dos2unix *.txt
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build %build
%cmake -DBUILD_SHARED_LIBS:BOOL=ON\ %cmake -DBUILD_SHARED_LIBS:BOOL=ON\
-Dcharls_BUILD_SHARED_LIBS:BOOL=ON\ -DCMAKE_BUILD_TYPE:STRING="Release"\
-DCMAKE_BUILD_TYPE:STRING="Release"\ -DCMAKE_VERBOSE_MAKEFILE=ON\
-DCMAKE_VERBOSE_MAKEFILE=ON\ -DBUILD_TESTING=ON
-DBUILD_TESTING=ON .
make %{?_smp_mflags}
%install %install
make install DESTDIR=$RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT
%check %check
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
ctest . ctest .
%ldconfig_scriptlets %ldconfig_scriptlets
%files %files
%license License.txt %license License.txt
%{_libdir}/*.so.* %{_libdir}/lib%{name}.so.2
%{_libdir}/lib%{name}.so.2.0
%package devel
Summary: Libraries and headers for CharLS
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
CharLS Library Header Files and Link Libraries.
%files devel %files devel
%dir %{_includedir}/%{name}/ %dir %{_includedir}/%{name}/
%{_includedir}/%{name}/* %{_includedir}/%{name}/*
%{_libdir}/*.so %{_libdir}/lib%{name}.so
%changelog %changelog
* Tue Mar 22 2022 tanyulong <tanyulong@kylinos.cn> - 2.0.0-1
- upgrade upstream version 2.0.0
* Thu Aug 27 2020 geyanan <geyanan2@huawei.com> - 1.0-1 * Thu Aug 27 2020 geyanan <geyanan2@huawei.com> - 1.0-1
- package init - package init

View File

@ -1,24 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8304f0d..88f0949 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,11 @@ SET(CMAKE_CXX_FLAGS "-D NDEBUG -O3" )
ENDIF(CMAKE_COMPILER_IS_GNUCC)
ENDIF(NOT CMAKE_BUILD_TYPE)
+SET( charls_HEADERS "colortransform.h" "context.h" "decoderstrategy.h" "encoderstrategy.h" "interface.h"
+ "losslesstraits.h" "scan.h" "streams.h" "config.h" "contextrunmode.h" "defaulttraits.h"
+ "header.h" "lookuptable.h" "processline.h" "util.h" "publictypes.h"
+)
+
OPTION(charls_BUILD_SHARED_LIBS "Build CharLS with shared libraries." OFF)
SET(BUILD_SHARED_LIBS ${charls_BUILD_SHARED_LIBS})
@@ -21,3 +26,7 @@ add_library(CharLS header.cpp interface.cpp jpegls.cpp )
add_executable(charlstest test/main.cpp test/time.cpp test/util.cpp test/bitstreamdamage.cpp test/compliance.cpp test/performance.cpp test/dicomsamples.cpp)
target_link_libraries (charlstest CharLS)
+# Installs the header files into the {build_dir}/include/libcharls directory
+install(FILES ${charls_HEADERS} DESTINATION include/CharLS)
+
+

View File

@ -1,36 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 88f0949..c57ef72 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,8 +20,21 @@ SET( charls_HEADERS "colortransform.h" "context.h" "decoderstrategy.h" "encode
OPTION(charls_BUILD_SHARED_LIBS "Build CharLS with shared libraries." OFF)
SET(BUILD_SHARED_LIBS ${charls_BUILD_SHARED_LIBS})
-add_library(CharLS header.cpp interface.cpp jpegls.cpp )
+# Add soname to generated shared lib
+SET(CHARLS_LIB_MAJOR_VERSION 1)
+SET(CHARLS_LIB_MINOR_VERSION 0)
+
+IF(BUILD_SHARED_LIBS)
+ add_library(CharLS SHARED header.cpp interface.cpp jpegls.cpp
+ stdafx.cpp
+ )
+ set_target_properties( CharLS PROPERTIES
+ VERSION ${CHARLS_LIB_MAJOR_VERSION}.${CHARLS_LIB_MINOR_VERSION}
+ SOVERSION ${CHARLS_LIB_MAJOR_VERSION}
+ )
+
+ENDIF(BUILD_SHARED_LIBS)
add_executable(charlstest test/main.cpp test/time.cpp test/util.cpp test/bitstreamdamage.cpp test/compliance.cpp test/performance.cpp test/dicomsamples.cpp)
target_link_libraries (charlstest CharLS)
@@ -29,4 +42,8 @@ target_link_libraries (charlstest CharLS)
# Installs the header files into the {build_dir}/include/libcharls directory
install(FILES ${charls_HEADERS} DESTINATION include/CharLS)
+# Installs the target file (libCharLS.so) into the {build_dir}/lib directory
+install(TARGETS CharLS LIBRARY DESTINATION lib${LIB_SUFFIX})
+
+

View File

@ -1,13 +0,0 @@
diff --git a/defaulttraits.h b/defaulttraits.h
index 5032f7d..734bcea 100644
--- a/defaulttraits.h
+++ b/defaulttraits.h
@@ -2,7 +2,7 @@
// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use.
//
-
+#include "header.h"
#ifndef CHARLS_DEFAULTTRAITS
#define CHARLS_DEFAULTTRAITS