Accepting request 433541 from home:bmwiedemann

initial package version 1.1.0
  based on https://pbrady.fedorapeople.org/zstd.spec

  now also building for SLE11
  and with proper release and pkgconfig provides

OBS-URL: https://build.opensuse.org/request/show/433541
OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=1
This commit is contained in:
Martin Pluskal 2016-10-06 07:21:35 +00:00 committed by Git OBS Bridge
commit f3af6e5c41
6 changed files with 174 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
zstd-1.1.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:61cbbd28ff78f658f0564c2ccc206ac1ac6abe7f2c65c9afdca74584a104ea51
size 716327

36
zstd-lib-no-rebuild.patch Normal file
View File

@ -0,0 +1,36 @@
From 230e270552e536c6f54774060003e65c5fd47f6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Mon, 12 Sep 2016 11:35:26 +0100
Subject: [PATCH] separate build, clean, and installation
This is used in the rpm package to allow building the libs and programs in the %build stage,
and installation separated in the %install stage
---
lib/Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/Makefile b/lib/Makefile
index 4fb8ed9..a0be682 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -57,9 +57,9 @@ endif
.PHONY: default all clean install uninstall
-default: clean libzstd
+default: libzstd
-all: clean libzstd
+all: libzstd
libzstd: $(ZSTD_FILES)
@echo compiling static library
@@ -89,7 +89,7 @@ libzstd.pc: libzstd.pc.in
-e 's|@VERSION@|$(VERSION)|' \
$< >$@
-install: libzstd libzstd.pc
+install: libzstd.pc
@install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/
@install -m 755 libzstd.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_VER)
@cp -a libzstd.$(SHARED_EXT_MAJOR) $(DESTDIR)$(LIBDIR)

6
zstd.changes Normal file
View File

@ -0,0 +1,6 @@
-------------------------------------------------------------------
Wed Oct 5 09:03:14 UTC 2016 - bwiedemann@suse.com
- initial package version 1.1.0
based on https://pbrady.fedorapeople.org/zstd.spec

105
zstd.spec Normal file
View File

@ -0,0 +1,105 @@
#
# spec file for package zstd
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: zstd
%define major 1
%define libname lib%{name}%{major}
Version: %{major}.1.0
Release: 0
Summary: Zstandard compression tools
License: BSD-3-Clause and MIT
Group: Productivity/Archiving/Compression
Url: https://github.com/facebook/zstd
Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM -- https://github.com/pixelb/zstd/pull/1
Patch0: zstd-lib-no-rebuild.patch
BuildRequires: gcc
BuildRequires: pkgconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Zstd, short for Zstandard, is a fast lossless compression algorithm,
targeting real-time compression scenarios at zlib-level compression ratio.
Zstd can also offer stronger compression ratios at the cost of compression speed. Speed vs Compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, a property shared by most LZ compression algorithms, such as zlib or lzma.
%package -n %{libname}
Summary: Zstd shared library
Group: Productivity/Archiving/Compression
%description -n %{libname}
Zstandard compression shared library.
%package -n lib%{name}-devel
Summary: Header files for Zstd library
Group: Development/Libraries/C and C++
Requires: lib%{name}%{?_isa} = %{version}-%{release}
%description -n lib%{name}-devel
Header files for Zstd library.
Needed for compiling programs that link with the library.
%prep
%setup -q
find -name .gitignore -delete
%patch0 -p1
%build
for dir in lib programs; do
CFLAGS="%{optflags}" make %{?_smp_mflags} -C "$dir"
done
%check
CFLAGS="%{optflags}" make %{?_smp_mflags} -C tests test-zstd
%install
%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir}
rm %{buildroot}/%{_libdir}/libzstd.a
%files
%defattr(-,root,root,-)
%doc NEWS README.md
%{_bindir}/%{name}
%{_bindir}/un%{name}
%{_bindir}/%{name}cat
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/un%{name}.1*
%{_mandir}/man1/%{name}cat.1*
%doc LICENSE PATENTS
%files -n %{libname}
%defattr(-,root,root,-)
%{_libdir}/libzstd.so.*
%doc LICENSE PATENTS
%files -n lib%{name}-devel
%defattr(-,root,root,-)
%{_includedir}/zbuff.h
%{_includedir}/zdict.h
%{_includedir}/zstd.h
%{_libdir}/pkgconfig/libzstd.pc
%{_libdir}/libzstd.so
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%changelog