summaryrefslogtreecommitdiffstats
path: root/mingw32-pthreads.spec
blob: ac6f1fea0b0c49e1b501369fdbd619105a0b98c0 (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
%define __strip %{_mingw32_strip}
%define __objdump %{_mingw32_objdump}
%define _use_internal_dependency_generator 0
%define __find_requires %{_mingw32_findrequires}
%define __find_provides %{_mingw32_findprovides}

# The tests take ages to run and require Wine.
%define run_tests 0
%define prerelease_date 20110511

Name:           mingw32-pthreads
Version:        2.8.0
Release:        15.%{prerelease_date}cvs%{?dist}
Summary:        MinGW pthread library

%define crazy_version %(echo %{version}|tr . -)

License:        LGPLv2+
Group:          Development/Libraries
URL:            http://sourceware.org/pthreads-win32/
# cvs -d :pserver:anoncvs@sourceware.org:/cvs/pthreads-win32 login
# cvs -d :pserver:anoncvs@sourceware.org:/cvs/pthreads-win32 export -D 2011-05-11 -d pthreads-w32-20110511 pthreads
# tar cjf pthreads-w32-20110511.tar.bz2 pthreads-w32-20110511
Source0:        pthreads-w32-%{prerelease_date}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch

Patch0:         mingw32-pthreads-2.8.0-20110511-use-wine-for-tests.patch
Patch1:         mingw32-pthreads-2.8.0-20110511-no-failing-tests.patch
Patch2:         mingw32-pthreads-flags.patch

BuildRequires:  mingw32-filesystem >= 49
BuildRequires:  mingw32-gcc
BuildRequires:  mingw32-gcc-c++
BuildRequires:  mingw32-binutils

%if %{run_tests}
BuildRequires:  wine
%endif


%description
The POSIX 1003.1-2001 standard defines an application programming
interface (API) for writing multithreaded applications. This interface
is known more commonly as pthreads. A good number of modern operating
systems include a threading library of some kind: Solaris (UI)
threads, Win32 threads, DCE threads, DECthreads, or any of the draft
revisions of the pthreads standard. The trend is that most of these
systems are slowly adopting the pthreads standard API, with
application developers following suit to reduce porting woes.

Win32 does not, and is unlikely to ever, support pthreads
natively. This project seeks to provide a freely available and
high-quality solution to this problem.


%prep
%setup -q -n pthreads-w32-%{prerelease_date}

%patch0 -p1
%patch1 -p1
%patch2 -p1


%build
%{_mingw32_make} clean
%{_mingw32_make} CROSS=%{_mingw32_host}- GC-inlined
%{_mingw32_make} clean
%{_mingw32_make} CROSS=%{_mingw32_host}- GCE-inlined


%check
%if %{run_tests}
pushd tests
%{_mingw32_make} clean
%{_mingw32_make} QAPC= \
  CC=%{_mingw32_cc} XXCFLAGS="-D__CLEANUP_C" TEST=GC all-pass
%{_mingw32_make} clean
%{_mingw32_make} QAPC= \
  CC=%{_mingw32_cc} XXCFLAGS="-D__CLEANUP_C" TEST=GCE all-pass
popd
%endif


%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}

install -m 0755 *.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
install -m 0644 *.def $RPM_BUILD_ROOT%{_mingw32_bindir}
install -m 0644 *.a $RPM_BUILD_ROOT%{_mingw32_libdir}

install -m 0644 pthread.h $RPM_BUILD_ROOT%{_mingw32_includedir}
install -m 0644 sched.h $RPM_BUILD_ROOT%{_mingw32_includedir}
install -m 0644 semaphore.h $RPM_BUILD_ROOT%{_mingw32_includedir}

# Create a symlink from libpthreadGC2.a to libpthread.a because of BZ #498616
ln -s libpthreadGC2.a $RPM_BUILD_ROOT%{_mingw32_libdir}/libpthread.a


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%doc ANNOUNCE BUGS ChangeLog CONTRIBUTORS COPYING COPYING.LIB
%doc FAQ MAINTAINERS NEWS PROGRESS README README.NONPORTABLE TODO
%{_mingw32_bindir}/pthreadGC2.dll
%{_mingw32_bindir}/pthreadGCE2.dll
%{_mingw32_bindir}/pthread.def
%{_mingw32_libdir}/libpthread.a
%{_mingw32_libdir}/libpthreadGC2.a
%{_mingw32_libdir}/libpthreadGCE2.a
%{_mingw32_includedir}/*.h


%changelog
* Thu May 12 2011 Kalev Lember <kalev@smartlink.ee> - 2.8.0-15.20110511cvs
- Update to 2011-05-11 cvs snapshot
- Dropped upstreamed mingw32-pthreads-2.8.0-w32.patch

* Thu May 12 2011 Kalev Lember <kalev@smartlink.ee> - 2.8.0-14
- Don't install private headers, most notably config.h

* Fri Apr 22 2011 Kalev Lember <kalev@smartlink.ee> - 2.8.0-13
- Rebuilt for pseudo-reloc version mismatch (#698827)

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Mon Nov 16 2009 Levente Farkas <lfarkas@lfarkas.org> - 2.8.0-11
- add comment about mingw32-pthreads-2.8.0-w32.patch

* Sun Nov 15 2009 Levente Farkas <lfarkas@lfarkas.org> - 2.8.0-10
- added mingw32-pthreads-2.8.0-w32.patch

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Fri May 22 2009 Erik van Pienbroek <epienbro@fedoraproject.org> - 2.8.0-8
- Create a symlink from libpthreadGC2.a to libpthread.a because of BZ #498616

* Fri Mar 13 2009 Richard W.M. Jones <rjones@redhat.com> - 2.8.0-7
- Move header files to system include directory.

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.8.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Feb 20 2009 Richard W.M. Jones <rjones@redhat.com> - 2.8.0-5
- Rebuild for mingw32-gcc 4.4

* Tue Jan 13 2009 Richard W.M. Jones <rjones@redhat.com> - 2.8.0-4
- Cleanup to the spec file, no functional changes.

* Mon Dec 29 2008 Levente Farkas <lfarkas@lfarkas.org> - 2.8.0-3
- minor cleanup

* Fri Oct 10 2008 Richard W.M. Jones <rjones@redhat.com> - 2.8.0-2
- Initial RPM release.