• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name:		bzip2
2Version:	1.0.8
3Release:	6
4Summary:	A high-quality data compressor
5
6License:	BSD
7URL:		https://www.sourceware.org/bzip2/
8Source0:	https://sourceware.org/pub/bzip2/%{name}-%{version}.tar.gz
9Source1:	bzip2.pc
10
11Patch0:		0001-add-compile-option.patch
12Patch1:		0002-CVE-2019-12900.patch
13Patch2:		0003-license-and-version-print-should-output-to-stdout-and-exit-with-code-0.patch
14
15BuildRequires:	gcc
16
17Provides:       bzip2-libs
18Obsoletes:      bzip2-libs
19
20%description
21bzip2 is a freely available, patent free, high-quality data compressor.
22It typically compresses files to within 10% to 15% of the best available
23techniques (the PPM family of statistical compressors), whilst being
24around twice as fast at compression and six times faster at decompression.
25
26%package	devel
27Summary:	header files for bzip2
28Requires:	%{name} = %{version}-%{release}
29Provides:       bzip2-static
30Obsoletes:      bzip2-static
31
32%description	devel
33header files for bzip2
34
35%package_help
36
37%prep
38%autosetup -n %{name}-%{version} -p1
39
40%build
41%if "%toolchain" == "clang"
42%make_build -f Makefile-libbz2_so "CFLAGS=%{optflags} -Winline -fpic -fPIC -D_FILE_OFFSET_BITS=64" CC=clang AR=llvm-ar RANLIB=llvm-ranlib
43%make_build "CFLAGS=%{optflags} -fpic -fPIC -Winline -D_FILE_OFFSET_BITS=64" CC=clang AR=llvm-ar RANLIB=llvm-ranlib
44%else
45%make_build -f Makefile-libbz2_so "CFLAGS=%{optflags} -Winline -fpic -fPIC -D_FILE_OFFSET_BITS=64"
46%make_build "CFLAGS=%{optflags} -fpic -fPIC -Winline -D_FILE_OFFSET_BITS=64"
47%endif
48
49%install
50rm -rf %RPM_BUILD_ROOT
51%if "%toolchain" == "clang"
52%make_install PREFIX=%{buildroot}%{_prefix} CC=clang AR=llvm-ar RANLIB=llvm-ranlib
53%else
54%make_install PREFIX=%{buildroot}%{_prefix}
55%endif
56
57# Default install path is /usr/bin lib man, change dest dirs here.
58pushd %{buildroot}%{_prefix}
59mkdir -p share
60mv man/ share/
61mv lib lib64
62popd
63
64ln -fs bzdiff %{buildroot}%{_bindir}/bzcmp
65ln -fs bzgrep %{buildroot}%{_bindir}/bzegrep
66ln -fs bzgrep %{buildroot}%{_bindir}/bzfgrep
67ln -fs bzmore %{buildroot}%{_bindir}/bzless
68install -m 0755 libbz2.so.%{version}  %{buildroot}%{_libdir}
69ln -s libbz2.so.%{version} %{buildroot}%{_libdir}/libbz2.so.1
70ln -s libbz2.so.1 %{buildroot}%{_libdir}/libbz2.so
71cp %{SOURCE1} .
72sed -i "s@^libdir=@libdir=%{_libdir}@" bzip2.pc
73mkdir -p %{buildroot}%{_libdir}/pkgconfig
74install -m 0644 bzip2.pc %{buildroot}%{_libdir}/pkgconfig/
75ln -s bzip2.1.gz %{buildroot}%{_mandir}/man1/bunzip2.1.gz
76ln -s bzip2.1.gz %{buildroot}%{_mandir}/man1/bzcat.1.gz
77ln -s bzip2.1.gz %{buildroot}%{_mandir}/man1/bzip2recover.1.gz
78
79%check
80make check
81
82%ldconfig_scriptlets
83
84%files
85%defattr(-,root,root)
86%doc CHANGES LICENSE README
87%license LICENSE
88%{_bindir}/*
89%{_libdir}/*.so.*
90
91%files devel
92%defattr(-,root,root)
93%{_includedir}/bzlib.h
94%{_libdir}/*.so
95%{_libdir}/pkgconfig/
96%{_libdir}/*.a
97
98%files help
99%doc manual.html manual.pdf
100%{_mandir}/man1/b*.1.gz
101
102%changelog
103* Thu Apr 13 2023 Chenxi Mao <chenxi.mao@suse.com> - 1.0.8-6
104- Support build with clang.
105
106* Tue Sep 20 2022 zhoupengcheng <zhoupengcheng11@huawei.com> - 1.0.8-5
107- Delete redundant .so files
108
109* Thu Jul 22 2021 wuchaochao <wuchaochao4@huawei.com> - 1.0.8-4
110- Remove BuildRequires gdb
111
112* Sat Mar 21 2020 chengquan<chengquan3@huawei.com> - 1.0.8-3
113- Add fPIC option to make the self-compiled environment build normally
114
115* Wed Mar 11 2020 yangjian<yangjian79.huawei.com> - 1.0.8-2
116- Fix dependency
117
118* Sat Oct 19 2019 openEuler Builteam <buildteam@openeuler.org> - 1.0.8-1
119- update bzip2
120
121* Tue Sep 24 2019 shenyangyang<shenyangyang4@huawei.com> - 1.0.6-33
122- Type:enhancement
123- ID:NA
124- SUG:NA
125- DESC:add help package and combine packages
126
127* Mon Aug 12 2019 openEuler Builteam <buildteam@openeuler.org> - 1.0.6-32
128- rewrite spec
129
130* Thu Jul 25 2019 wangchan<wangchan9@huawei.com> - 1.0.6-31
131- Modify version number
132
133* Tue Jul 16 2019 wangchan<wangchan9@huawei.com> - 1.0.6-30
134- Modify version number
135
136* Mon Jul 15 2019 wangchan<wangchan9@huawei.com> - 1.0.6-29
137- Type:security
138- ID:CVE-2019-12900
139- SUG:restart
140- DESC: fix CVE-2019-12900
141
142* Thu Jul 12 2018 openEuler Builteam <buildteam@openeuler.org>> - 1.0.6-28
143- Package init
144