1 | # |
---|
2 | # Please send bugfixes or comments to |
---|
3 | # http://www.rtems.org/bugzilla |
---|
4 | # |
---|
5 | |
---|
6 | |
---|
7 | %ifos cygwin cygwin32 mingw mingw32 |
---|
8 | %define _exeext .exe |
---|
9 | %define debug_package %{nil} |
---|
10 | %define _libdir %{_exec_prefix}/lib |
---|
11 | %else |
---|
12 | %define _exeext %{nil} |
---|
13 | %endif |
---|
14 | |
---|
15 | %ifos cygwin cygwin32 |
---|
16 | %define optflags -O3 -pipe -march=i486 -funroll-loops |
---|
17 | %endif |
---|
18 | |
---|
19 | %ifos mingw mingw32 |
---|
20 | %if %{defined _mingw32_cflags} |
---|
21 | %define optflags %{_mingw32_cflags} |
---|
22 | %else |
---|
23 | %define optflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields |
---|
24 | %endif |
---|
25 | %endif |
---|
26 | |
---|
27 | %if "%{_build}" != "%{_host}" |
---|
28 | %define _host_rpmprefix %{_host}- |
---|
29 | %else |
---|
30 | %define _host_rpmprefix %{nil} |
---|
31 | %endif |
---|
32 | |
---|
33 | %define w32api_version 3.14-1 |
---|
34 | %define w32api_rpmvers %{expand:%(echo 3.14-1 | tr - _)} |
---|
35 | |
---|
36 | Name: i686-pc-cygwin-w32api |
---|
37 | Release: 0.20100204.0%{?dist} |
---|
38 | License: GPL |
---|
39 | Group: Development/Tools |
---|
40 | |
---|
41 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
42 | BuildArch: noarch |
---|
43 | |
---|
44 | Version: %w32api_rpmvers |
---|
45 | Summary: Cygwin w32api Libraries |
---|
46 | |
---|
47 | Source0: ftp://cygwin.com/pub/cygwin/release/w32api/w32api-%{w32api_version}.tar.bz2 |
---|
48 | %{?_without_sources:NoSource: 0} |
---|
49 | |
---|
50 | %description |
---|
51 | Cygwin w32api libraries. |
---|
52 | |
---|
53 | %prep |
---|
54 | %setup -c -q |
---|
55 | |
---|
56 | %build |
---|
57 | rm -rf i686-pc-cygwin |
---|
58 | |
---|
59 | mkdir -p i686-pc-cygwin |
---|
60 | cp -a usr/lib usr/include i686-pc-cygwin |
---|
61 | |
---|
62 | # Setup sys-root (Usable for gcc >= 3.4) |
---|
63 | mkdir -p i686-pc-cygwin/sys-root |
---|
64 | %{__tar} cf - usr/lib usr/include | ( cd i686-pc-cygwin/sys-root ; %{__tar} xf -) |
---|
65 | |
---|
66 | %install |
---|
67 | rm -rf $RPM_BUILD_ROOT |
---|
68 | mkdir -p $RPM_BUILD_ROOT%{_prefix} |
---|
69 | cp -a i686-pc-cygwin $RPM_BUILD_ROOT%{_prefix} |
---|
70 | |
---|
71 | # Extract %%__os_install_post into os_install_post~ |
---|
72 | cat << \EOF > os_install_post~ |
---|
73 | %__os_install_post |
---|
74 | EOF |
---|
75 | |
---|
76 | # Generate customized brp-*scripts |
---|
77 | cat os_install_post~ | while read a x y; do |
---|
78 | case $a in |
---|
79 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
80 | */brp-strip*) |
---|
81 | b=$(basename $a) |
---|
82 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
83 | chmod a+x $b |
---|
84 | ;; |
---|
85 | esac |
---|
86 | done |
---|
87 | |
---|
88 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
89 | < os_install_post~ > os_install_post |
---|
90 | %define __os_install_post . ./os_install_post |
---|
91 | |
---|
92 | |
---|
93 | cat << EOF > %{_builddir}/%{name}-%{w32api_rpmvers}/find-provides |
---|
94 | #!/bin/sh |
---|
95 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \ |
---|
96 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_provides |
---|
97 | EOF |
---|
98 | chmod +x %{_builddir}/%{name}-%{w32api_rpmvers}/find-provides |
---|
99 | %define __find_provides %{_builddir}/%{name}-%{w32api_rpmvers}/find-provides |
---|
100 | |
---|
101 | cat << EOF > %{_builddir}/%{name}-%{w32api_rpmvers}/find-requires |
---|
102 | #!/bin/sh |
---|
103 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \ |
---|
104 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_requires |
---|
105 | EOF |
---|
106 | chmod +x %{_builddir}/%{name}-%{w32api_rpmvers}/find-requires |
---|
107 | %define __find_requires %{_builddir}/%{name}-%{w32api_rpmvers}/find-requires |
---|
108 | |
---|
109 | %ifnarch noarch |
---|
110 | # Extract %%__debug_install_post into debug_install_post~ |
---|
111 | cat << \EOF > debug_install_post~ |
---|
112 | %__debug_install_post |
---|
113 | EOF |
---|
114 | |
---|
115 | # Generate customized debug_install_post script |
---|
116 | cat debug_install_post~ | while read a x y; do |
---|
117 | case $a in |
---|
118 | # Prevent find-debuginfo.sh* from trying to handle foreign binaries |
---|
119 | */find-debuginfo.sh) |
---|
120 | b=$(basename $a) |
---|
121 | sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b |
---|
122 | chmod a+x $b |
---|
123 | ;; |
---|
124 | esac |
---|
125 | done |
---|
126 | |
---|
127 | sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \ |
---|
128 | < debug_install_post~ > debug_install_post |
---|
129 | %define __debug_install_post . ./debug_install_post |
---|
130 | |
---|
131 | %endif |
---|
132 | |
---|
133 | %clean |
---|
134 | rm -rf $RPM_BUILD_ROOT |
---|
135 | |
---|
136 | %files |
---|
137 | %defattr(-,root,root,-) |
---|
138 | %dir %{_prefix}/i686-pc-cygwin |
---|
139 | %{_prefix}/i686-pc-cygwin/lib |
---|
140 | %{_prefix}/i686-pc-cygwin/include |
---|
141 | |
---|
142 | %package sys-root |
---|
143 | Group: Development/Tools |
---|
144 | Summary: i686-pc-cygwin target files for gcc >= 3.4 |
---|
145 | |
---|
146 | %description sys-root |
---|
147 | i686-pc-cygwin target files for gcc >= 3.4 |
---|
148 | |
---|
149 | %files sys-root |
---|
150 | %defattr(-,root,root,-) |
---|
151 | %dir %{_prefix}/i686-pc-cygwin |
---|
152 | %{_prefix}/i686-pc-cygwin/sys-root |
---|
153 | |
---|
154 | |
---|