bzip2/bzip2.spec

218 lines
7.0 KiB
RPMSpec
Raw Permalink Normal View History

%define libname libbzip2
Name: bzip2
Version: 1.0.8
Release: 4mamba
Summary: Extremely powerful file compression utility
Group: Applications/Archiving
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.bzip.org/
Source: git://sourceware.org/git/bzip2.git/bzip2-%{version}/bzip2-%{version}.tar.bz2
Source1: bzip2.pc
Patch0: %{name}-1.0.6-cflags.patch
Patch1: %{name}-1.0.6-makefiles.patch
Patch4: %{name}-1.0.3-cross_compiling.patch
Patch5: %{name}-1.0.6-bzip2recover_strncpy.patch
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
## AUTOBUILDREQ-END
License: BSD
Requires: %{libname} = %{?epoch:%epoch:}%{version}-%{release}
%description
Bzip2 compresses files using the Burrows-Wheeler block-sorting text compression algorithm, and Huffman coding.
Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors.
The command-line options are deliberately very similar to those of GNU Gzip, but they are not identical.
%package -n %{libname}
Summary: Libraries for developing apps which will use bzip2
Group: System/Libraries
%ifarch x86_64
Obsoletes: lib32-libbzip2
%endif
%description -n %{libname}
Library of bzip2 functions, for developing apps which will use the bzip2 library (aka libz2).
%package -n %{libname}-devel
Summary: Header files for developing apps which will use bzip2
Group: Development/Libraries
Requires: %{libname} = %{?epoch:%epoch:}%{version}-%{release}
%description -n %{libname}-devel
Header files and static library of bzip2 functions, for developing apps which will use the bzip2 library (aka libz2).
%debug_package
%prep
%setup -q
#% patch0 -p1 -b .cflags
#% patch1 -p1 -b .makefiles
%if "%{_target_platform}" != "%{_build}"
%patch4 -p1 -b .cross_compiling
%endif
#% patch5 -p1 -b bzip2recover_strncpy
# x86_64 lib64 support
sed -i "s@/lib\(/\| \|$\)@/%{_lib}\1@g" Makefile Makefile-libbz2_so
%build
%make all -f Makefile-libbz2_so \
CFLAGS="%{optflags} -D_FILE_OFFSET_BITS=64 -fpic -fPIC" \
CC=%{_target_platform}-gcc \
AR=%{_target_platform}-ar \
RANLIB=%{_target_platform}-ranlib
#rm -f *.o
%make \
CFLAGS="%{optflags} -D_FILE_OFFSET_BITS=64" \
CC=%{_target_platform}-gcc \
AR=%{_target_platform}-ar \
RANLIB=%{_target_platform}-ranlib
%install
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
make install PREFIX=%{buildroot}%{_prefix}
install -m0755 bzip2-shared %{buildroot}%{_bindir}/bzip2
rm -f %{buildroot}%{_bindir}/{bunzip2,bzcat}
ln -s bzip2 %{buildroot}%{_bindir}/bunzip2
ln -s bzip2 %{buildroot}%{_bindir}/bzcat
rm -f %{buildroot}%{_bindir}/bzcmp
ln -s bzdiff %{buildroot}%{_bindir}/bzcmp
rm -f %{buildroot}%{_bindir}/bzless
ln -s bzmore %{buildroot}%{_bindir}/bzless
install -d -m0755 %{buildroot}%{_datadir}
mv %{buildroot}%{_prefix}/man %{buildroot}%{_datadir}/
ln -s bzip2.1 %{buildroot}%{_mandir}/man1/bzip2recover.1
ln -s bzip2.1 %{buildroot}%{_mandir}/man1/bunzip2.1
ln -s bzip2.1 %{buildroot}%{_mandir}/man1/bzcat.1
#rm -f %{buildroot}%{_mandir}/man1/bzless.1
#ln -s bzmore.1 %{buildroot}%{_mandir}/man1/bzless.1
# fix broken symlinks
ln -sf bzgrep %{buildroot}%{_bindir}/bzegrep
ln -sf bzgrep %{buildroot}%{_bindir}/bzfgrep
install -D -m0755 libbz2.so.%{version} %{buildroot}%{_libdir}/libbz2.so.%{version}
ln -s libbz2.so.1.0 %{buildroot}%{_libdir}/libbz2.so
ln -s libbz2.so.%{version} %{buildroot}%{_libdir}/libbz2.so.1.0
install -D -m0644 %{SOURCE1} %{buildroot}%{_libdir}/pkgconfig/bzip2.pc
sed "s|@VERSION@|%{version}|" -i %{buildroot}%{_libdir}/pkgconfig/bzip2.pc
sed "s|@LIB@|%{_lib}|" -i %{buildroot}%{_libdir}/pkgconfig/bzip2.pc
%clean
[ "%{buildroot}" != / ] && rm -rf %{buildroot}
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/bunzip2
%{_bindir}/bzcat
%{_bindir}/bzcmp
%{_bindir}/bzdiff
%{_bindir}/bzegrep
%{_bindir}/bzfgrep
%{_bindir}/bzgrep
%{_bindir}/bzip2
%{_bindir}/bzip2recover
%{_bindir}/bzless
%{_bindir}/bzmore
%{_mandir}/man1/bunzip2.*
%{_mandir}/man1/bzcat.*
%{_mandir}/man1/bzcmp.*
%{_mandir}/man1/bzdiff.*
%{_mandir}/man1/bzegrep.*
%{_mandir}/man1/bzfgrep.*
%{_mandir}/man1/bzgrep.*
%{_mandir}/man1/bzip2.*
%{_mandir}/man1/bzip2recover.*
%{_mandir}/man1/bzless.*
%{_mandir}/man1/bzmore.*
%files -n %{libname}
%defattr(-,root,root)
%{_libdir}/libbz2.so.*
%doc LICENSE
%files -n %{libname}-devel
%defattr(-,root,root)
%{_includedir}/bzlib.h
%{_libdir}/libbz2.a
%{_libdir}/libbz2.so
%{_libdir}/pkgconfig/bzip2.pc
%doc CHANGES README README.XML.STUFF
%changelog
* Fri Mar 26 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.8-4mamba
- remove /bin symlinks to /usr/bin
* Thu Mar 25 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.8-3mamba
- added pkg-config file and debug package
* Thu Jan 16 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.8-2mamba
- x86_64: obsolete lib32-libbzip2
* Fri Aug 02 2019 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.8-1mamba
- update to 1.0.8
* Sun Aug 19 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.6-3mamba
- fix requirements of subpackages to match exact version and release
- added build requirements
- move documentation files to devel package
* Sun Feb 13 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.6-2mamba
- don't remove object files during two make or it will build libbz2 without -fpic
* Fri Sep 24 2010 Davide Madrisan <davide.madrisan@gmail.com> 1.0.6-1mamba
- update to 1.0.6
* Tue Mar 18 2008 Aleph0 <aleph0@openmamba.org> 1.0.5-1mamba
- update to 1.0.5 (Security fix against CERT-FI 20469)
* Tue Sep 18 2007 Aleph0 <aleph0@openmamba.org> 1.0.4-1mamba
- update to 1.0.4 (fixes CAN-2005-0758, CAN-2005-0953)
- make bzcmp a symlink to bzdiff
- add manpages (just symlinks) for bunzip2, bzcat, and bzip2recover
- fix buffer overflow in bzip2recover
- remove bzip2-1.0.2-chmod.patch (merged upstream)
* Wed Feb 15 2006 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.3-6qilnx
- working fix: libbz2 is now a PIC library
* Mon Feb 06 2006 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.3-5qilnx
- compile libbz2 using the flags "-fpic -fPIC"
* Thu Sep 22 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.3-4qilnx
- security fix QSA-2005-109 (CAN-2005-0758)
* Wed Sep 14 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 1.0.3-3qilnx
- add cross platform build support
* Fri May 27 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.3-2qilnx
- security fix QSA-2005-068 (CAN-2005-0953)
* Wed Mar 02 2005 Davide Madrisan <davide.madrisan@qilinux.it> 1.0.3-1qilnx
- update to version 1.0.3 by autospec
- bzless is now a symlinks to bzmore
- added basic documentation
- specfile cleanups
* Sat Apr 26 2003 Silvan Calarco <silvan.calarco@qinet.it>
- moved files from /bin to %{_bindir}, made symlinks to /bin
* Tue Apr 08 2003 Mirko Cortillaro <mirko.cortillaro@qinet.it>
- write a spec file for bzip2