]> git.pld-linux.org Git - packages/crossm68k-uClibc.git/blame - crossm68k-uClibc.spec
- use preferred %{!?...} instead of %{?!...}
[packages/crossm68k-uClibc.git] / crossm68k-uClibc.spec
CommitLineData
8ba159e4 1#
2%bcond_with bootstrap # Build only headers
3#
4# TODO:
ce758fda 5#
6%define kernel_version 2.4.32-uc0
8ba159e4 7
8Summary: C library optimized for size (m68k version)
806a3878 9Summary(pl.UTF-8): Biblioteka C zoptymalizowana na rozmiar (dla m68k)
8ba159e4 10Name: crossm68k-uClibc
ce758fda 11Version: 0.9.27
8ba159e4 12Release: 1
13Epoch: 0
14License: LGPL
15Group: Libraries
16Source0: http://www.uclibc.org/downloads/uClibc-%{version}.tar.bz2
ce758fda 17# Source0-md5: 6250bd6524283bd8e7bc976d43a46ec0
18Source1: linux-%{kernel_version}.tar.bz2
19# Source1-md5: bf6e3843ca122e3ad9ad28b94f4b8ed5
ffea20ed 20Source2: %{name}.config
ce758fda 21Source3: %{name}-kernel.config
8ba159e4 22Patch0: %{name}-clone.patch
ce758fda 23Patch1: %{name}-uCLinux.patch
8ba159e4 24URL: http://www.uclibc.org/
94f7c63b 25%{!?with_bootstrap:BuildRequires: crossm68k-gcc}
8ba159e4 26BuildRequires: sed >= 4.0
27BuildRequires: which
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%define target m68k-elf
31%define arch %{_prefix}/%{target}
32
33%define _noautostrip .*%{arch}/lib/.*\\.[ao]$
34
35%description
36Small libc for building embedded applications.
37Version compiled for m68k.
38
3c796eea
JR
39%description -l pl.UTF-8
40Mała libc do budowania aplikacji wbudowanych.
8ba159e4 41Wersja dla m68k.
42
43%prep
44%setup -q -n uClibc-%{version} -a1
45%patch0 -p1
ce758fda 46%patch1 -p1
8ba159e4 47
ce758fda 48install -m 600 %{SOURCE2} .config
8ba159e4 49
ce758fda 50sed -i "s@^.*KERNEL_SOURCE.*\$@KERNEL_SOURCE=\"$PWD/linux-%{kernel_version}\"@" \
8ba159e4 51 .config
52
ce758fda 53cd linux-%{kernel_version}
54install -m 600 %{SOURCE3} .config
55make ARCH=m68knommu oldconfig
56make ARCH=m68knommu dep
57cd ..
8ba159e4 58
59%build
ce758fda 60rm -rf $RPM_BUILD_ROOT-obj && install -d $RPM_BUILD_ROOT-obj
61
8ba159e4 62%if %{with bootstrap}
63 %{__make} headers < /dev/null
64%else
65 _build () {
66 local MULTILIB_SUBDIR=$1
67 local PIC_CODE=$2
68 local COMPILE_FLAGS=$3
ffea20ed 69
8ba159e4 70 if [ $PIC_CODE -ne 0 ]; then
71 sed -i 's/^.*DOPIC.*$/DOPIC=y/' .config
8ba159e4 72 else
73 sed -i 's/^.*DOPIC.*$/# DOPIC is not set/' .config
74 fi
75
76 %{__make} clean || exit 1
ce758fda 77 %{__make} all \
78 CROSS=m68k-elf- \
79 ARCH_CFLAGS="$COMPILE_FLAGS" </dev/null || exit 1
ffea20ed 80
ce758fda 81 install -d $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR
82 install -m 600 lib/*.[ao] $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR
8ba159e4 83 %{target}-strip --strip-debug -R.comment -R.note \
ce758fda 84 $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR/*.[ao]
8ba159e4 85 }
86
ce758fda 87 _build "m5200" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5200 -Wa,-m5200"
88 _build "m5200/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5200 -Wa,-m5200 -msep-data"
89
90 _build "m5206e" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5206e -Wa,-m5206e"
91 _build "m5206e/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5206e -Wa,-m5206e -msep-data"
92
93 _build "m528x" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m528x -Wa,-m528x"
94 _build "m528x/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m528x -Wa,-m528x -msep-data"
95
96 _build "m5307" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5307 -Wa,-m5307"
97 _build "m5307/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5307 -Wa,-m5307 -msep-data"
98
99 _build "m5407" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5407 -Wa,-m5407"
100 _build "m5407/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m5407 -Wa,-m5407 -msep-data"
ffea20ed 101
ce758fda 102 _build "m68040" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68040 -Wa,-m68040"
103 _build "m68040/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68040 -Wa,-m68040 -msep-data"
104
105 _build "m68060" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68060 -Wa,-m68060"
106 _build "m68060/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68060 -Wa,-m68060 -msep-data"
107
108 _build "mcpu32" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -mcpu32 -Wa,-mcpu32"
109 _build "mcpu32/msep-data" 1 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -mcpu32 -Wa,-mcpu32 -msep-data"
110
111 _build "m68000" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -m68000 -Wa,-m68000"
112
113 _build "msoft-float" 0 "-ffunction-sections -fdata-sections -Wa,--bitwise-or -D__linux__=1 -msoft-float"
8ba159e4 114
8ba159e4 115%endif
116
117%install
ffea20ed 118rm -rf $RPM_BUILD_ROOT
ce758fda 119install -d $RPM_BUILD_ROOT%{arch}/include
120cp -RL include/* $RPM_BUILD_ROOT%{arch}/include
121ln -s include $RPM_BUILD_ROOT%{arch}/sys-include
122
123install -d $RPM_BUILD_ROOT%{arch}/lib
124
125%if %{without bootstrap}
126cp -R $RPM_BUILD_ROOT-obj/* $RPM_BUILD_ROOT%{arch}/lib
127%endif
8ba159e4 128
129%clean
130rm -rf $RPM_BUILD_ROOT
ce758fda 131rm -rf $RPM_BUILD_ROOT-obj
8ba159e4 132
133%files
134%defattr(644,root,root,755)
ce758fda 135%doc Changelog* DEDICATION.mjn3 README TODO docs/threads.txt
8ba159e4 136%{arch}/include
137%{arch}/lib
138%{arch}/sys-include
This page took 0.08046 seconds and 4 git commands to generate.