source: rtems/contrib/crossrpms/cygwin/i686/i686-pc-cygwin-zlib.spec @ d179db7

4.104.115
Last change on this file since d179db7 was d179db7, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/04/10 at 14:18:13

Upgrade to zlib-1.2.3-10.

  • 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 zlib_version 1.2.3-10
34%define zlib_rpmvers %{expand:%(echo 1.2.3-10 | tr - _)}
35
36Name:         i686-pc-cygwin-zlib
37Release:      0.20100204.0%{?dist}
38License:      GPL
39Group:        Development/Tools
40
41BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
42BuildArch:      noarch
43
44Version:        %zlib_rpmvers
45Summary:        Cygwin zlib Libraries
46
47Source0:        ftp://cygwin.com/pub/cygwin/release/zlib/zlib-%{zlib_version}.tar.bz2
48Source1:        ftp://cygwin.com/pub/cygwin/release/zlib/zlib-devel/zlib-devel-%{zlib_version}.tar.bz2
49Source2:        ftp://cygwin.com/pub/cygwin/release/zlib/zlib0/zlib0-%{zlib_version}.tar.bz2
50%{?_without_sources:NoSource:   0}
51%{?_without_sources:NoSource:   1}
52%{?_without_sources:NoSource:   2}
53
54%description
55Cygwin zlib libraries.
56
57%prep
58%setup -c -q
59
60%build
61  rm -rf i686-pc-cygwin
62
63  # Setup sys-root (Usable for gcc >= 3.4)
64  mkdir -p i686-pc-cygwin/sys-root
65  ( cd i686-pc-cygwin/sys-root ; %{__tar} xvjf %{SOURCE0})
66  ( cd i686-pc-cygwin/sys-root ; %{__tar} xvjf %{SOURCE1})
67  ( cd i686-pc-cygwin/sys-root ; %{__tar} xvjf %{SOURCE2})
68
69%install
70  rm -rf $RPM_BUILD_ROOT
71  mkdir -p $RPM_BUILD_ROOT%{_prefix}
72  cp -a i686-pc-cygwin $RPM_BUILD_ROOT%{_prefix}
73
74
75# Extract %%__os_install_post into os_install_post~
76cat << \EOF > os_install_post~
77%__os_install_post
78EOF
79
80# Generate customized brp-*scripts
81cat os_install_post~ | while read a x y; do
82case $a in
83# Prevent brp-strip* from trying to handle foreign binaries
84*/brp-strip*)
85  b=$(basename $a)
86  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
87  chmod a+x $b
88  ;;
89esac
90done
91
92sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
93< os_install_post~ > os_install_post
94%define __os_install_post . ./os_install_post
95
96
97cat << EOF > %{_builddir}/%{name}-%{zlib_rpmvers}/find-provides
98#!/bin/sh
99grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \
100  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_provides
101EOF
102chmod +x %{_builddir}/%{name}-%{zlib_rpmvers}/find-provides
103%define __find_provides %{_builddir}/%{name}-%{zlib_rpmvers}/find-provides
104
105cat << EOF > %{_builddir}/%{name}-%{zlib_rpmvers}/find-requires
106#!/bin/sh
107grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \
108  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_requires
109EOF
110chmod +x %{_builddir}/%{name}-%{zlib_rpmvers}/find-requires
111%define __find_requires %{_builddir}/%{name}-%{zlib_rpmvers}/find-requires
112
113%ifnarch noarch
114# Extract %%__debug_install_post into debug_install_post~
115cat << \EOF > debug_install_post~
116%__debug_install_post
117EOF
118
119# Generate customized debug_install_post script
120cat debug_install_post~ | while read a x y; do
121case $a in
122# Prevent find-debuginfo.sh* from trying to handle foreign binaries
123*/find-debuginfo.sh)
124  b=$(basename $a)
125  sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
126  chmod a+x $b
127  ;;
128esac
129done
130
131sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
132< debug_install_post~ > debug_install_post
133%define __debug_install_post . ./debug_install_post
134
135%endif
136
137%clean
138  rm -rf $RPM_BUILD_ROOT
139
140%files
141%defattr(-,root,root,-)
142%dir %{_prefix}/i686-pc-cygwin
143%{_prefix}/i686-pc-cygwin/sys-root
144
145
Note: See TracBrowser for help on using the repository browser.