diff --git a/bzip2-1.0.8-toolchain-variable.patch b/bzip2-1.0.8-toolchain-variable.patch new file mode 100644 index 0000000000000000000000000000000000000000..4d86fe49ddc62bcd667b1e7ab644136cce82a886 --- /dev/null +++ b/bzip2-1.0.8-toolchain-variable.patch @@ -0,0 +1,26 @@ +--- bzip2-1.0.8/Makefile.orig 2024-08-11 20:50:17.297655600 +0800 ++++ bzip2-1.0.8/Makefile 2024-08-11 20:51:08.955480100 +0800 +@@ -15,9 +15,9 @@ + SHELL=/bin/sh + + # To assist in cross-compiling +-CC=gcc +-AR=ar +-RANLIB=ranlib ++CC ?=gcc ++AR ?= ar ++RANLIB ?= ranlib + + # Where you want it installed when you do 'make install' + PREFIX=/usr/local +--- bzip2-1.0.8/Makefile-libbz2_so.orig 2024-08-11 20:56:12.124391600 +0800 ++++ bzip2-1.0.8/Makefile-libbz2_so 2024-08-11 20:57:53.109240100 +0800 +@@ -22,7 +22,7 @@ + + + SHELL=/bin/sh +-CC=gcc ++CC ?= gcc + BIGFILES=-D_FILE_OFFSET_BITS=64 + + OBJS= blocksort.o \ diff --git a/bzip2.spec b/bzip2.spec index 2a6cbe52624f8c8abd5e7068df1a7b2f02b10d73..5d25669f3800a7b65f09d9beb573ecfee5f9c6bd 100644 --- a/bzip2.spec +++ b/bzip2.spec @@ -1,9 +1,9 @@ Name: bzip2 Version: 1.0.8 -Release: 6 +Release: 7 Summary: A high-quality data compressor -License: BSD +License: BSD-4-Clause URL: https://www.sourceware.org/bzip2/ Source0: https://sourceware.org/pub/bzip2/%{name}-%{version}.tar.gz Source1: bzip2.pc @@ -11,11 +11,12 @@ Source1: bzip2.pc Patch0: 0001-add-compile-option.patch Patch1: 0002-CVE-2019-12900.patch Patch2: 0003-license-and-version-print-should-output-to-stdout-and-exit-with-code-0.patch +Patch3: bzip2-1.0.8-toolchain-variable.patch -BuildRequires: gcc +BuildRequires: gcc -Provides: bzip2-libs -Obsoletes: bzip2-libs +Provides: bzip2-libs = %{version}-%{release} +Obsoletes: bzip2-libs < %{version}-%{release} %description bzip2 is a freely available, patent free, high-quality data compressor. @@ -26,8 +27,8 @@ around twice as fast at compression and six times faster at decompression. %package devel Summary: header files for bzip2 Requires: %{name} = %{version}-%{release} -Provides: bzip2-static -Obsoletes: bzip2-static +Provides: bzip2-static = %{version}-%{release} +Obsoletes: bzip2-static < %{version}-%{release} %description devel header files for bzip2 @@ -38,11 +39,12 @@ header files for bzip2 %autosetup -n %{name}-%{version} -p1 %build -%make_build -f Makefile-libbz2_so "CFLAGS=%{optflags} -Winline -fpic -fPIC -D_FILE_OFFSET_BITS=64" -%make_build "CFLAGS=%{optflags} -fpic -fPIC -Winline -D_FILE_OFFSET_BITS=64" +export CFLAGS="%{build_cflags} -Winline -fpic -fPIC -D_FILE_OFFSET_BITS=64" +%set_build_flags +%make_build -f Makefile-libbz2_so +%make_build %install -rm -rf %RPM_BUILD_ROOT %make_install PREFIX=%{buildroot}%{_prefix} # Default install path is /usr/bin lib man, change dest dirs here. @@ -59,28 +61,24 @@ ln -fs bzmore %{buildroot}%{_bindir}/bzless install -m 0755 libbz2.so.%{version} %{buildroot}%{_libdir} ln -s libbz2.so.%{version} %{buildroot}%{_libdir}/libbz2.so.1 ln -s libbz2.so.1 %{buildroot}%{_libdir}/libbz2.so -cp %{SOURCE1} . +cp %{S:1} . sed -i "s@^libdir=@libdir=%{_libdir}@" bzip2.pc mkdir -p %{buildroot}%{_libdir}/pkgconfig install -m 0644 bzip2.pc %{buildroot}%{_libdir}/pkgconfig/ -ln -s bzip2.1.gz %{buildroot}%{_mandir}/man1/bunzip2.1.gz -ln -s bzip2.1.gz %{buildroot}%{_mandir}/man1/bzcat.1.gz -ln -s bzip2.1.gz %{buildroot}%{_mandir}/man1/bzip2recover.1.gz +ln -s bzip2.1 %{buildroot}%{_mandir}/man1/bunzip2.1 +ln -s bzip2.1 %{buildroot}%{_mandir}/man1/bzcat.1 +ln -s bzip2.1 %{buildroot}%{_mandir}/man1/bzip2recover.1 %check -make check - -%ldconfig_scriptlets +%make_build check %files -%defattr(-,root,root) -%doc CHANGES LICENSE README +%doc CHANGES README %license LICENSE %{_bindir}/* %{_libdir}/*.so.* %files devel -%defattr(-,root,root) %{_includedir}/bzlib.h %{_libdir}/*.so %{_libdir}/pkgconfig/ @@ -88,9 +86,13 @@ make check %files help %doc manual.html manual.pdf -%{_mandir}/man1/b*.1.gz +%{_mandir}/man1/* %changelog +* Mon Feb 24 2025 yixiangzhike - 1.0.8-7 +- cleanup spec +- merge clang and gcc declaration + * Mon Oct 31 2022 yanglongkang - 1.0.8-6 - license and version print should output to stdout and exit with code