File ncompress.spec of Package ncompress

#
# spec file for package ncompress
#
# Copyright (c) 2017 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:           ncompress
Version:        4.2.4.4
Release:        0
Summary:        Fast compression and decompression utilities
License:        SUSE-Public-Domain
Group:          Productivity/Archiving/Compression
Url:            http://ncompress.sourceforge.net/
Source:         https://github.com/vapier/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0:         %{name}-4.2.4-make.patch
Patch1:         %{name}-4.2.4.4-lfs2.patch
Patch2:         %{name}-4.2.4.4-filenamelen.patch
Patch3:         %{name}-2GB.patch
Patch6:         %{name}-4.2.4-endians.patch
# gzip provides the uncompress tool in /usr/bin
# we don't provide a link here as this conflicts with gzip
Requires:       gzip
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The ncompress package contains the compress and uncompress file
compression and decompression utilities, which are compatible with the
original UNIX compress utility (.Z file extensions).  These utilities
can't handle gzipped (.gz file extensions) files, but gzip can handle
compressed files.

Install ncompress if you need compression/decompression utilities
which are compatible with the original UNIX compress utility.

%prep
%setup -q
%patch0 -p1
%patch1 -p1 -b .lfs
%patch2 -p1 -b .filenamelen
%patch3 -p1 -b .2GB
%patch6 -p1 -b .endians

%build
export RPM_OPT_FLAGS="%{optflags} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
%ifarch sparc m68k armv4l ppc s390 s390x ppc64 sparc64
export ENDIAN=1234
%else
export ENDIAN=4321
%endif
make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" ENDIAN="$ENDIAN"

%install
install -D -p -m 0755 compress \
  %{buildroot}%{_bindir}/compress
install -D -p -m 0644 compress.1 \
  %{buildroot}%{_mandir}/man1/compress.1

%files
%defattr(-,root,root)
%doc LZW.INFO README
%{_bindir}/compress
%{_mandir}/man1/compress.1%{ext_man}

%changelog
openSUSE Build Service is sponsored by