commit d9b440350cc0bf3344fd8ef3dc550405e63c5ac5 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:17:17 2019 -0400 Package init diff --git a/Fix-Travis-CI-configuration-for-OSX.patch b/Fix-Travis-CI-configuration-for-OSX.patch new file mode 100644 index 0000000..1950d00 --- /dev/null +++ b/Fix-Travis-CI-configuration-for-OSX.patch @@ -0,0 +1,38 @@ +From e69d9f880677f2aa3488c80b953ec4309f0dfa2e Mon Sep 17 00:00:00 2001 +From: costan +Date: Thu, 4 Jan 2018 14:26:40 -0800 +Subject: [PATCH 03/35] Fix Travis CI configuration for OSX. + +--- + .travis.yml | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/.travis.yml b/.travis.yml +index 9841e9a..8816edb 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -38,10 +38,17 @@ addons: + - clang-4.0 + + install: +-# Travis doesn't have a nice way to install homebrew packages yet. +-# https://github.com/travis-ci/travis-ci/issues/5377 +-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi +-- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install gcc@6; fi ++# Travis doesn't have a DSL for installing homebrew packages yet. Status tracked ++# in https://github.com/travis-ci/travis-ci/issues/5377 ++# The Travis VM image for Mac already has a link at /usr/local/include/c++, ++# causing Homebrew's gcc@6 installation to error out. This was reported to ++# Homebrew maintainers at https://github.com/Homebrew/brew/issues/1742 and ++# removing the link emerged as a workaround. ++- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ++ brew update; ++ if [ -L /usr/local/include/c++ ]; then rm /usr/local/include/c++; fi; ++ brew install gcc@6; ++ fi + # /usr/bin/gcc is stuck to old versions by on both Linux and OSX. + - if [ "$CXX" = "g++" ]; then export CXX="g++-6" CC="gcc-6"; fi + - echo ${CC} +-- +1.8.3.1 + diff --git a/snappy-1.1.7.tar.gz b/snappy-1.1.7.tar.gz new file mode 100644 index 0000000..3ef8371 Binary files /dev/null and b/snappy-1.1.7.tar.gz differ diff --git a/snappy-gtest.patch b/snappy-gtest.patch new file mode 100644 index 0000000..94ad525 --- /dev/null +++ b/snappy-gtest.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -118,7 +118,7 @@ + "${PROJECT_SOURCE_DIR}/snappy-test.cc" + ) + target_compile_definitions(snappy_unittest PRIVATE -DHAVE_CONFIG_H) +- target_link_libraries(snappy_unittest snappy ${GFLAGS_LIBRARIES}) ++ target_link_libraries(snappy_unittest snappy ${GTEST_LIBRARIES} ${GFLAGS_LIBRARIES}) + + if(HAVE_LIBZ) + target_link_libraries(snappy_unittest z) diff --git a/snappy-version-macros.patch b/snappy-version-macros.patch new file mode 100755 index 0000000..c46ef64 --- /dev/null +++ b/snappy-version-macros.patch @@ -0,0 +1,17 @@ +diff --git a/snappy-stubs-public.h.in b/snappy-stubs-public.h.in +index 3fd79bb..bb5b222 100644 +--- a/snappy-stubs-public.h.in ++++ b/snappy-stubs-public.h.in +@@ -48,9 +48,9 @@ + #include + #endif // HAVE_SYS_UIO_H + +-#define SNAPPY_MAJOR ${SNAPPY_MAJOR} +-#define SNAPPY_MINOR ${SNAPPY_MINOR} +-#define SNAPPY_PATCHLEVEL ${SNAPPY_PATCHLEVEL} ++#define SNAPPY_MAJOR ${PROJECT_VERSION_MAJOR} ++#define SNAPPY_MINOR ${PROJECT_VERSION_MINOR} ++#define SNAPPY_PATCHLEVEL ${PROJECT_VERSION_PATCH} + #define SNAPPY_VERSION \ + ((SNAPPY_MAJOR << 16) | (SNAPPY_MINOR << 8) | SNAPPY_PATCHLEVEL) + diff --git a/snappy.pc b/snappy.pc new file mode 100644 index 0000000..6b0ad09 --- /dev/null +++ b/snappy.pc @@ -0,0 +1,10 @@ +prefix=/usr +exec_prefix=${prefix} +includedir=${prefix}/include +libdir=${prefix}/lib64 + +Name: snappy +Description: A fast compression/decompression library +Version: 1.1.7 +Libs: -L\${libdir} -lsnappy +Cflags: -I\${includedir} diff --git a/snappy.spec b/snappy.spec new file mode 100644 index 0000000..253080a --- /dev/null +++ b/snappy.spec @@ -0,0 +1,87 @@ +Name: snappy +Version: 1.1.7 +Release: 9 +Summary: A fast compressor/decompressor +License: BSD +URL: https://github.com/google/snappy +Source0: https://github.com/google/snappy/archive/%{version}/%{name}-%{version}.tar.gz +Source1: snappy.pc + +Patch0: snappy-gtest.patch +Patch1: snappy-version-macros.patch +Patch2: Fix-Travis-CI-configuration-for-OSX.patch + +BuildRequires: gcc-c++ automake autoconf gtest-devel git cmake + +%description +Snappy is a compression/decompression library. It does not aim for maximum compression, +or compatibility with any other compression library; instead, it aims for very high +speeds and reasonable compression. + +%package devel +Summary: Development files for snappy +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: cmake-filesystem pkgconfig + +%description devel +This package is the development files for snappy. + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 -Sgit + +%build +%cmake +%make_build + +%install +rm -rf %{buildroot} +mkdir %{buildroot} +%make_install +install -p -D %{SOURCE1} %{buildroot}%{_libdir}/pkgconfig/snappy.pc + +%check +make test + +%pre + +%preun + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc AUTHORS +%license COPYING +%{_libdir}/libsnappy.so.* + +%files devel +%defattr(-,root,root) +%doc format_*.txt framing_*.txt +%{_includedir}/snappy*.h +%{_libdir}/libsnappy.so +%{_libdir}/pkgconfig/snappy.pc +%{_libdir}/cmake/Snappy/*.cmake + +%files help +%doc NEWS README.md + +%changelog +* Fri Sep 27 2019 shenyangyang - 1.1.7-9 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:move the license + +* Tue Sep 24 2019 shenyangyang - 1.1.7-8 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:add help package + +* Tue Aug 13 2019 openEuler Buildteam - 1.1.7-7 +- Package init