Add license files to doc section.
[fedora-mingw.git] / bzip2 / mingw32-bzip2.spec
1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
6
7 %define library_version 1.0.4
8
9 # Running the tests requires Wine.
10 %define run_tests 0
11
12 Name:           mingw32-bzip2
13 Version:        1.0.5
14 Release:        5%{?dist}
15 Summary:        MinGW port of bzip2 file compression utility
16
17 License:        BSD
18 Group:          Development/Libraries
19 URL:            http://www.bzip.org/
20 Source0:        http://www.bzip.org/%{version}/bzip2-%{version}.tar.gz
21 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
22
23 BuildArch:      noarch
24
25 Patch0:         bzip2-1.0.4-saneso.patch
26 Patch5:         bzip2-1.0.4-cflags.patch
27 Patch6:         bzip2-1.0.4-bzip2recover.patch
28
29 Patch10:        mingw32-bzip2-1.0.5-slash.patch
30 Patch11:        mingw32-bzip2-1.0.5-dll.patch
31
32 BuildRequires:  mingw32-filesystem >= 26
33 BuildRequires:  mingw32-gcc
34 BuildRequires:  mingw32-binutils
35
36 %if %{run_tests}
37 BuildRequires:  wine
38 %endif
39
40
41 %description
42 Bzip2 is a freely available, patent-free, high quality data compressor.
43 Bzip2 compresses files to within 10 to 15 percent of the capabilities 
44 of the best techniques available.  However, bzip2 has the added benefit 
45 of being approximately two times faster at compression and six times 
46 faster at decompression than those techniques.  Bzip2 is not the 
47 fastest compression utility, but it does strike a balance between speed 
48 and compression capability.
49
50 This package contains development tools and libraries for use when
51 cross-compiling Windows software in Fedora.
52
53
54 %prep
55 %setup -q -n bzip2-%{version}
56
57 %patch0 -p1 -b .saneso
58 %patch5 -p1 -b .cflags
59 %patch6 -p1 -b .bz2recover
60
61 %patch10 -p1 -b .slash
62 %patch11 -p1 -b .dll
63
64
65 %build
66 make -f Makefile-libbz2_so \
67   CC="%{_mingw32_cc}" \
68   AR="%{_mingw32_ar}" \
69   RANLIB="%{_mingw32_ranlib}" \
70   CFLAGS="%{_mingw32_cflags} -D_FILE_OFFSET_BITS=64" \
71   %{?_smp_mflags} all
72
73 rm -f *.o
74 make CC="%{_mingw32_cc}" \
75   AR="%{_mingw32_ar}" \
76   RANLIB="%{_mingw32_ranlib}" \
77   CFLAGS="%{_mingw32_cflags} -D_FILE_OFFSET_BITS=64" \
78   %{?_smp_mflags} \
79 %if %{run_tests}
80   all
81 %else
82   libbz2.a bzip2 bzip2recover
83 %endif
84
85
86 %install
87 rm -rf $RPM_BUILD_ROOT
88 make PREFIX=$RPM_BUILD_ROOT%{_mingw32_prefix} install
89
90 # The binaries which are symlinks contain the full buildroot
91 # name in the symlink, so replace those.
92 pushd $RPM_BUILD_ROOT%{_mingw32_bindir}
93 rm bzcmp bzegrep bzfgrep bzless
94 ln -s bzdiff bzcmp
95 ln -s bzgrep bzegrep
96 ln -s bzgrep bzfgrep
97 ln -s bzmore bzless
98 popd
99
100 # Remove the manpages, they're duplicates of the native package,
101 # and located in the wrong place anyway.
102 rm -rf $RPM_BUILD_ROOT%{_mingw32_prefix}/man
103
104 # The Makefile doesn't install the DLL.
105 # Rename the library so that libtool can find it.
106 install bz2.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}/libbz2.dll.a
107 install bz2-1.dll $RPM_BUILD_ROOT%{_mingw32_bindir}/
108
109 # Remove the static library.
110 rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libbz2.a
111
112
113 %clean
114 rm -rf $RPM_BUILD_ROOT
115
116
117 %files
118 %defattr(-,root,root)
119 %doc LICENSE
120
121 %{_mingw32_bindir}/bz2-1.dll
122 %{_mingw32_libdir}/libbz2.dll.a
123
124 %{_mingw32_bindir}/bunzip2
125 %{_mingw32_bindir}/bzcat
126 %{_mingw32_bindir}/bzcmp
127 %{_mingw32_bindir}/bzdiff
128 %{_mingw32_bindir}/bzegrep
129 %{_mingw32_bindir}/bzfgrep
130 %{_mingw32_bindir}/bzgrep
131 %{_mingw32_bindir}/bzip2
132 %{_mingw32_bindir}/bzip2recover
133 %{_mingw32_bindir}/bzless
134 %{_mingw32_bindir}/bzmore
135
136 %{_mingw32_includedir}/bzlib.h
137
138
139 %changelog
140 * Thu Dec 18 2008 Richard Jones <rjones@redhat.com> - 1.0.5-5
141 - Include the LICENSE file in doc section.
142
143 * Sat Nov 22 2008 Richard Jones <rjones@redhat.com> - 1.0.5-4
144 - Rename the implib as libbz2.dll.a so that libtool can find it.
145
146 * Wed Oct 29 2008 Richard Jones <rjones@redhat.com> - 1.0.5-3
147 - Fix mixed spaces/tabs in specfile.
148
149 * Fri Oct 10 2008 Richard Jones <rjones@redhat.com> - 1.0.5-2
150 - Allow the tests to be disabled selectively.
151
152 * Thu Sep 25 2008 Richard Jones <rjones@redhat.com> - 1.0.5-1
153 - Initial RPM release.