--- /dev/null
+diff --git a/Makefile.am b/Makefile.am
+index c93a82e..74d7e26 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -9,7 +9,6 @@ ACLOCAL_AMFLAGS = -I build/autoconf
+ lib_LTLIBRARIES= libarchive.la
+ noinst_LTLIBRARIES= libarchive_fe.la
+ bin_PROGRAMS= $(bsdtar_programs) $(bsdcpio_programs) $(bsdcat_programs)
+-man_MANS= $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS) $(bsdcat_man_MANS)
+ BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h cat/test/list.h
+
+ #
+@@ -287,57 +286,12 @@ endif
+ libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION)
+ libarchive_la_LIBADD= $(LTLIBICONV)
+
+-# Manpages to install
+-libarchive_man_MANS= \
+- libarchive/archive_entry.3 \
+- libarchive/archive_entry_acl.3 \
+- libarchive/archive_entry_linkify.3 \
+- libarchive/archive_entry_misc.3 \
+- libarchive/archive_entry_paths.3 \
+- libarchive/archive_entry_perms.3 \
+- libarchive/archive_entry_stat.3 \
+- libarchive/archive_entry_time.3 \
+- libarchive/archive_read.3 \
+- libarchive/archive_read_add_passphrase.3 \
+- libarchive/archive_read_data.3 \
+- libarchive/archive_read_disk.3 \
+- libarchive/archive_read_extract.3 \
+- libarchive/archive_read_filter.3 \
+- libarchive/archive_read_format.3 \
+- libarchive/archive_read_free.3 \
+- libarchive/archive_read_header.3 \
+- libarchive/archive_read_new.3 \
+- libarchive/archive_read_open.3 \
+- libarchive/archive_read_set_options.3 \
+- libarchive/archive_util.3 \
+- libarchive/archive_write.3 \
+- libarchive/archive_write_blocksize.3 \
+- libarchive/archive_write_data.3 \
+- libarchive/archive_write_disk.3 \
+- libarchive/archive_write_filter.3 \
+- libarchive/archive_write_finish_entry.3 \
+- libarchive/archive_write_format.3 \
+- libarchive/archive_write_free.3 \
+- libarchive/archive_write_header.3 \
+- libarchive/archive_write_new.3 \
+- libarchive/archive_write_open.3 \
+- libarchive/archive_write_set_options.3 \
+- libarchive/archive_write_set_passphrase.3 \
+- libarchive/cpio.5 \
+- libarchive/libarchive.3 \
+- libarchive/libarchive_changes.3 \
+- libarchive/libarchive_internals.3 \
+- libarchive/libarchive-formats.5 \
+- libarchive/mtree.5 \
+- libarchive/tar.5
+-
+ # Additional libarchive files to include in the distribution
+ libarchive_EXTRA_DIST= \
+ libarchive/archive_windows.c \
+ libarchive/archive_windows.h \
+ libarchive/filter_fork_windows.c \
+- libarchive/CMakeLists.txt \
+- $(libarchive_man_MANS)
++ libarchive/CMakeLists.txt
+
+ # pkgconfig
+ pkgconfigdir = $(libdir)/pkgconfig
+@@ -1031,10 +985,8 @@ bsdtar_EXTRA_DIST= \
+
+
+ if BUILD_BSDTAR
+-bsdtar_man_MANS= tar/bsdtar.1
+ bsdtar_programs= bsdtar
+ else
+-bsdtar_man_MANS=
+ bsdtar_programs=
+ endif
+
+@@ -1197,10 +1149,8 @@ bsdcpio_EXTRA_DIST= \
+
+ if BUILD_BSDCPIO
+ # Manpages to install
+-bsdcpio_man_MANS= cpio/bsdcpio.1
+ bsdcpio_programs= bsdcpio
+ else
+-bsdcpio_man_MANS=
+ bsdcpio_programs=
+ endif
+
+@@ -1348,10 +1298,8 @@ bsdcat_EXTRA_DIST= \
+
+ if BUILD_BSDCAT
+ # Manpages to install
+-bsdcat_man_MANS= cat/bsdcat.1
+ bsdcat_programs= bsdcat
+ else
+-bsdcat_man_MANS=
+ bsdcat_programs=
+ endif
+
--- /dev/null
+Name: libarchive
+Version: 3.5.2
+Release: 0
+License: BSD-2-Clause
+Summary: A library for handling streaming archive formats
+Url: https://github.com/libarchive/libarchive
+Group: System/Libraries
+Source0: https://github.com/libarchive/libarchive/archive/refs/tags/v%{version}.tar.gz
+Source1001: libarchive.manifest
+Source1002: disable_man_info.patch
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: bison
+BuildRequires: bzip2-devel
+BuildRequires: libacl-devel
+BuildRequires: libattr-devel
+BuildRequires: libtool
+BuildRequires: zlib-devel
+BuildRequires: pkgconfig(ext2fs)
+BuildRequires: pkgconfig(liblzma)
+BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(openssl1.1)
+
+%description
+Libarchive is a programming library that can create and read several different
+streaming archive formats, including most popular tar variants, several cpio
+formats, and both BSD and GNU ar variants. It can also write shar archives and
+read ISO9660 CDROM images and ZIP archives.
+
+%package tools
+Summary: Tools based on %{name}
+Requires: %{name} = %{version}
+
+%description tools
+Tools based on %{name}.
+
+%package devel
+Summary: Development files for %{name}
+Requires: %{name} = %{version}
+
+%description devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+%prep
+%setup -q
+cp %{SOURCE1001} .
+%{__patch} -p1 < %{SOURCE1002}
+
+%build
+%global optflags %{optflags} -D_REENTRANT -pipe
+export CFLAGS+=" -fPIC"
+export CXXFLAGS+=" -fPIC"
+export LDFLAGS+=" -pie"
+autoreconf -fi
+%configure --disable-static --enable-bsdcpio
+%__make %{?_smp_mflags}
+
+%install
+%make_install
+
+find %{buildroot} -name cpio.5 -exec rm -f {} ';'
+find %{buildroot} -name mtree.5 -exec rm -f {} ';'
+find %{buildroot} -name tar.5 -exec rm -f {} ';'
+
+%check
+# %__make check
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest %{name}.manifest
+%license COPYING
+%defattr(-,root,root,-)
+%{_libdir}/*.so.*
+
+
+%files devel
+%manifest %{name}.manifest
+%defattr(-,root,root,-)
+%{_includedir}/*
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/libarchive.pc
+
+%files tools
+%manifest %{name}.manifest
+%license COPYING
+%{_bindir}/bsdcpio
+%{_bindir}/bsdtar
+%{_bindir}/bsdcat
+