Directories removed - projects have been moved into Fedora.
[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 # The tests take ages to run and require Wine.
8 %define run_tests 0
9
10 Name:           mingw32-pthreads
11 Version:        2.8.0
12 Release:        3%{?dist}
13 Summary:        MinGW pthread library
14
15 %define crazy_version %(echo %{version}|tr . -)
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 Patch2:         mingw32-pthreads-flags.patch
28
29 BuildRequires:  mingw32-filesystem >= 40
30 BuildRequires:  mingw32-gcc
31 BuildRequires:  mingw32-gcc-c++
32 BuildRequires:  mingw32-binutils
33
34 %if %{run_tests}
35 BuildRequires:  wine
36 %endif
37
38
39 %description
40 The POSIX 1003.1-2001 standard defines an application programming
41 interface (API) for writing multithreaded applications. This interface
42 is known more commonly as pthreads. A good number of modern operating
43 systems include a threading library of some kind: Solaris (UI)
44 threads, Win32 threads, DCE threads, DECthreads, or any of the draft
45 revisions of the pthreads standard. The trend is that most of these
46 systems are slowly adopting the pthreads standard API, with
47 application developers following suit to reduce porting woes.
48
49 Win32 does not, and is unlikely to ever, support pthreads
50 natively. This project seeks to provide a freely available and
51 high-quality solution to this problem.
52
53
54 %prep
55 %setup -q -n pthreads-w32-%{crazy_version}-release
56
57 %patch0 -p1
58 %patch1 -p1
59 %patch2 -p1
60
61
62 %build
63 %{_mingw32_make} clean
64 %{_mingw32_make} CROSS=%{_mingw32_host}- GC-inlined
65 %{_mingw32_make} clean
66 %{_mingw32_make} CROSS=%{_mingw32_host}- GCE-inlined
67
68
69 %check
70 %if %{run_tests}
71 pushd tests
72 %{_mingw32_make} clean
73 %{_mingw32_make} QAPC= CC=%{_mingw32_cc} XXCFLAGS="-D__CLEANUP_C" TEST=GC all-pass
74 %{_mingw32_make} clean
75 %{_mingw32_make} QAPC= CC=%{_mingw32_cc} XXCFLAGS="-D__CLEANUP_C" TEST=GCE all-pass
76 popd
77 %endif
78
79
80 %install
81 rm -rf $RPM_BUILD_ROOT
82
83 mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
84 mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
85 mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}/pthread
86
87 install -m 0755 *.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
88 install -m 0644 *.def $RPM_BUILD_ROOT%{_mingw32_bindir}
89 install -m 0644 *.a $RPM_BUILD_ROOT%{_mingw32_libdir}
90 install -m 0644 *.h $RPM_BUILD_ROOT%{_mingw32_includedir}/pthread
91
92
93 %clean
94 rm -rf $RPM_BUILD_ROOT
95
96
97 %files
98 %defattr(-,root,root)
99 %{_mingw32_bindir}/pthreadGC2.dll
100 %{_mingw32_bindir}/pthreadGCE2.dll
101 %{_mingw32_bindir}/pthread.def
102 %{_mingw32_libdir}/libpthreadGC2.a
103 %{_mingw32_libdir}/libpthreadGCE2.a
104 %{_mingw32_includedir}/pthread
105 %doc ANNOUNCE BUGS ChangeLog CONTRIBUTORS COPYING COPYING.LIB
106 %doc FAQ MAINTAINERS NEWS PROGRESS README README.NONPORTABLE TODO
107
108
109 %changelog
110 * Mon Dec 29 2008 Levente Farkas <lfarkas@lfarkas.org> - 2.8.0-3
111 - minor cleanup
112
113 * Fri Oct 10 2008 Richard W.M. Jones <rjones@redhat.com> - 2.8.0-2
114 - Initial RPM release.