Accepting request 266812 from Archiving

- Cleanup a bit.
- Remove the profiling stuff as it should not be used nowdays.
  At least even factory builds without it.
- Provide libbz2.so.1.0 as other distros do, so we can run tiny
  things like steam.
- Respect cflags again, borked by previous commit.

OBS-URL: https://build.opensuse.org/request/show/266812
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/bzip2?expand=0&rev=53
This commit is contained in:
Dominique Leuenberger 2015-01-03 21:00:41 +00:00 committed by Git OBS Bridge
commit 2e17a5b61f
2 changed files with 35 additions and 48 deletions

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Dec 29 16:48:23 UTC 2014 - tchvatal@suse.com
- Cleanup a bit.
- Remove the profiling stuff as it should not be used nowdays.
At least even factory builds without it.
- Provide libbz2.so.1.0 as other distros do, so we can run tiny
things like steam.
- Respect cflags again, borked by previous commit.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Dec 19 11:01:43 UTC 2014 - meissner@suse.com Fri Dec 19 11:01:43 UTC 2014 - meissner@suse.com

View File

@ -16,37 +16,34 @@
# #
%define libname libbz2-1
Name: bzip2 Name: bzip2
Version: 1.0.6 Version: 1.0.6
Release: 0 Release: 0
Url: http://www.bzip.org/
Summary: A Program for Compressing Files Summary: A Program for Compressing Files
License: BSD-3-Clause License: BSD-3-Clause
Group: Productivity/Archiving/Compression Group: Productivity/Archiving/Compression
Url: http://www.bzip.org/
Source: http://www.bzip.org/1.0.6/bzip2-%{version}.tar.gz Source: http://www.bzip.org/1.0.6/bzip2-%{version}.tar.gz
Source1: bznew.gz Source1: bznew.gz
Source2: bznew.1.gz Source2: bznew.1.gz
Source3: baselibs.conf Source3: baselibs.conf
Source100: bzip2-rpmlintrc Source100: bzip2-rpmlintrc
# PATCH-FEATURE-OPENSUSE bzip2-1.0.6-autoconfiscated.patch sbrabec@suse.cz -- Convert to a standard autoconf based package. # PATCH-FEATURE-OPENSUSE bzip2-1.0.6-autoconfiscated.patch sbrabec@suse.cz -- Convert to a standard autoconf based package.
Patch: http://ftp.suse.com/pub/people/sbrabec/bzip2/for_downstream/bzip2-1.0.6-autoconfiscated.patch Patch0: http://ftp.suse.com/pub/people/sbrabec/bzip2/for_downstream/bzip2-1.0.6-autoconfiscated.patch
Patch1: bzip2-1.0.6-fix-bashisms.patch Patch1: bzip2-1.0.6-fix-bashisms.patch
Patch3: bzip2-faster.patch Patch3: bzip2-faster.patch
Patch5: bzip2-unsafe_strcpy.patch Patch5: bzip2-unsafe_strcpy.patch
Patch6: bzip2-point-to-doc-pkg.patch Patch6: bzip2-point-to-doc-pkg.patch
Patch7: bzip2-ocloexec.patch Patch7: bzip2-ocloexec.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf >= 2.57 BuildRequires: autoconf >= 2.57
BuildRequires: libtool BuildRequires: libtool
BuildRequires: pkg-config BuildRequires: pkg-config
# The following is a kludge to get updating bzip2 to after the split work # The following is a kludge to get updating bzip2 to after the split work
PreReq: libbz2-1 PreReq: %{libname}
# bug437293
%ifarch ppc64
Obsoletes: bzip2-64bit
%endif
Provides: bzip = %{version} Provides: bzip = %{version}
Obsoletes: bzip < %{version} Obsoletes: bzip < %{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
The bzip2 program is a very powerful program for compressing files. The bzip2 program is a very powerful program for compressing files.
@ -54,80 +51,61 @@ The bzip2 program is a very powerful program for compressing files.
%package doc %package doc
Summary: The bzip2 program and Library Documentation Summary: The bzip2 program and Library Documentation
Group: Productivity/Archiving/Compression Group: Productivity/Archiving/Compression
%if 0%{?suse_version} >= 1120
BuildArch: noarch BuildArch: noarch
%endif
%description doc %description doc
The bzip2 program and library documentation. The bzip2 program and library documentation.
%package -n libbz2-1 %package -n %{libname}
Summary: The bzip2 runtime library Summary: The bzip2 runtime library
Group: System/Libraries Group: System/Libraries
%description -n libbz2-1 %description -n %{libname}
The bzip2 runtime library The bzip2 runtime library
%package -n libbz2-devel %package -n libbz2-devel
Summary: The bzip2 runtime library development files Summary: The bzip2 runtime library development files
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}
Requires: glibc-devel Requires: glibc-devel
Requires: libbz2-1 = %{version}
%description -n libbz2-devel %description -n libbz2-devel
The bzip2 runtime library development files. The bzip2 runtime library development files.
%prep %prep
%setup -q %setup -q
%patch %patch0
%patch1 -p1 %patch1 -p1
%patch3 %patch3
%patch5 %patch5
%patch6 -p1 %patch6 -p1
%patch7 %patch7
autoreconf -fiv
%build %build
profile_bzip2() export CFLAGS="%{optflags} -fPIE"
{
tmpfile=$(mktemp)
trap "rm -f $tmpfile $tmpfile.bz2" EXIT
tar -cjf $tmpfile.bz2 /usr/src || true
# time ./bzip2 $tmpfile
time ./bzip2 -d < $tmpfile.bz2 > /dev/null
}
autoreconf -fiv
%if %{do_profiling}
export CFLAGS="$RPM_OPT_FLAGS %{cflags_profile_generate}"
%endif
export CFLAGS="$CFLAGS -fPIE"
%configure --with-pic --disable-static %configure --with-pic --disable-static
%if %{do_profiling}
make %{?_smp_mflags} LDFLAGS="-pie"
profile_bzip2
mkdir .libs.save
mv .libs/*.gcda .libs.save/
make clean
mv .libs.save .libs
export CFLAGS="$RPM_OPT_FLAGS %{cflags_profile_feedback}"
export CFLAGS="$CFLAGS -fPIE"
%configure --with-pic --disable-static
%endif
make %{?_smp_mflags} LDFLAGS="-pie" make %{?_smp_mflags} LDFLAGS="-pie"
%install %install
%makeinstall pkgconfigdir=%{_libdir}/pkgconfig make DESTDIR=%{buildroot} install %{?_smp_mflags} pkgconfigdir=%{_libdir}/pkgconfig
gzip -9 manual.ps gzip -9 manual.ps
gzip -dc %{SOURCE1} > bznew gzip -dc %{SOURCE1} > bznew
install -D -m 755 bznew $RPM_BUILD_ROOT%{_bindir}/bznew install -D -m 755 bznew %{buildroot}%{_bindir}/bznew
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man1 install -m 644 %{SOURCE2} %{buildroot}%{_mandir}/man1
rm -vf %{buildroot}%{_libdir}/*.la # Steam and prolly others still use the 1.0 name, so we need to be
# compatible
# Remove this when all distros use the autotools based bzip2 release
ln -s libbz2.so.1 %{buildroot}/%{_libdir}/libbz2.so.1.0
%post -n libbz2-1 -p /sbin/ldconfig find %{buildroot} -type f -name "*.la" -delete -print
%postun -n libbz2-1 -p /sbin/ldconfig %post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
%check %check
make test make %{?_smp_mflags} test
%files %files
%defattr(-,root,root) %defattr(-,root,root)
@ -138,10 +116,9 @@ make test
%defattr(-,root,root) %defattr(-,root,root)
%doc manual.ps.gz manual*.html bzip2.txt manual.pdf %doc manual.ps.gz manual*.html bzip2.txt manual.pdf
%files -n libbz2-1 %files -n %{libname}
%defattr(-,root,root) %defattr(-,root,root)
%{_libdir}/libbz2.so.1 %{_libdir}/libbz2.so.*
%{_libdir}/libbz2.so.1.*
%files -n libbz2-devel %files -n libbz2-devel
%defattr(-,root,root) %defattr(-,root,root)