]> git.pld-linux.org Git - packages/klibc.git/blob - klibc.spec
- updated to 1.2 (stable).
[packages/klibc.git] / klibc.spec
1 #
2 # Conditional build:
3 %bcond_without  dist_kernel     # build without distribution kernel-headers
4 #
5 Summary:        Minimalistic libc subset for use with initramfs
6 Summary(pl):    Zminimalizowany podzbiór biblioteki C do u¿ywania z initramfs
7 Name:           klibc
8 Version:        1.2
9 Release:        1
10 License:        BSD/GPL
11 Group:          Libraries
12 #Source0:       http://www.kernel.org/pub/linux/libs/klibc/Testing/%{name}-%{version}.tar.bz2
13 Source0:        http://www.kernel.org/pub/linux/libs/klibc/%{name}-%{version}.tar.bz2
14 # Source0-md5:  7068f3d33c041a096267c6c9eafe61a6
15 Patch0:         %{name}-klcc.patch
16 Patch1:         %{name}-kill_interp_sohash.patch
17 Patch2:         %{name}-ash-fix-mktemp-syntax.patch
18 URL:            http://www.zytor.com/mailman/listinfo/klibc/
19 %{?with_dist_kernel:BuildRequires:      kernel-headers >= 2.4}
20 BuildRequires:  bison
21 BuildRequires:  flex
22 BuildRequires:  rpmbuild(macros) >= 1.153
23 BuildRequires:  perl-base
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %define         no_install_post_strip   1
27
28 %description
29 klibc, what is intended to be a minimalistic libc subset for use with
30 initramfs. It is deliberately written for small size, minimal
31 entaglement and portability, not speed. It is definitely a work in
32 progress, and a lot of things are still missing.
33
34 %description -l pl
35 klibc w zamierzeniu ma byæ minimalistycznym podzbiorem biblioteki libc
36 do u¿ycia z initramfs. Celem jest minimalizacja, przeno¶no¶æ ale nie
37 szybko¶æ. klibc jest rozwijan± bibliotek± w zwi±zku z czym nadal
38 brakuje wielu rzeczy.
39
40 %package devel
41 Summary:        Development files for klibc
42 Summary(pl):    Pliki dla programistów klibc
43 Group:          Development/Libraries
44 Requires:       %{name} = %{version}-%{release}
45 Requires:       binutils
46 %{?with_dist_kernel:Requires:   kernel-headers >= 2.4}
47
48 %description devel
49 Small libc for building embedded applications - development files.
50
51 %description devel -l pl
52 Ma³a libc do budowania aplikacji wbudowanych - pliki dla programistów.
53
54 %package static
55 Summary:        Static klibc libraries
56 Summary(pl):    Biblioteki statyczne klibc
57 Group:          Development/Libraries
58 Requires:       %{name}-devel = %{version}-%{release}
59
60 %description static
61 Static klibc libraries.
62
63 %description static -l pl
64 Biblioteki statyczne klibc.
65
66 %package utils-shared
67 Summary:        Utilities dynamically linked with klibc
68 Summary(pl):    Narzêdzia dynamicznie zlinkowane z klibc
69 Group:          Base
70 Requires:       %{name} = %{version}-%{release}
71
72 %description utils-shared
73 Utilities dynamically linked with klibc.
74
75 %description utils-shared -l pl
76 Narzêdzia dynamicznie zlinkowane z klibc.
77
78 %package utils-static
79 Summary:        Utilities statically linked with klibc
80 Summary(pl):    Narzêdzia statycznie zlinkowane z klibc
81 Group:          Base
82
83 %description utils-static
84 Utilities staticly linked with klibc.
85
86 %description utils-static -l pl
87 Narzêdzia statycznie zlinkowane z klibc.
88
89 %prep
90 %setup -q
91 %patch0 -p1
92 %patch1 -p1
93 %patch2 -p1
94
95 %build
96 rm -rf include/{asm,asm-generic,linux}
97 %ifarch ppc powerpc
98 if [ -d %{_kernelsrcdir}/include/asm-powerpc ]; then
99         install -d include/asm
100         cp -a %{_kernelsrcdir}/include/asm-ppc/* include/asm/
101         cp -a %{_kernelsrcdir}/include/asm-powerpc/* include/asm/
102 else
103         ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
104 fi
105 %else
106         ln -sf %{_kernelsrcdir}/include/asm-%{_target_base_arch} include/asm
107 %endif
108 cd include
109 ln -sf %{_kernelsrcdir}/include/asm-generic .
110 ln -sf %{_kernelsrcdir}/include/linux .
111 %if %{with dist_kernel}
112 [ ! -d arch/%{_target_base_arch}/linux ] && mkdir arch/%{_target_base_arch}/linux
113 ln -sf  %{_kernelsrcdir}/include/linux/autoconf-up.h arch/%{_target_base_arch}/linux/autoconf.h
114 %endif
115 for a in `ls arch`; do [ "$a" != "%{_target_base_arch}" ] && rm -rf arch/$a; done
116 cd ..
117
118 %ifarch sparc
119 # hack; missing dependency in make system
120 ( cd klibc && %{__make} -f arch/sparc/Makefile.inc ARCH=sparc \
121         arch/sparc/sdiv.S arch/sparc/udiv.S arch/sparc/srem.S arch/sparc/urem.S )
122 %endif
123
124 %{__make} \
125         ARCH=%{_target_base_arch} \
126         HOSTCC="%{__cc}" \
127         rpm_prefix=%{_prefix} \
128         rpm_bindir=%{_bindir} \
129         rpm_includedir=%{_includedir}/klibc \
130         rpm_libdir=%{_libdir} \
131         SHLIBDIR=/%{_lib} \
132         OPTFLAGS="%{rpmcflags} -Os -fomit-frame-pointer -falign-functions=0 \
133                 -falign-jumps=0 -falign-loops=0 -ffreestanding"
134
135 %install
136 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT/%{_lib}
138 install -d $RPM_BUILD_ROOT%{_includedir}/klibc
139 install -d $RPM_BUILD_ROOT%{_libdir}/klibc/bin-{shared,static}
140
141 cp -a include/* $RPM_BUILD_ROOT%{_includedir}/klibc
142 install klcc/klcc -D $RPM_BUILD_ROOT%{_bindir}/klcc
143 install klcc/klcc.1 -D $RPM_BUILD_ROOT%{_mandir}/man1/klcc.1
144 install klibc/libc.* klibc/arch/%{_target_base_arch}/crt0.o klibc/interp.o $RPM_BUILD_ROOT%{_libdir}/klibc
145 install klibc/klibc.so $RPM_BUILD_ROOT/%{_lib}
146 install dash/sh.shared $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared/sh
147 install dash/sh $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static/sh
148 install utils/shared/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-shared
149 install utils/static/* $RPM_BUILD_ROOT%{_libdir}/klibc/bin-static
150
151 %clean
152 rm -rf $RPM_BUILD_ROOT
153
154 %files
155 %defattr(644,root,root,755)
156 %attr(755,root,root) /%{_lib}/klibc.so
157
158 %files devel
159 %defattr(644,root,root,755)
160 %attr(755,root,root) %{_bindir}/klcc
161 %{_includedir}/klibc
162 %dir %{_libdir}/klibc
163 %attr(755,root,root) %{_libdir}/klibc/*.so
164 %{_libdir}/klibc/*.o
165 %{_mandir}/man1/*
166
167 %files static
168 %defattr(644,root,root,755)
169 %{_libdir}/klibc/*.a
170
171 %files utils-shared
172 %defattr(644,root,root,755)
173 %dir %{_libdir}/klibc/bin-shared
174 %attr(755,root,root) %{_libdir}/klibc/bin-shared/*
175
176 %files utils-static
177 %defattr(644,root,root,755)
178 %dir %{_libdir}/klibc/bin-static
179 %attr(755,root,root) %{_libdir}/klibc/bin-static/*
This page took 0.086568 seconds and 4 git commands to generate.