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