]> git.pld-linux.org Git - packages/crossmipsel-uClibc.git/blob - crossmipsel-uClibc.spec
- added, NFY (doesn't build shared libs)
[packages/crossmipsel-uClibc.git] / crossmipsel-uClibc.spec
1 #
2 %bcond_with     bootstrap       # Build only headers
3 #
4 # TODO:
5 #       - compile for m5307
6 #       - add support for flat shared libraries (-mid-shared-library)
7 #       - make less ugly ?
8
9 %define         llh_version     2.4.31
10
11 Summary:        C library optimized for size (mipsel version)
12 Summary(pl):    Biblioteka C zoptymalizowana na rozmiar (dla mipsel)
13 Name:           crossmipsel-uClibc
14 Version:        0.9.28
15 Release:        1
16 Epoch:          0
17 License:        LGPL
18 Group:          Libraries
19 Source0:        http://www.uclibc.org/downloads/uClibc-%{version}.tar.bz2
20 # Source0-md5:  1ada58d919a82561061e4741fb6abd29
21 Source1:        http://www.uclibc.org/downloads/toolchain/linux-libc-headers-%{llh_version}.tar.bz2
22 # Source1-md5:  997d36627baf6825c712431dee4d79d3
23 Source2:        crossmipsel-uClibc.config
24 URL:            http://www.uclibc.org/
25 %{?!with_bootstrap:BuildRequires:       crossmipsel-gcc}
26 BuildRequires:  sed >= 4.0
27 BuildRequires:  which
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %define         target          mipsel-pld-linux
31 %define         arch            %{_prefix}/%{target}
32
33 %define         _noautostrip    .*%{arch}/lib/.*\\.[ao]$
34
35 %description
36 Small libc for building embedded applications.
37 Version compiled for mipsel.
38
39 %description -l pl
40 Ma³a libc do budowania aplikacji wbudowanych.
41 Wersja dla mipsel.
42
43 %prep
44 %setup -q -n uClibc-%{version} -a1
45
46 install %{SOURCE2} .config
47
48 sed -i "s@^.*KERNEL_SOURCE.*\$@KERNEL_SOURCE=\"$PWD/linux-libc-headers-%{llh_version}\"@"       \
49         .config
50
51 cd linux-libc-headers-%{llh_version}/include/asm-mips
52 grep '#include[[:space:]]\+<asm-mipsel/.\+\.h>' * | cut -f1 -d: | while read file; do
53     cat "../asm-mipsel/$file" > "$file"
54 done
55
56 %build
57 %if %{with bootstrap}
58     %{__make} headers < /dev/null
59 %else
60     _build () {
61         local MULTILIB_SUBDIR=$1
62         local PIC_CODE=$2
63         local COMPILE_FLAGS=$3
64         
65         cat .config     | grep -v "HAVE_SHARED"         > .config.tmp
66         cat .config.tmp | grep -v "BUILD_UCLIBC_LDSO"   > .config
67         
68         if [ $PIC_CODE -ne 0 ]; then
69             sed -i 's/^.*DOPIC.*$/DOPIC=y/'             .config
70             echo "HAVE_SHARED=n"                >>      .config
71         else
72             sed -i 's/^.*DOPIC.*$/# DOPIC is not set/'  .config
73         fi
74
75         %{__make} clean                                         || exit 1
76         %{__make} all   ARCH_CFLAGS="$COMPILE_FLAGS" </dev/null || exit 1
77         
78         install -d              $RPM_BUILD_ROOT%{arch}/lib/$MULTILIB_SUBDIR
79         install lib/*.[ao]      $RPM_BUILD_ROOT%{arch}/lib/$MULTILIB_SUBDIR
80         %{target}-strip --strip-debug -R.comment -R.note        \
81                                 $RPM_BUILD_ROOT%{arch}/lib/$MULTILIB_SUBDIR/*.[ao]
82     }
83
84     rm -rf $RPM_BUILD_ROOT
85     
86                 _build  "mipsel"        0 "-Wall -march=mips32 -mtune=mips32  -nostdinc -mno-split-addresses"
87                 _build  "mipsel"        1 "-Wall -march=mips32 -mtune=mips32  -nostdinc -mno-split-addresses"
88
89 %endif
90
91 %install
92 install -d              $RPM_BUILD_ROOT%{arch}/include
93 cp -RL include/*        $RPM_BUILD_ROOT%{arch}/include
94 ln -s include           $RPM_BUILD_ROOT%{arch}/sys-include
95
96 %clean
97 rm -rf $RPM_BUILD_ROOT
98
99 %files
100 %defattr(644,root,root,755)
101 %doc Changelog* DEDICATION.mjn3 MAINTAINERS README TODO docs/threads.txt
102 %{arch}/include
103 %{arch}/lib
104 %{arch}/sys-include
This page took 0.10829 seconds and 3 git commands to generate.