1 | #define svn_url F:/rd/ports/bzip2/trunk
|
---|
2 | %define svn_url http://svn.netlabs.org/repos/ports/bzip2/trunk
|
---|
3 | %define svn_rev 192
|
---|
4 |
|
---|
5 | Summary: A file compression utility
|
---|
6 | Name: bzip2
|
---|
7 | Version: 1.0.6
|
---|
8 | Release: 6%{?dist}
|
---|
9 | License: BSD
|
---|
10 | Group: Applications/File
|
---|
11 | URL: http://www.bzip.org/
|
---|
12 | Source: %{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip
|
---|
13 |
|
---|
14 | %description
|
---|
15 | Bzip2 is a freely available, patent-free, high quality data compressor.
|
---|
16 | Bzip2 compresses files to within 10 to 15 percent of the capabilities
|
---|
17 | of the best techniques available. However, bzip2 has the added benefit
|
---|
18 | of being approximately two times faster at compression and six times
|
---|
19 | faster at decompression than those techniques. Bzip2 is not the
|
---|
20 | fastest compression utility, but it does strike a balance between speed
|
---|
21 | and compression capability.
|
---|
22 |
|
---|
23 | Install bzip2 if you need a compression utility.
|
---|
24 |
|
---|
25 | %package devel
|
---|
26 | Summary: Header files developing apps which will use bzip2
|
---|
27 | Group: Development/Libraries
|
---|
28 | Requires: bzip2-libs = %{version}-%{release}
|
---|
29 |
|
---|
30 | %description devel
|
---|
31 | Header files and a library of bzip2 functions, for developing apps
|
---|
32 | which will use the library.
|
---|
33 |
|
---|
34 | %package libs
|
---|
35 | Summary: Libraries for applications using bzip2
|
---|
36 | Group: System Environment/Libraries
|
---|
37 |
|
---|
38 | %description libs
|
---|
39 | Libraries for applications using the bzip2 compression format.
|
---|
40 |
|
---|
41 | %debug_package
|
---|
42 |
|
---|
43 | %prep
|
---|
44 | %if %{?svn_rev:%(sh -c 'if test -f "%{_sourcedir}/%{name}-%{version}-r%{svn_rev}.zip" ; then echo 1 ; else echo 0 ; fi')}%{!?svn_rev):0}
|
---|
45 | %setup -q
|
---|
46 | %else
|
---|
47 | %setup -n "%{name}-%{version}" -Tc
|
---|
48 | echo %{svn_rev}
|
---|
49 | svn export %{?svn_rev:-r %{svn_rev}} %{svn_url} . --force
|
---|
50 | rm -f "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip"
|
---|
51 | (cd .. && zip -SrX9 "%{_sourcedir}/%{name}-%{version}%{?svn_rev:-r%{svn_rev}}.zip" "%{name}-%{version}")
|
---|
52 | %endif
|
---|
53 |
|
---|
54 | %build
|
---|
55 |
|
---|
56 | make -f Makefile-libbz2_so CC="%{__cc}" AR="%{__ar}" RANLIB="%{__ranlib}" \
|
---|
57 | CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -fpic -fPIC" \
|
---|
58 | LDFLAGS="-g -Zbin-files -Zhigh-mem -Zdll -Zomf -Zargs-wild -Zargs-resp" \
|
---|
59 | %{?_smp_mflags} dll
|
---|
60 |
|
---|
61 | make CC="%{__cc}" AR="%{__ar}" RANLIB="%{__ranlib}" \
|
---|
62 | CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64" \
|
---|
63 | LDFLAGS="-g -Zbin-files -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp" \
|
---|
64 | %{?_smp_mflags} all
|
---|
65 |
|
---|
66 | %install
|
---|
67 | rm -rf ${RPM_BUILD_ROOT}
|
---|
68 |
|
---|
69 | chmod 644 bzlib.h
|
---|
70 | mkdir -p $RPM_BUILD_ROOT%{_bindir}
|
---|
71 | mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
|
---|
72 | #mkdir -p $RPM_BUILD_ROOT%{_lib}
|
---|
73 | mkdir -p $RPM_BUILD_ROOT%{_libdir}
|
---|
74 | mkdir -p $RPM_BUILD_ROOT%{_includedir}
|
---|
75 | cp -p bzlib.h $RPM_BUILD_ROOT%{_includedir}
|
---|
76 | install -m 755 libbz2.a $RPM_BUILD_ROOT/%{_libdir}
|
---|
77 | install -m 755 bzip2.exe $RPM_BUILD_ROOT%{_bindir}
|
---|
78 | install -m 755 bzip2recover.exe bzgrep bzdiff bzmore $RPM_BUILD_ROOT%{_bindir}/
|
---|
79 | cp -p bzip2.1 bzdiff.1 bzgrep.1 bzmore.1 $RPM_BUILD_ROOT%{_mandir}/man1/
|
---|
80 | cp bzip2.exe $RPM_BUILD_ROOT%{_bindir}/bunzip2.exe
|
---|
81 | cp bzip2.exe $RPM_BUILD_ROOT%{_bindir}/bzcat.exe
|
---|
82 | ln -s bzdiff $RPM_BUILD_ROOT%{_bindir}/bzcmp
|
---|
83 | ln -s bzmore $RPM_BUILD_ROOT%{_bindir}/bzless
|
---|
84 | cp bz2.dll $RPM_BUILD_ROOT/%{_libdir}
|
---|
85 | #ln -s ../../%{_lib}/libbz2.so.1 $RPM_BUILD_ROOT/%{_libdir}/libbz2.so
|
---|
86 | ln -s bzip2.1 $RPM_BUILD_ROOT%{_mandir}/man1/bzip2recover.1
|
---|
87 | ln -s bzip2.1 $RPM_BUILD_ROOT%{_mandir}/man1/bunzip2.1
|
---|
88 | ln -s bzip2.1 $RPM_BUILD_ROOT%{_mandir}/man1/bzcat.1
|
---|
89 | ln -s bzdiff.1 $RPM_BUILD_ROOT%{_mandir}/man1/bzcmp.1
|
---|
90 | ln -s bzmore.1 $RPM_BUILD_ROOT%{_mandir}/man1/bzless.1
|
---|
91 |
|
---|
92 |
|
---|
93 | #%post libs -p /sbin/ldconfig
|
---|
94 |
|
---|
95 | #%postun libs -p /sbin/ldconfig
|
---|
96 |
|
---|
97 | %clean
|
---|
98 | rm -rf ${RPM_BUILD_ROOT}
|
---|
99 |
|
---|
100 | %files
|
---|
101 | %defattr(-,root,root,-)
|
---|
102 | %doc LICENSE CHANGES README
|
---|
103 | %{_bindir}/*
|
---|
104 | %{_mandir}/*/*
|
---|
105 |
|
---|
106 | %files libs
|
---|
107 | %defattr(-,root,root,-)
|
---|
108 | %doc LICENSE
|
---|
109 | %{_libdir}/*.dll
|
---|
110 |
|
---|
111 | %files devel
|
---|
112 | %defattr(-,root,root,-)
|
---|
113 | %doc manual.html manual.pdf
|
---|
114 | %{_includedir}/*
|
---|
115 | %{_libdir}/*.a
|
---|
116 |
|
---|
117 | %changelog
|
---|
118 | * Wed Jun 22 2016 yd <yd@os2power.com> 1.0.6-6
|
---|
119 | - rebuild package, fixes ticket#183.
|
---|
120 | - added debug package.
|
---|