[facca98] | 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 | |
---|
[ca2531f] | 33 | %define ncurses_version 5.7-18 |
---|
| 34 | %define ncurses_rpmvers %{expand:%(echo 5.7-18 | tr - _)} |
---|
[facca98] | 35 | |
---|
| 36 | Name: i686-pc-cygwin-ncurses |
---|
[ca2531f] | 37 | Release: 0.20100204.0%{?dist} |
---|
[facca98] | 38 | License: GPL |
---|
| 39 | Group: Development/Tools |
---|
| 40 | |
---|
| 41 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) |
---|
| 42 | BuildArch: noarch |
---|
| 43 | |
---|
| 44 | Version: %ncurses_rpmvers |
---|
| 45 | Summary: Cygwin ncurses Libraries |
---|
| 46 | |
---|
| 47 | Source0: ftp://cygwin.com/pub/cygwin/release/ncurses/ncurses-%{ncurses_version}.tar.bz2 |
---|
[ca2531f] | 48 | Source1: ftp://cygwin.com/pub/cygwin/release/ncurses/libncurses10/libncurses10-%{ncurses_version}.tar.bz2 |
---|
[facca98] | 49 | Source2: ftp://cygwin.com/pub/cygwin/release/ncurses/libncurses-devel/libncurses-devel-%{ncurses_version}.tar.bz2 |
---|
| 50 | |
---|
| 51 | BuildRequires: i686-pc-cygwin-terminfo |
---|
| 52 | |
---|
| 53 | Provides: i686-pc-cygwin-libncurses-devel = %{version}-%{release} |
---|
| 54 | Provides: i686-pc-cygwin-ncurses-devel = %{version}-%{release} |
---|
| 55 | Requires: i686-pc-cygwin-terminfo |
---|
| 56 | |
---|
| 57 | %description |
---|
| 58 | Cygwin 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~ |
---|
| 84 | cat << \EOF > os_install_post~ |
---|
| 85 | %__os_install_post |
---|
| 86 | EOF |
---|
| 87 | |
---|
| 88 | # Generate customized brp-*scripts |
---|
| 89 | cat os_install_post~ | while read a x y; do |
---|
| 90 | case $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 | ;; |
---|
| 97 | esac |
---|
| 98 | done |
---|
| 99 | |
---|
| 100 | sed -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 | |
---|
| 105 | cat << EOF > %{_builddir}/%{name}-%{ncurses_rpmvers}/find-provides |
---|
| 106 | #!/bin/sh |
---|
| 107 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \ |
---|
[4668c7fe] | 108 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_provides |
---|
[facca98] | 109 | EOF |
---|
| 110 | chmod +x %{_builddir}/%{name}-%{ncurses_rpmvers}/find-provides |
---|
| 111 | %define __find_provides %{_builddir}/%{name}-%{ncurses_rpmvers}/find-provides |
---|
| 112 | |
---|
| 113 | cat << EOF > %{_builddir}/%{name}-%{ncurses_rpmvers}/find-requires |
---|
| 114 | #!/bin/sh |
---|
| 115 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i686-pc-cygwin/(lib|include|sys-root)' \ |
---|
[4668c7fe] | 116 | %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i686-pc-cygwin/'} | %__find_requires |
---|
[facca98] | 117 | EOF |
---|
| 118 | chmod +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~ |
---|
| 123 | cat << \EOF > debug_install_post~ |
---|
| 124 | %__debug_install_post |
---|
| 125 | EOF |
---|
| 126 | |
---|
| 127 | # Generate customized debug_install_post script |
---|
| 128 | cat debug_install_post~ | while read a x y; do |
---|
| 129 | case $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 | ;; |
---|
| 136 | esac |
---|
| 137 | done |
---|
| 138 | |
---|
| 139 | sed -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 | |
---|