summaryrefslogtreecommitdiffstats
path: root/cygwin-bzip2.spec
blob: 9dfadda05222393f2ec456e526adeb4795ba92b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
%define __strip %{_cygwin_strip}
%define __objdump %{_cygwin_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_cygwin_findrequires}
%define __find_provides %{_cygwin_findprovides}

# Running the tests requires Wine.
%define run_tests 0

Name:           cygwin-bzip2
Version:        1.0.6
Release:        1%{?dist}
Summary:        Cygwin port of bzip2 file compression utility

License:        BSD
Group:          Development/Libraries
URL:            http://www.bzip.org/
Source0:        http://www.bzip.org/%{version}/bzip2-%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch

Patch6:         bzip2-1.0.4-bzip2recover.patch
Patch11:        bzip2-1.0.6-cygwin-dll.patch

BuildRequires:  cygwin-filesystem
BuildRequires:  cygwin-binutils
BuildRequires:  cygwin-gcc
BuildRequires:  cygwin

%if %{run_tests}
BuildRequires:  wine
%endif


%description
Bzip2 is a freely available, patent-free, high quality data compressor.
Bzip2 compresses files to within 10 to 15 percent of the capabilities 
of the best techniques available.  However, bzip2 has the added benefit 
of being approximately two times faster at compression and six times 
faster at decompression than those techniques.  Bzip2 is not the 
fastest compression utility, but it does strike a balance between speed 
and compression capability.

This package contains development tools and libraries for use when
cross-compiling Cygwin software in Fedora.


%prep
%setup -q -n bzip2-%{version}

%patch6 -p1 -b .bz2recover
%patch11 -p1 -b .dll


%build
make -f Makefile-libbz2_so \
  CC="%{_cygwin_cc}" \
  AR="%{_cygwin_ar}" \
  RANLIB="%{_cygwin_ranlib}" \
  CFLAGS="%{_cygwin_cflags} -D_FILE_OFFSET_BITS=64" \
  %{?_smp_mflags} all

rm -f *.o
make CC="%{_cygwin_cc}" \
  AR="%{_cygwin_ar}" \
  RANLIB="%{_cygwin_ranlib}" \
  CFLAGS="%{_cygwin_cflags} -D_FILE_OFFSET_BITS=64" \
  %{?_smp_mflags} \
%if %{run_tests}
  all
%else
  libbz2.a bzip2 bzip2recover
%endif


%install
rm -rf $RPM_BUILD_ROOT
make PREFIX=$RPM_BUILD_ROOT%{_cygwin_prefix} install

# The binaries which are symlinks contain the full buildroot
# name in the symlink, so replace those.
pushd $RPM_BUILD_ROOT%{_cygwin_bindir}
rm bzcmp bzegrep bzfgrep bzless
ln -s bzdiff bzcmp
ln -s bzgrep bzegrep
ln -s bzgrep bzfgrep
ln -s bzmore bzless
popd

# Remove the manpages, they're duplicates of the native package,
# and located in the wrong place anyway.
rm -rf $RPM_BUILD_ROOT%{_cygwin_prefix}/man

# The Makefile doesn't install the DLL.
install -m0755 cygbz2-1.dll $RPM_BUILD_ROOT%{_cygwin_bindir}/
install -m0644 libbz2.dll.a $RPM_BUILD_ROOT%{_cygwin_libdir}/

# Remove the static library.
rm $RPM_BUILD_ROOT%{_cygwin_libdir}/libbz2.a


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc LICENSE
%{_cygwin_bindir}/cygbz2-1.dll
%{_cygwin_includedir}/bzlib.h
%{_cygwin_libdir}/libbz2.dll.a
%{_cygwin_bindir}/bunzip2
%{_cygwin_bindir}/bzcat
%{_cygwin_bindir}/bzcmp
%{_cygwin_bindir}/bzdiff
%{_cygwin_bindir}/bzegrep
%{_cygwin_bindir}/bzfgrep
%{_cygwin_bindir}/bzgrep
%{_cygwin_bindir}/bzip2
%{_cygwin_bindir}/bzip2recover
%{_cygwin_bindir}/bzless
%{_cygwin_bindir}/bzmore


%changelog
* Wed Mar 16 2011 Yaakov Selkowitz <cygwin-ports-general@lists.sourceforge.net> - 1.0.6-1
- Initial spec file, largely based on mingw32-bzip2.