Rename implibs as lib*.dll.a for compatibility with libtool
[fedora-mingw.git] / pthreads / mingw32-pthreads.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 crazy_version 2-8-0
8
9 # The tests take ages to run and require Wine.
10 %define run_tests 0
11
12 Name:           mingw32-pthreads
13 Version:        2.8.0
14 Release:        2%{?dist}
15 Summary:        MinGW pthread library
16
17 License:        LGPLv2+
18 Group:          Development/Libraries
19 URL:            http://sourceware.org/pthreads-win32/
20 Source0:        ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-%{crazy_version}-release.tar.gz
21 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
22
23 BuildArch:      noarch
24
25 Patch0:         mingw32-pthreads-2.8.0-use-wine-for-tests.patch
26 Patch1:         mingw32-pthreads-2.8.0-no-failing-tests.patch
27
28 BuildRequires:  mingw32-filesystem >= 30
29 BuildRequires:  mingw32-gcc
30 BuildRequires:  mingw32-gcc-c++
31 BuildRequires:  mingw32-binutils
32
33 %if %{run_tests}
34 BuildRequires:  wine
35 %endif
36
37
38 %description
39 The POSIX 1003.1-2001 standard defines an application programming
40 interface (API) for writing multithreaded applications. This interface
41 is known more commonly as pthreads. A good number of modern operating
42 systems include a threading library of some kind: Solaris (UI)
43 threads, Win32 threads, DCE threads, DECthreads, or any of the draft
44 revisions of the pthreads standard. The trend is that most of these
45 systems are slowly adopting the pthreads standard API, with
46 application developers following suit to reduce porting woes.
47
48 Win32 does not, and is unlikely to ever, support pthreads
49 natively. This project seeks to provide a freely available and
50 high-quality solution to this problem.
51
52
53 %prep
54 %setup -q -n pthreads-w32-%{crazy_version}-release
55
56 %patch0 -p1
57 %patch1 -p1
58
59
60 %build
61 make clean
62 make CROSS=%{_mingw32_host}- GC-inlined
63 make CROSS=%{_mingw32_host}- GCE-inlined
64
65
66 %check
67 %if %{run_tests}
68 pushd tests
69 make clean
70 make QAPC= CC=i686-pc-mingw32-gcc XXCFLAGS="-D__CLEANUP_C" TEST=GC all-pass
71 make clean
72 make QAPC= CC=i686-pc-mingw32-gcc XXCFLAGS="-D__CLEANUP_C" TEST=GCE all-pass
73 popd
74 %endif
75
76
77 %install
78 rm -rf $RPM_BUILD_ROOT
79
80 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
81 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
82 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}/pthread
83
84 install -m 0755 *.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
85 install -m 0644 *.def $RPM_BUILD_ROOT%{_mingw32_bindir}
86 install -m 0644 *.a $RPM_BUILD_ROOT%{_mingw32_libdir}
87 install -m 0644 *.h $RPM_BUILD_ROOT%{_mingw32_includedir}/pthread
88
89
90 %clean
91 rm -rf $RPM_BUILD_ROOT
92
93
94 %files
95 %defattr(-,root,root)
96 %{_mingw32_bindir}/pthreadGC2.dll
97 %{_mingw32_bindir}/pthreadGCE2.dll
98 %{_mingw32_bindir}/pthread.def
99 %{_mingw32_libdir}/libpthreadGC2.a
100 %{_mingw32_libdir}/libpthreadGCE2.a
101 %{_mingw32_includedir}/pthread
102 %doc ANNOUNCE BUGS ChangeLog CONTRIBUTORS COPYING COPYING.LIB
103 %doc FAQ MAINTAINERS NEWS PROGRESS README README.NONPORTABLE TODO
104
105
106 %changelog
107 * Fri Oct 10 2008 Richard W.M. Jones <rjones@redhat.com> - 2.8.0-2
108 - Initial RPM release.