source: rtems/contrib/crossrpms/cygwin/i686/i686-pc-cygwin-w32api.spec @ facca98

4.104.11
Last change on this file since facca98 was facca98, checked in by Ralf Corsepius <ralf.corsepius@…>, on May 7, 2009 at 2:40:22 PM

New.

  • Property mode set to 100644
File size: 3.9 KB
Line 
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.12-1
34%define w32api_rpmvers %{expand:%(echo 3.12-1 | tr - _)}
35
36Name:         i686-pc-cygwin-w32api
37Release:      0.20090506.1%{?dist}
38License:      GPL
39Group:        Development/Tools
40
41BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
42BuildArch:      noarch
43
44Version:        %w32api_rpmvers
45Summary:        Cygwin w32api Libraries
46
47Source0:        ftp://cygwin.com/pub/cygwin/release/w32api/w32api-%{w32api_version}.tar.bz2
48%{?_without_sources:NoSource:   0}
49
50%description
51Cygwin 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~
72cat << \EOF > os_install_post~
73%__os_install_post
74EOF
75
76# Generate customized brp-*scripts
77cat os_install_post~ | while read a x y; do
78case $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  ;;
85esac
86done
87
88sed -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
93cat << EOF > %{_builddir}/%{name}-%{w32api_rpmvers}/find-provides
94#!/bin/sh
95grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \
96  | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/i686-pc-cygwin/' | %__find_provides
97EOF
98chmod +x %{_builddir}/%{name}-%{w32api_rpmvers}/find-provides
99%define __find_provides %{_builddir}/%{name}-%{w32api_rpmvers}/find-provides
100
101cat << EOF > %{_builddir}/%{name}-%{w32api_rpmvers}/find-requires
102#!/bin/sh
103grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \
104  | grep -v '^${RPM_BUILD_ROOT}%{gcclib}/i686-pc-cygwin/' | %__find_requires
105EOF
106chmod +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~
111cat << \EOF > debug_install_post~
112%__debug_install_post
113EOF
114
115# Generate customized debug_install_post script
116cat debug_install_post~ | while read a x y; do
117case $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  ;;
124esac
125done
126
127sed -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
143Group: Development/Tools
144Summary: i686-pc-cygwin target files for gcc >= 3.4
145
146%description sys-root
147i686-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
Note: See TracBrowser for help on using the repository browser.