source: rtems/contrib/crossrpms/netbsd5.0.2/i386/i386-pc-netbsdelf5.0.2-libs.spec @ 447de8f3

4.104.11
Last change on this file since 447de8f3 was 447de8f3, checked in by Ralf Corsepius <ralf.corsepius@…>, on Apr 19, 2010 at 2:19:21 PM

Regenerate.

  • Property mode set to 100644
File size: 4.4 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 netbsd_version 5.0.2
34%define netbsd_rpmvers %{expand:%(echo 5.0.2 | tr - _)}
35
36%define _use_internal_dependency_generator 0
37%define __debug_install_post %{nil}
38
39Name:           i386-pc-netbsdelf5.0.2
40Release:        0.20100419.1%{?dist}
41License:        NetBSD
42Group:          Development/Tools
43
44BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
45BuildArch:      noarch
46
47Version:        %netbsd_rpmvers
48Summary:        i386-pc-netbsdelf5.0.2 Libraries
49
50Source0:        ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/i386/binary/sets/base.tgz
51Source1:        ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.2/i386/binary/sets/comp.tgz
52
53%description
54i386-pc-netbsdelf5.0.2 libraries.
55
56%prep
57%setup -q -c -T -n %{name}-%{version} -a 0 -a 1
58
59%build
60  # Setup sys-root (Usable for gcc >= 3.4)
61  mkdir -p i386-pc-netbsdelf5.0.2/sys-root
62  %{__tar} cf - lib usr/lib usr/include | ( cd i386-pc-netbsdelf5.0.2/sys-root ; %{__tar} xf -)
63
64  pushd i386-pc-netbsdelf5.0.2/sys-root/usr/lib > /dev/null
65  # missing files
66  rm -f lib*_p.*
67  # not needed
68  rm -rf aout compat
69
70  # Fix up symlinks
71  find -type l -exec ls -l {} \; | \
72    while read a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aA ; do \
73    case $aA in
74    /lib* ) # link
75       rm $a8;
76       b=`basename $aA`
77       ln -s ../../lib/$b $a8
78       ;;
79    esac
80  done
81  popd > /dev/null
82
83%install
84  rm -rf $RPM_BUILD_ROOT
85  mkdir -p $RPM_BUILD_ROOT%{_prefix}
86  cp -a i386-pc-netbsdelf5.0.2 $RPM_BUILD_ROOT%{_prefix}
87
88# Extract %%__os_install_post into os_install_post~
89cat << \EOF > os_install_post~
90%__os_install_post
91EOF
92
93# Generate customized brp-*scripts
94cat os_install_post~ | while read a x y; do
95case $a in
96# Prevent brp-strip* from trying to handle foreign binaries
97*/brp-strip*)
98  b=$(basename $a)
99  sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b
100  chmod a+x $b
101  ;;
102esac
103done
104
105sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \
106< os_install_post~ > os_install_post
107%define __os_install_post . ./os_install_post
108
109
110cat << EOF > %{_builddir}/%{name}-%{netbsd_rpmvers}/find-provides
111#!/bin/sh
112grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.0.2/(lib|include|sys-root)' \
113  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.2/'} | %__find_provides
114EOF
115chmod +x %{_builddir}/%{name}-%{netbsd_rpmvers}/find-provides
116%define __find_provides %{_builddir}/%{name}-%{netbsd_rpmvers}/find-provides
117
118cat << EOF > %{_builddir}/%{name}-%{netbsd_rpmvers}/find-requires
119#!/bin/sh
120grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/i386-pc-netbsdelf5.0.2/(lib|include|sys-root)' \
121  %{?_gcclibdir:| grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/i386-pc-netbsdelf5.0.2/'} | %__find_requires
122EOF
123chmod +x %{_builddir}/%{name}-%{netbsd_rpmvers}/find-requires
124%define __find_requires %{_builddir}/%{name}-%{netbsd_rpmvers}/find-requires
125
126%ifnarch noarch
127# Extract %%__debug_install_post into debug_install_post~
128cat << \EOF > debug_install_post~
129%__debug_install_post
130EOF
131
132# Generate customized debug_install_post script
133cat debug_install_post~ | while read a x y; do
134case $a in
135# Prevent find-debuginfo.sh* from trying to handle foreign binaries
136*/find-debuginfo.sh)
137  b=$(basename $a)
138  sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b
139  chmod a+x $b
140  ;;
141esac
142done
143
144sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \
145< debug_install_post~ > debug_install_post
146%define __debug_install_post . ./debug_install_post
147
148%endif
149
150%clean
151  rm -rf $RPM_BUILD_ROOT
152
153%package sys-root
154Group: Development/Tools
155Summary: i386-pc-netbsdelf5.0.2 target files for gcc >= 3.4
156
157%description sys-root
158i386-pc-netbsdelf5.0.2 target files for gcc >= 3.4
159
160%files sys-root
161%defattr(-,root,root,-)
162%dir %{_prefix}/i386-pc-netbsdelf5.0.2
163%{_prefix}/i386-pc-netbsdelf5.0.2/sys-root
Note: See TracBrowser for help on using the repository browser.