Initial commit

This commit is contained in:
Tulio Magno Quites Machado Filho 2020-10-27 23:16:32 -03:00 committed by Tulio Magno Quites Machado Filho
commit 5cbb04c91d
3 changed files with 128 additions and 0 deletions

31
libnxz.so.patch Normal file
View File

@ -0,0 +1,31 @@
From 92e5664e863b8a84e4cf5673e75fbd0c0fc0a8f5 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Date: Tue, 27 Oct 2020 22:02:12 -0300
Subject: [PATCH] Install libnxz.so as symlink
The symlink libnxz.so is important when developing programs that link
specifically to libnxz, i.e. via -lnxz.
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
lib/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/Makefile b/lib/Makefile
index 3cb3a7c..5813c79 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -36,7 +36,9 @@ clean:
install: $(STATICLIB) $(SHAREDLIB)
install -d $(LIBDIR)
install -m 755 $(SHAREDLIB) $(LIBDIR)
- install -m 755 $(SHAREDSONAMELIB) $(LIBDIR)
+ { cd $(LIBDIR); \
+ ln -s $(SHAREDLIB) $(SHAREDSONAMELIB); \
+ ln -s $(SHAREDLIB) $(LIBLINK); }
install -m 644 $(STATICLIB) $(LIBDIR)
uninstall:
--
2.25.4

69
libnxz.spec Normal file
View File

@ -0,0 +1,69 @@
Name: libnxz
Version: 0.61
Release: 0%{?dist}
Summary: Zlib implementation for POWER processors
License: ASL 2.0
Url: https://github.com/libnxz/power-gzip
BuildRequires: zlib-devel
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: rm-git.patch
Patch1: libnxz.so.patch
# Be explicit about the soname in order to avoid unintentional changes.
%global soname libnxz.so.0.61
ExclusiveArch: ppc64le
BuildRequires: gcc
%description
libnxz is a zlib-compatible library that uses the NX GZIP Engine available on
POWER9 or newer processors in order to provide a faster zlib/gzip compression
without using the general-purpose cores.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains header files for developing application that
use %{name}.
%package static
Summary: Static library for %{name} development
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description static
The %{name}-static package contains static libraries for developing
application that use %{name}.
%prep
%autosetup -p1 -n power-gzip-%{version}
%build
%make_build FLG="-std=gnu11 %{build_cflags} "
%check
# libnxz tests only work on P9 servers or newer, bare metal, with
# Linux >= 5.8. This combination is not guaranteed to have at build time,
# forcing us to disable the tests.
%install
make install PREFIX="%{buildroot}%{_prefix}" LIBDIR="%{buildroot}%{_libdir}"
%files
%{_libdir}/%{soname}
%{_libdir}/libnxz.so.0
%license licenses/APACHE-2.0.txt
%doc README.md
%files devel
%{_includedir}/libnxz.h
%{_libdir}/libnxz.so
%files static
%{_libdir}/libnxz.a
%changelog
* Tue Oct 27 2020 Tulio Magno Quites Machado Filho <tuliom@ascii.art.br> - 0.61-0
- Initial packaging

28
rm-git.patch Normal file
View File

@ -0,0 +1,28 @@
From 9a6ff0c71ab6c06c660c760ad0acb9691655d1a0 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Date: Tue, 27 Oct 2020 21:42:38 -0300
Subject: [PATCH] Stop depending on git when building
Replace the git command with the current version.
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
lib/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Makefile b/lib/Makefile
index cc996dc..3cb3a7c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -5,7 +5,7 @@ SRCS = nx_inflate.c nx_deflate.c nx_zlib.c nx_crc.c nx_dht.c nx_dhtgen.c nx_dht_
OBJS = nx_inflate.o nx_deflate.o nx_zlib.o nx_crc.o nx_dht.o nx_dhtgen.o nx_dht_builtin.o \
nx_adler32.o gzip_vas.o nx_compress.o nx_uncompr.o crc32_ppc.o crc32_ppc_asm.o nx_utils.o
-VERSION ?= $(shell git describe --tags | cut -d - -f 1,2 | tr - . | cut -c 2-)
+VERSION ?= 0.61
SOVERSION = $(shell echo $(VERSION) | cut -d . -f 1)
PACKAGENAME = libnxz
STATICLIB = $(PACKAGENAME).a
--
2.25.4