Browse Source

initial package creation

Signed-off-by: Toshaan Bharvani <toshaan@powerel.org>
master
Toshaan Bharvani 4 months ago
commit
913f398080
  1. 76
      SOURCES/bzip3-1.2.2-Do-not-use-usr-bin-env-in-shell-bangs.patch
  2. 203
      SPECS/bzip3.spec

76
SOURCES/bzip3-1.2.2-Do-not-use-usr-bin-env-in-shell-bangs.patch

@ -0,0 +1,76 @@ @@ -0,0 +1,76 @@
From 2ace07164157b9a0083da0b19f2876bce288e8fd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 11 Jan 2023 10:39:58 +0100
Subject: [PATCH] Do not use /usr/bin/env in shell bangs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fedora requires system executables to use system executables.
This reverts upstream commit 42d02a5764a4753a7e91933be18fbd3b222beac6.
<https://github.com/kspalaiologos/bzip3/pull/75>.

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
bz3cat | 2 +-
bz3grep | 4 ++--
bz3less | 2 +-
bz3more | 2 +-
bz3most | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bz3cat b/bz3cat
index 4d35bde..a81c66f 100644
--- a/bz3cat
+++ b/bz3cat
@@ -1,3 +1,3 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
exec bzip3 -Bcd "$@"
diff --git a/bz3grep b/bz3grep
index b5d28f1..682e4c9 100644
--- a/bz3grep
+++ b/bz3grep
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
#
# Copyright (c) 2003 Thomas Klausner.
#
@@ -133,4 +133,4 @@ else
set +f
fi
-exit "${EXIT_CODE}"
\ No newline at end of file
+exit "${EXIT_CODE}"
diff --git a/bz3less b/bz3less
index 7627a6e..b008733 100644
--- a/bz3less
+++ b/bz3less
@@ -1,2 +1,2 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
bz3cat "$@" | less
diff --git a/bz3more b/bz3more
index 15f1fea..d0031fc 100644
--- a/bz3more
+++ b/bz3more
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
for FILE
do
diff --git a/bz3most b/bz3most
index fb173e2..624639b 100644
--- a/bz3most
+++ b/bz3most
@@ -1,2 +1,2 @@
-#!/usr/bin/env sh
+#!/usr/bin/sh
bz3cat "$@" | most
--
2.39.0

203
SPECS/bzip3.spec

@ -0,0 +1,203 @@ @@ -0,0 +1,203 @@
Name: bzip3
Version: 1.4.0
Release: 1%{?dist}
Summary: Tools for compressing and decompressing bzip3 files
# bz3grep: BSD-2-Clause
# include/common.h: LGPL-3.0-or-later
# include/libsais.h: Apache-2.0
# include/libbz3.h: LGPL-3.0-or-later
# libsais-LICENSE: Apache-2.0 text
# LICENSE: LGPL-3.0 text
# src/libbz3.c: LGPL-3.0-or-later
# src/main.c: LGPL-3.0-or-later
## Unbundled and not in any binary package
# aclocal.m4: FSFULLR AND GPL-2.0-or-later WITH Autoconf-exception-generic
# build-aux/ax_build_date_epoch.m4: GPL-3.0-or-later WITH Autoconf-exception-macro
# build-aux/ax_pthread.m4: GPL-3.0-or-later WITH Autoconf-exception-macro
# build-aux/ax_check_compile_flag.m4: FSFAP
# build-aux/compile: GPL-2.0-or-later WITH Autoconf-exception-generic
# build-aux/config.guess: GPL-3.0-or-later WITH Autoconf-exception-generic-3.0
# build-aux/config.sub: GPL-3.0-or-later WITH Autoconf-exception-generic-3.0
# build-aux/depcomp: GPL-2.0-or-later WITH Autoconf-exception-generic
# build-aux/git-version-gen: GPL-3.0-or-later
# build-aux/install-sh: X11 AND "FSF changes to this file are in the public domain"
# build-aux/libtool.m4: FSFULLR AND GPL-2.0-or-later WITH Libtool-exception
# AND FSFUL
# build-aux/ltmain.sh: GPL-2.0-or-later WITH Libtool-exception AND
# GPL-3.0-or-later
# build-aux/lt~obsolete.m4 FSFULLR
# build-aux/ltoptions.m4: FSFULLR
# build-aux/ltsugar.m4: FSFULLR
# build-aux/missing: GPL-2.0-or-later WITH Autoconf-exception-generic
# configure: FSFUL AND GPL-2.0-or-later WITH Libtool-exception
# Makefile.in: FSFULLR
## Not used
# include/getopt-shim.h: MIT
License: LGPL-3.0-or-later AND BSD-2-Clause
SourceLicense: GPL-3.0-or-later AND GPL-3.0-or-later WITH Autoconf-exception-macro AND GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 AND GPL-2.0-or-later WITH Autoconf-exception-generic AND GPL-2.0-or-later WITH Libtool-exception AND LGPL-3.0-or-later AND BSD-2-Clause AND Apache-2.0 AND MIT AND X11 AND FSFULLR AND FSFUL AND FSFAP
URL: https://github.com/kspalaiologos/%{name}
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz
# Do not use /usr/bin/env in shell bangs, not suitable for upstream,
# <https://github.com/kspalaiologos/bzip3/pull/75>.
Patch0: bzip3-1.2.2-Do-not-use-usr-bin-env-in-shell-bangs.patch
BuildRequires: autoconf
BuildRequires: autoconf-archive
BuildRequires: automake
BuildRequires: bash
# coreutils for cat, tr in build-aux/git-version-gen
BuildRequires: coreutils
BuildRequires: findutils
# awk in configure.ac, configure, Makefile.in
BuildRequires: gawk
BuildRequires: gcc
# For git-version-gen script executed from autoconf.ac
BuildRequires: gnulib-devel
BuildRequires: libtool
BuildRequires: make
# PKG_PROG_PKG_CONFIG in configure.ac
BuildRequires: pkgconf-pkg-config
# sed in build-aux/git-version-gen
BuildRequires: sed
# Tests:
# md5sum is not helpful
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
# Executed by bz3grep
Requires: grep
# Executed by bz3less
Requires: less
# Executed by bz3more
Requires: util-linux-core
# Executed by bz3most
Requires: most

%description
These are tools for compressing, decompressing, printing, and searching bzip3
files. bzip3 features higher compression ratios and better performance than
bzip2 thanks to an order-0 context mixing entropy coder, a fast
Burrows-Wheeler transform code making use of suffix arrays and a run-length
encoding with Lempel-Ziv prediction pass based on LZ77-style string matching
and PPM-style context modeling.

%package libs
Summary: Shared libraries for bzip3 compression and decompression
License: LGPL-3.0-or-later AND Apache-2.0
# Forked, fixed, and pruned libasais <https://github.com/IlyaGrebnov/libsais>
# because of rejected fix <https://github.com/IlyaGrebnov/libsais/issues/10>.
Provides: bundled(libsais) = 2.7.0

%description libs
This is a library for compressing and decompressing bzip3 compression format.
bzip3 features higher compression ratios and better performance than bzip2
thanks to an order-0 context mixing entropy coder, a fast Burrows-Wheeler
transform code making use of suffix arrays and a run-length encoding with
Lempel-Ziv prediction pass based on LZ77-style string matching and PPM-style
context modeling.

%package devel
Summary: Files for developing with bzip3 library
License: LGPL-3.0-or-later
Requires: %{name}-libs%{?_isa} = %{version}-%{release}

%description devel
Header files, a pkg-config module and link objects for building applications
which use a bzip3 library.

%prep
%autosetup -p1
# Remove generated autoconf files
rm aclocal.m4 configure Makefile.in
# Remove generated manual pages
for F in *.1.in; do
rm "${F%%.in}"
done
# Unbundle autoconf macros and scripts, except those not yet packaged in
# autoconf-archive
find build-aux -type f \! \( \
-name ax_progvar.m4 -o \
-name ax_subst_man_date.m4 -o \
-name ax_subst_transformed_package_name.m4 \
\) -delete
# Execute git-version-gen from a system location
ln -s %{_datadir}/gnulib/build-aux/git-version-gen build-aux/git-version-gen
# Remove unused code
echo > include/getopt-shim.h

%build
autoreconf -vfi
%configure \
--disable-arch-native \
--with-pic \
--with-pthread \
--enable-shared \
--disable-static \
--disable-static-exe
%{make_build}

%check
make check roundtrip %{?_smp_mflags}

%install
%{make_install}
find %{buildroot} -name '*.la' -delete
# Deduplicate identical files
if cmp %{buildroot}%{_mandir}/man1/{bz3cat,bunzip3}.1; then
rm %{buildroot}%{_mandir}/man1/bunzip3.1
ln -s bz3cat.1 %{buildroot}%{_mandir}/man1/bunzip3.1
fi

%files
%define programs \{bunzip3,bz3cat,bz3grep,bz3less,bz3more,bz3most,bzip3\}
%{_bindir}/%{programs}
%{_mandir}/man1/%{programs}.1*

%files libs
%license libsais-LICENSE LICENSE
%doc NEWS README.md
%{_libdir}/libbzip3.so.0{,.*}

%files devel
%{_includedir}/libbz3.h
%{_libdir}/libbzip3.so
%{_libdir}/pkgconfig/bzip3.pc

%changelog
* Tue Jan 09 2024 Petr Pisar <ppisar@redhat.com> - 1.4.0-1
- 1.4.0 bump

* Mon Aug 07 2023 Petr Pisar <ppisar@redhat.com> - 1.3.2-1
- 1.3.2 bump

* Tue Jul 25 2023 Petr Pisar <ppisar@redhat.com> - 1.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Mon May 22 2023 Petr Pisar <ppisar@redhat.com> - 1.3.1-1
- 1.3.1 bump

* Wed Apr 05 2023 Petr Pisar <ppisar@redhat.com> - 1.3.0-1
- 1.3.0 bump (CVE-2023-29415, CVE-2023-29416, CVE-2023-29417, CVE-2023-29418,
CVE-2023-29419, CVE-2023-29420, CVE-2023-29421)

* Mon Mar 27 2023 Petr Pisar <ppisar@redhat.com> - 1.2.3-1
- 1.2.3 bump

* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Wed Jan 11 2023 Petr Pisar <ppisar@redhat.com> - 1.2.2-1
- 1.2.2 bump

* Fri Nov 11 2022 Petr Pisar <ppisar@redhat.com> - 1.2.1-1
- 1.2.1 bump

* Wed Nov 02 2022 Petr Pisar <ppisar@redhat.com> - 1.2.0-3
- Do not own pkg-config directory

* Wed Nov 02 2022 Petr Pisar <ppisar@redhat.com> - 1.2.0-2
- Less globs and and more verbose output in a spec file

* Tue Nov 01 2022 Petr Pisar <ppisar@redhat.com> - 1.2.0-1
- 1.2.0 bump

* Wed Oct 26 2022 Petr Pisar <ppisar@redhat.com> - 1.1.8-1
- 1.1.8 packaged

Loading…
Cancel
Save