Add win32-pthreads package.
[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:        1%{?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-binutils
31
32 %if %{run_tests}
33 BuildRequires:  wine
34 %endif
35
36
37 %description
38 The POSIX 1003.1-2001 standard defines an application programming
39 interface (API) for writing multithreaded applications. This interface
40 is known more commonly as pthreads. A good number of modern operating
41 systems include a threading library of some kind: Solaris (UI)
42 threads, Win32 threads, DCE threads, DECthreads, or any of the draft
43 revisions of the pthreads standard. The trend is that most of these
44 systems are slowly adopting the pthreads standard API, with
45 application developers following suit to reduce porting woes.
46
47 Win32 does not, and is unlikely to ever, support pthreads
48 natively. This project seeks to provide a freely available and
49 high-quality solution to this problem.
50
51
52 %prep
53 %setup -q -n pthreads-w32-%{crazy_version}-release
54
55 %patch0 -p1
56 %patch1 -p1
57
58
59 %build
60 make clean
61 make CROSS=%{_mingw32_host}- GC-inlined
62 make CROSS=%{_mingw32_host}- GCE-inlined
63
64
65 %check
66 %if %{run_tests}
67 pushd tests
68 make clean
69 make QAPC= CC=i686-pc-mingw32-gcc XXCFLAGS="-D__CLEANUP_C" TEST=GC all-pass
70 make clean
71 make QAPC= CC=i686-pc-mingw32-gcc XXCFLAGS="-D__CLEANUP_C" TEST=GCE all-pass
72 popd
73 %endif
74
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78
79 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
80 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
81 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}/pthread
82
83 install -m 0755 *.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
84 install -m 0644 *.def $RPM_BUILD_ROOT%{_mingw32_bindir}
85 install -m 0644 *.a $RPM_BUILD_ROOT%{_mingw32_libdir}
86 install -m 0644 *.h $RPM_BUILD_ROOT%{_mingw32_includedir}/pthread
87
88
89 %clean
90 rm -rf $RPM_BUILD_ROOT
91
92
93 %files
94 %defattr(-,root,root)
95 %{_mingw32_bindir}/pthreadGC2.dll
96 %{_mingw32_bindir}/pthreadGCE2.dll
97 %{_mingw32_bindir}/pthread.def
98 %{_mingw32_libdir}/libpthreadGC2.a
99 %{_mingw32_libdir}/libpthreadGCE2.a
100 %{_mingw32_includedir}/pthread
101 %doc ANNOUNCE BUGS ChangeLog CONTRIBUTORS COPYING COPYING.LIB
102 %doc FAQ MAINTAINERS NEWS PROGRESS README README.NONPORTABLE TODO
103
104
105 %changelog
106 * Fri Oct 10 2008 Richard W.M. Jones <rjones@redhat.com> - 2.8.0-1
107 - Initial RPM release.