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