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