#
# Conditional build:
+%bcond_with lto # enable link time optimisations (breaks tests)
%bcond_without static # static version of mksh
%bcond_without tests # rtchecks and test.sh checks
Summary: MirBSD Korn Shell
Summary(pl.UTF-8): Powłoka Korna z MirBSD
Name: mksh
-Version: 53a
+Version: 58
Release: 1
License: BSD
Group: Applications/Shells
Source0: https://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.tgz
-# Source0-md5: 43fc3e32963cc1795a299bcec531d770
+# Source0-md5: 6922a3e2228de2f0e78ff25398ccf8df
Source1: %{name}-mkshrc
Source2: get-source.sh
Patch0: %{name}-mkshrc_support.patch
# sed rules instead of patch (needed update for every release)
sed -i -e 's|\(#define.*MKSH_VERSION.*\)"|\1 @DISTRO@"|g' sh.h
-sed -i -e 's|\(@(#)MIRBSD KSH.*\)|\1 @DISTRO@|g' check.t
+sed -i -e 's|\(KSH R%{version}.*\)|\1 @DISTRO@|g' check.t
# fill distro
sed -i -e 's#@DISTRO@#PLD/Linux 3.0#g' check.t sh.h
CFLAGS="%{rpmcflags} -DMKSH_GCC55009" \
LDFLAGS="%{rpmldflags}" \
CPPFLAGS="%{rpmcppflags}" \
-sh ./Build.sh -Q -r -j -c lto
+sh ./Build.sh -Q -r -j %{?with_lto:-c lto}
# skip some tests if not on terminal
if ! tty -s; then
CFLAGS="%{rpmcflags} -DMKSH_GCC55009" \
LDFLAGS="%{rpmldflags} -static" \
CPPFLAGS="%{rpmcppflags}" \
-sh ./Build.sh -Q -r -j -c lto
+sh ./Build.sh -Q -r -j %{?with_lto:-c lto}
%if %{with tests}
./test.sh -v $skip_tests