source: rtems/contrib/crossrpms/cygwin/i686/i686-pc-cygwin-ncurses.spec @ ca2531f

4.104.11
Last change on this file since ca2531f was ca2531f, checked in by Ralf Corsepius <ralf.corsepius@…>, on Feb 4, 2010 at 1:53:44 PM

Upgrade to ncurses-5.7-18

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