]> git.pld-linux.org Git - packages/crossm68k-uClibc.git/blob - crossm68k-uClibc.spec
- use preferred %{!?...} instead of %{?!...}
[packages/crossm68k-uClibc.git] / crossm68k-uClibc.spec
1 #
2 %bcond_with     bootstrap       # Build only headers
3 #
4 # TODO:
5 #
6 %define         kernel_version  2.4.32-uc0
7
8 Summary:        C library optimized for size (m68k version)
9 Summary(pl.UTF-8):      Biblioteka C zoptymalizowana na rozmiar (dla m68k)
10 Name:           crossm68k-uClibc
11 Version:        0.9.27
12 Release:        1
13 Epoch:          0
14 License:        LGPL
15 Group:          Libraries
16 Source0:        http://www.uclibc.org/downloads/uClibc-%{version}.tar.bz2
17 # Source0-md5:  6250bd6524283bd8e7bc976d43a46ec0
18 Source1:        linux-%{kernel_version}.tar.bz2
19 # Source1-md5:  bf6e3843ca122e3ad9ad28b94f4b8ed5
20 Source2:        %{name}.config
21 Source3:        %{name}-kernel.config
22 Patch0:         %{name}-clone.patch
23 Patch1:         %{name}-uCLinux.patch
24 URL:            http://www.uclibc.org/
25 %{!?with_bootstrap:BuildRequires:       crossm68k-gcc}
26 BuildRequires:  sed >= 4.0
27 BuildRequires:  which
28 BuildRoot:      %{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
36 Small libc for building embedded applications.
37 Version compiled for m68k.
38
39 %description -l pl.UTF-8
40 Mała libc do budowania aplikacji wbudowanych.
41 Wersja dla m68k.
42
43 %prep
44 %setup -q -n uClibc-%{version} -a1
45 %patch0 -p1
46 %patch1 -p1
47
48 install -m 600 %{SOURCE2} .config
49
50 sed -i "s@^.*KERNEL_SOURCE.*\$@KERNEL_SOURCE=\"$PWD/linux-%{kernel_version}\"@" \
51         .config
52
53 cd linux-%{kernel_version}
54 install -m 600 %{SOURCE3} .config
55 make ARCH=m68knommu oldconfig
56 make ARCH=m68knommu dep
57 cd ..
58
59 %build
60 rm -rf $RPM_BUILD_ROOT-obj && install -d $RPM_BUILD_ROOT-obj
61
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
69
70         if [ $PIC_CODE -ne 0 ]; then
71             sed -i 's/^.*DOPIC.*$/DOPIC=y/'             .config
72         else
73             sed -i 's/^.*DOPIC.*$/# DOPIC is not set/'  .config
74         fi
75
76         %{__make} clean                                         || exit 1
77         %{__make} all           \
78             CROSS=m68k-elf-     \
79             ARCH_CFLAGS="$COMPILE_FLAGS" </dev/null             || exit 1
80
81         install -d                      $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR
82         install -m 600 lib/*.[ao]       $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR
83         %{target}-strip --strip-debug -R.comment -R.note        \
84                                         $RPM_BUILD_ROOT-obj/$MULTILIB_SUBDIR/*.[ao]
85     }
86
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"
101
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"
114
115 %endif
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119 install -d                      $RPM_BUILD_ROOT%{arch}/include
120 cp -RL include/*                $RPM_BUILD_ROOT%{arch}/include
121 ln -s include                   $RPM_BUILD_ROOT%{arch}/sys-include
122
123 install -d                      $RPM_BUILD_ROOT%{arch}/lib
124
125 %if %{without bootstrap}
126 cp -R $RPM_BUILD_ROOT-obj/*     $RPM_BUILD_ROOT%{arch}/lib
127 %endif
128
129 %clean
130 rm -rf $RPM_BUILD_ROOT
131 rm -rf $RPM_BUILD_ROOT-obj
132
133 %files
134 %defattr(644,root,root,755)
135 %doc Changelog* DEDICATION.mjn3 README TODO docs/threads.txt
136 %{arch}/include
137 %{arch}/lib
138 %{arch}/sys-include
This page took 0.069132 seconds and 3 git commands to generate.