%endif
Summary: Small bourne shell from Berkeley
-Summary(de.UTF-8): Kleine Bourne-Shell von Berkeley
-Summary(es.UTF-8): Pequeña shell bourne de Berkeley
-Summary(fr.UTF-8): Shell Bourne réduit de Berkeley
-Summary(pl.UTF-8): Mały shell bourne'a
-Summary(pt_BR.UTF-8): Pequena shell bourne de Berkeley
-Summary(ru.UTF-8): Облегченная версия Bourne shell (sh)
-Summary(tr.UTF-8): Ufak bir bourne kabuğu
-Summary(uk.UTF-8): Полегшена версія Bourne shell (sh)
-Summary(zh_CN.UTF-8): [系统]Berkeley的微型Bourne Shell
-Summary(zh_TW.UTF-8): [\e-A系\e$)B統]Berkeley的\e-A微\e$)B型Bourne Shell
+Summary(de.UTF-8): Kleine Bourne-Shell von Berkeley
+Summary(es.UTF-8): Pequeña shell bourne de Berkeley
+Summary(fr.UTF-8): Shell Bourne réduit de Berkeley
+Summary(pl.UTF-8): Mały shell bourne'a
+Summary(pt_BR.UTF-8): Pequena shell bourne de Berkeley
+Summary(ru.UTF-8): Облегченная версия Bourne shell (sh)
+Summary(tr.UTF-8): Ufak bir bourne kabuğu
+Summary(uk.UTF-8): Полегшена версія Bourne shell (sh)
+Summary(zh_CN.UTF-8): [系统]Berkeley的微型Bourne Shell
+Summary(zh_TW.UTF-8): [\e-A系\e$)B統]Berkeley的\e-A微\e$)B型Bourne Shell
Name: ash
Version: 0.4.0
-Release: 10
+Release: 11
License: BSD
Group: Applications/Shells
Source0: %{name}-%{version}.tar.gz
Patch19: %{name}-freebsd.patch
Patch20: %{name}-sighup.patch
Patch21: %{name}-dietlibc.patch
+Patch22: %{name}-extern.patch
BuildRequires: byacc
%{?with_dietlibc:BuildRequires: dietlibc-devel}
BuildRequires: flex
%package static
Summary: Small bourne shell from Berkeley
-Summary(de.UTF-8): Kleine Bourne-Shell von Berkeley
-Summary(fr.UTF-8): Shell Bourne réduit de Berkeley
-Summary(pl.UTF-8): Mały shell bourne'a
-Summary(tr.UTF-8): Ufak bir bourne kabuğu
+Summary(de.UTF-8): Kleine Bourne-Shell von Berkeley
+Summary(fr.UTF-8): Shell Bourne réduit de Berkeley
+Summary(pl.UTF-8): Mały shell bourne'a
+Summary(tr.UTF-8): Ufak bir bourne kabuğu
Group: Applications/Shells
Requires(post,preun,verify): grep
Requires(preun): fileutils
%patch19 -p1
%patch20 -p1
%{?_with_dietlibc:%patch21 -p1}
+%patch22 -p1
%build
+%if %{with static}
+%{__make} \
+%if %{with dietlibc}
+ CC="diet %{__cc}" \
+%else
+%if %{with uClibc}
+ CC="%{_target_cpu}-uclibc-gcc"\
+%else
+ CC="%{__cc}"
+%endif
+%endif
+ OPT_FLAGS="%{rpmcflags} -Os" \
+ LDFLAGS="-static %{rpmldflags}"
-%define __cc %{_target_cpu}-pld-linux-gcc
-%{?with_dietlibc:%define __cc %{_target_cpu}-dietlibc-gcc}
-%{?with_uClibc:%define __cc %{_target_cpu}-uclibc-gcc}
+mv -f sh ash.static
+%endif
-%{?with_static:%{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="-static %{rpmldflags}" CC="%{__cc}"}
-%{?with_static:mv -f sh ash.static}
-%{__make} OPT_FLAGS="%{rpmcflags}" LDFLAGS="%{rpmldflags}" CC="%{__cc}"
+%{__make} \
+ CC="%{__cc}" \
+ OPT_FLAGS="%{rpmcflags}" \
+ LDFLAGS="%{rpmldflags}"
%install
rm -rf $RPM_BUILD_ROOT