2007-01-12 17:45:13 +01:00
|
|
|
#
|
2008-09-24 17:01:34 +02:00
|
|
|
# spec file for package ksh (Version 93t)
|
2007-01-12 17:45:13 +01:00
|
|
|
#
|
2009-02-12 18:22:40 +01:00
|
|
|
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-01-12 17:45:13 +01:00
|
|
|
#
|
2008-09-24 17:01:34 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2007-01-12 17:45:13 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
|
2008-02-15 01:27:23 +01:00
|
|
|
|
2007-01-12 17:45:13 +01:00
|
|
|
Name: ksh
|
2009-12-11 16:15:17 +01:00
|
|
|
BuildRequires: bind-libs bind-utils bison flex gdbm-devel glibc-devel ncurses-devel procps psmisc pwdutils zlib-devel
|
|
|
|
%if %suse_version > 1020
|
|
|
|
BuildRequires: libbz2-devel
|
|
|
|
%endif
|
2007-10-03 01:02:00 +02:00
|
|
|
Url: http://www.research.att.com/~gsf/download/
|
2007-06-19 19:52:14 +02:00
|
|
|
License: Common Public License Version 1.0 (CPL1.0)
|
2007-01-12 17:45:13 +01:00
|
|
|
Group: System/Shells
|
2007-11-19 10:24:51 +01:00
|
|
|
PreReq: /bin/ln /bin/rm /etc/bash.bashrc /bin/true
|
2007-10-03 01:02:00 +02:00
|
|
|
AutoReqProv: on
|
2008-09-24 17:01:34 +02:00
|
|
|
Version: 93t
|
2009-12-11 17:31:33 +01:00
|
|
|
Release: 17
|
2007-01-12 17:45:13 +01:00
|
|
|
Summary: Korn Shell
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2009-12-21 23:11:47 +01:00
|
|
|
Source: INIT.2009-12-06.tar.bz2
|
|
|
|
Source1: ast-ksh.2009-12-06.tar.bz2
|
2008-09-24 17:01:34 +02:00
|
|
|
Source2: ast-open-locale.2008-07-25.tar.bz2
|
2009-08-13 17:23:42 +02:00
|
|
|
Source10: leak1.sh
|
|
|
|
Source11: leak2.sh
|
2008-02-15 01:27:23 +01:00
|
|
|
Source20: Agreement
|
|
|
|
Source21: Warning
|
2008-09-24 17:01:34 +02:00
|
|
|
Source22: libast.cflags
|
2007-05-25 17:26:52 +02:00
|
|
|
Source30: rpmlintrc
|
2007-01-12 17:45:13 +01:00
|
|
|
Patch: ksh93.dif
|
|
|
|
Patch1: workaround-stupid-build-system.diff
|
|
|
|
Patch2: ksh-qemu.patch
|
|
|
|
Patch3: ksh93-shift_ijs.dif
|
|
|
|
Patch4: ksh93-gmt2utc.dif
|
|
|
|
Patch5: ksh93-uname.dif
|
|
|
|
Patch6: ksh93-vi.dif
|
|
|
|
Patch7: ksh93-profile.dif
|
2007-04-03 21:36:49 +02:00
|
|
|
Patch8: ksh93-test.dif
|
|
|
|
Patch9: ksh93-compat.dif
|
|
|
|
Patch10: ksh93-suid_exec.dif
|
2008-02-15 01:27:23 +01:00
|
|
|
Patch11: ksh93-signals.dif
|
|
|
|
Patch12: ksh93-limits.dif
|
2008-12-18 15:28:49 +01:00
|
|
|
Patch14: ksh93-ia64.dif
|
|
|
|
Patch15: ksh93-s390.dif
|
2009-08-13 17:23:42 +02:00
|
|
|
Patch42: ksh93-debugleaks.dif
|
2008-09-24 17:01:34 +02:00
|
|
|
%global use_suid_exe 0
|
2008-10-09 18:50:19 +02:00
|
|
|
%global use_locale 0
|
2009-08-13 17:23:42 +02:00
|
|
|
%global debug_memleak 0
|
2007-01-12 17:45:13 +01:00
|
|
|
|
|
|
|
%description
|
|
|
|
The original Korn Shell. The ksh is an sh-compatible command
|
|
|
|
interpreter that executes commands read from standard input or from a
|
|
|
|
file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
David Korn <dgk@research.att.com>
|
|
|
|
Glenn Fowler <gsf@research.att.com>
|
|
|
|
Phong Vo <kpv@research.att.com>
|
|
|
|
|
|
|
|
%package -n ksh-devel
|
2008-05-06 01:33:47 +02:00
|
|
|
License: Common Public License Version 1.0 (CPL1.0)
|
2007-01-12 17:45:13 +01:00
|
|
|
Summary: Korn Shell development environment
|
|
|
|
Group: Development/Libraries/C and C++
|
2007-05-25 17:26:52 +02:00
|
|
|
Requires: ksh = %{version}-%{release}
|
2007-10-03 01:02:00 +02:00
|
|
|
AutoReqProv: on
|
2007-01-12 17:45:13 +01:00
|
|
|
|
|
|
|
%description -n ksh-devel
|
|
|
|
The package includes C header files and the static libraries together
|
|
|
|
with the shared libraries for linking with other projects. Please be
|
|
|
|
aware that the CPL licensed code can not be used within GPL licensed
|
|
|
|
project.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
David Korn <dgk@research.att.com>
|
|
|
|
Glenn Fowler <gsf@research.att.com>
|
|
|
|
Phong Vo <kpv@research.att.com>
|
|
|
|
|
|
|
|
%prep
|
2009-05-28 00:37:00 +02:00
|
|
|
%setup -q -n ksh93 -T -c -a 0 -a 1 -a 2
|
2008-02-15 01:27:23 +01:00
|
|
|
find share/ \( -name chef -o -name fudd -o -name piglatin -o -name valley \) -a -type d |\
|
|
|
|
xargs -r rm -vrf
|
|
|
|
find share/ ! \( -name libast -o -name libcmd -o -name libdll -o -name libshell \) -a -type f |\
|
|
|
|
xargs -r rm -vf
|
|
|
|
find share/ -type d -a -empty | xargs -r rm -vrf
|
|
|
|
find share/ -type d -a -empty | xargs -r rm -vrf
|
2007-01-12 17:45:13 +01:00
|
|
|
%patch
|
|
|
|
%patch1
|
|
|
|
%ifarch %arm
|
|
|
|
%patch2
|
|
|
|
%endif
|
|
|
|
%patch3
|
|
|
|
%patch4
|
|
|
|
%patch5
|
|
|
|
%patch6
|
|
|
|
%patch7
|
|
|
|
%patch8
|
|
|
|
%patch9
|
|
|
|
%patch10
|
2007-10-03 01:02:00 +02:00
|
|
|
%patch11
|
|
|
|
%patch12
|
2008-12-18 15:28:49 +01:00
|
|
|
%ifarch ia64
|
|
|
|
%patch14
|
|
|
|
%endif
|
|
|
|
%patch15
|
2009-08-13 17:23:42 +02:00
|
|
|
%if %debug_memleak
|
|
|
|
%patch42
|
|
|
|
%endif
|
2007-01-12 17:45:13 +01:00
|
|
|
|
|
|
|
%build
|
2009-08-06 17:44:17 +02:00
|
|
|
# This package failed when testing with -Wl,-as-needed being default.
|
|
|
|
# So we disable it here, if you want to retest, just delete this comment and the line below.
|
|
|
|
export SUSE_ASNEEDED=0
|
2008-02-15 01:27:23 +01:00
|
|
|
test -n "${!LC_*}" && unset "${!LC_*}"
|
2008-09-24 17:01:34 +02:00
|
|
|
cflags ()
|
|
|
|
{
|
|
|
|
local flag=$1; shift
|
|
|
|
case "${RPM_OPT_FLAGS}" in
|
|
|
|
*${flag}*) return
|
|
|
|
esac
|
2009-12-11 16:15:17 +01:00
|
|
|
test -z "$1" && return
|
|
|
|
case "$flag" in
|
|
|
|
-Wl,*)
|
|
|
|
set -o noclobber
|
|
|
|
echo 'int main () { return 0; }' > ldtest.c
|
|
|
|
if gcc -Werror $flag -o /dev/null -xc ldtest.c > /dev/null 2>&1 ; then
|
|
|
|
local var=$1; shift
|
|
|
|
eval $var=\${$var:+\$$var\ }$flag
|
|
|
|
fi
|
|
|
|
set +o noclobber
|
|
|
|
rm -f ldtest.c
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if gcc -Werror $flag -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then
|
|
|
|
local var=$1; shift
|
|
|
|
eval $var=\${$var:+\$$var\ }$flag
|
|
|
|
fi
|
|
|
|
esac
|
2008-09-24 17:01:34 +02:00
|
|
|
}
|
|
|
|
#
|
2008-02-15 01:27:23 +01:00
|
|
|
LANG=POSIX
|
|
|
|
export LANG
|
2007-01-12 17:45:13 +01:00
|
|
|
#
|
|
|
|
# If _you_ are knowing how to fix this in the autogenerated
|
|
|
|
# sources of ksh/ast without breaking them, then let me know.
|
|
|
|
#
|
|
|
|
IGNORE="-Wno-missing-braces -Wno-unknown-pragmas -Wno-parentheses"
|
|
|
|
IGNORE="$IGNORE -Wno-char-subscripts -Wno-uninitialized -Wno-implicit"
|
|
|
|
#
|
2007-10-03 01:02:00 +02:00
|
|
|
# Do not use -DSHOPT_SPAWN=1 and/or -DSHOPT_AMP=1 this would cause
|
|
|
|
# errors due race conditions while executing the test suite.
|
2007-01-12 17:45:13 +01:00
|
|
|
#
|
2009-12-11 16:15:17 +01:00
|
|
|
FEATURE="-DSHOPT_SYSRC=1 -DSHOPT_REMOTE=1 -DSHOPT_CMDLIB_BLTIN=1 -DSHOPT_CMDLIB_DIR=1"
|
2007-10-03 01:02:00 +02:00
|
|
|
FEATURE="$FEATURE -DSH_CMDLIB_DIR=\\\"/%{_lib}/ast/bin\\\""
|
|
|
|
FEATURE="$FEATURE -DDEFSHELL=\\\"/bin/ksh\\\""
|
2007-04-03 21:36:49 +02:00
|
|
|
FEATURE="$FEATURE -DTHISPROG=\\\"/%{_lib}/ast/bin/suid_exec\\\""
|
2009-08-06 17:44:17 +02:00
|
|
|
FEATURE="$FEATURE -D_AST_std_malloc=0 -D_map_malloc=1"
|
2007-01-12 17:45:13 +01:00
|
|
|
#
|
|
|
|
#
|
2007-04-03 21:36:49 +02:00
|
|
|
echo 'int main () { return !(sizeof(void*) >= 8); }' | gcc -x c -o test64 -
|
|
|
|
if ./test64 ; then
|
|
|
|
LARGEFILE=""
|
|
|
|
else
|
|
|
|
LARGEFILE="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
|
|
|
|
fi
|
|
|
|
rm -f ./test64
|
2008-12-18 15:28:49 +01:00
|
|
|
case "$RPM_ARCH" in
|
|
|
|
ia64) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;;
|
|
|
|
s390) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;;
|
|
|
|
ppc*) RPM_OPT_FLAGS="${RPM_OPT_FLAGS//-O[s0-9]/-O}" ;;
|
|
|
|
esac
|
|
|
|
RPM_OPT_FLAGS=$(echo "${RPM_OPT_FLAGS}"|sed -r 's/[[:blank:]]+-g[0-9]?//g')
|
|
|
|
UNIVERSE=att
|
2009-08-13 17:23:42 +02:00
|
|
|
LDFLAGS="-lm"
|
2009-12-11 16:15:17 +01:00
|
|
|
LDSOFLG=""
|
2008-12-18 15:28:49 +01:00
|
|
|
CC=gcc
|
2009-12-11 16:15:17 +01:00
|
|
|
cflags -std=gnu99 RPM_OPT_FLAGS
|
|
|
|
cflags -fPIC RPM_OPT_FLAGS
|
|
|
|
cflags @%{S:22} RPM_OPT_FLAGS
|
|
|
|
cflags -fno-strict-aliasing RPM_OPT_FLAGS
|
|
|
|
cflags -fno-zero-initialized-in-bss RPM_OPT_FLAGS
|
|
|
|
cflags -g RPM_OPT_FLAGS
|
|
|
|
cflags -pipe RPM_OPT_FLAGS
|
|
|
|
cflags -Wl,-O2 LDFLAGS
|
|
|
|
cflags -Wl,--hash-size=16699 LDFLAGS
|
|
|
|
cflags -Wl,-O2 LDSOFLG
|
|
|
|
cflags -Wl,-warn-common LDSOFLG
|
|
|
|
cflags -Wl,--as-needed LDSOFLG
|
|
|
|
cflags -Wl,--hash-size=8599 LDSOFLG
|
|
|
|
cflags -Wl,-rpath,/%{_lib}/ast LDSOFLG
|
2008-12-18 15:28:49 +01:00
|
|
|
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE $LARGEFILE"
|
|
|
|
RPM_OPT_FLAGS="$RPM_OPT_FLAGS $IGNORE $FEATURE"
|
2007-01-12 17:45:13 +01:00
|
|
|
HOSTTYPE=${RPM_ARCH%%*-linux*}
|
|
|
|
mam_cc_L=use
|
2008-12-18 15:28:49 +01:00
|
|
|
mam_cc_OPTIMIZE=-pipe
|
|
|
|
export mam_cc_L mam_cc_OPTIMIZE HOSTTYPE LDFLAGS RPM_OPT_FLAGS UNIVERSE
|
|
|
|
for mam in $(find ${PWD}/ -name Mamfile); do
|
|
|
|
sed -ri '/^exec.*\$\{CC\}/{ s/(\$\{CC\})/\1 \$\{RPM_OPT_FLAGS\}/g; }' $mam
|
|
|
|
done
|
|
|
|
bin/package make CC="$CC"
|
2007-01-12 17:45:13 +01:00
|
|
|
root=$(echo ${PWD}/arch/linux*)
|
|
|
|
test -d $root || exit 1
|
|
|
|
log=${root}/lib/package/gen/make.out
|
|
|
|
test -s $log || exit 1
|
|
|
|
for lib in libast libcmd libdll libshell ; do
|
2009-12-11 16:15:17 +01:00
|
|
|
test -s ${root}/lib/${lib}.a || exit 1
|
|
|
|
obj=$(ar t ${root}/lib/${lib}.a)
|
2007-01-12 17:45:13 +01:00
|
|
|
test $? -eq 0 || exit 1
|
|
|
|
case "$lib" in
|
|
|
|
libshell)
|
|
|
|
base=src/cmd/ksh93
|
|
|
|
vers=$(grep ^VERSION ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@")
|
2009-12-21 23:11:47 +01:00
|
|
|
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib $LDSOFLG $LDFLAGS -ldll -lcmd -last -lm -ldl"
|
2007-01-12 17:45:13 +01:00
|
|
|
;;
|
|
|
|
libdll)
|
|
|
|
base=src/lib/$lib
|
|
|
|
vers=$(grep :LIBRARY: ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@")
|
2009-12-21 23:11:47 +01:00
|
|
|
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib $LDSOFLG -ldl -last"
|
2007-01-12 17:45:13 +01:00
|
|
|
;;
|
|
|
|
libcmd)
|
|
|
|
base=src/lib/$lib
|
|
|
|
vers=$(grep :LIBRARY: ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@")
|
2009-12-21 23:11:47 +01:00
|
|
|
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib $LDSOFLG -last"
|
2007-01-12 17:45:13 +01:00
|
|
|
;;
|
|
|
|
libast)
|
|
|
|
base=src/lib/$lib
|
|
|
|
vers=$(grep :LIBRARY: ${base}/Makefile | sed "s@.*\([0-9]\+\.[0-9]\+\).*@\1@")
|
2009-12-21 23:11:47 +01:00
|
|
|
link="-L${root}/lib/ -Wl,-rpath-link,${root}/lib $LDSOFLG"
|
2007-01-12 17:45:13 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
soname="-Wl,-soname,${lib}.so.${vers%.*},-stats"
|
|
|
|
pushd ${root}/${base}
|
|
|
|
$CC -shared $soname -o ${root}/lib/${lib}.so.${vers} ${obj} $link
|
|
|
|
ln -sf ${lib}.so.${vers} ${root}/lib/${lib}.so.${vers%.*}
|
|
|
|
ln -sf ${lib}.so.${vers} ${root}/lib/${lib}.so
|
|
|
|
popd
|
|
|
|
done
|
2008-09-24 17:01:34 +02:00
|
|
|
nm -D ${root}/lib/libast.so | \
|
|
|
|
grep -E 'T[[:blank:]](str|mem|(get|put|set)env|(c|m|re|v)alloc)' | \
|
|
|
|
awk '{print "-fno-builtin-"$3}' | \
|
|
|
|
sort -u | \
|
|
|
|
diff -u %{S:22} - || true
|
2007-01-12 17:45:13 +01:00
|
|
|
base=src/cmd/ksh93
|
|
|
|
test=${PWD}/${base}/tests
|
|
|
|
pushd ${root}/${base}
|
|
|
|
rm -f libshell.a
|
|
|
|
rm -f ${root}/bin/ksh
|
|
|
|
rm -f ${root}/bin/shcomp
|
|
|
|
ksh=$(grep -e '-o ksh' $log | tail -n 1 |\
|
2007-04-03 21:36:49 +02:00
|
|
|
sed "s@+ g\?cc@gcc@;s@-o ksh@-o ${root}/bin/ksh@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g")
|
2009-12-11 16:15:17 +01:00
|
|
|
ksht=$(grep -e '-o ksh' $log | tail -n 1 |\
|
|
|
|
sed "s@+ g\?cc@gcc@;s@-o ksh@-o ${root}/bin/ksh.test@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g")
|
2008-02-15 01:27:23 +01:00
|
|
|
test -n "${ksh}" || { echo build of ksh failed; exit 1; }
|
2007-01-12 17:45:13 +01:00
|
|
|
shcomp=$(grep -e '-o shcomp' $log | tail -n 1 |\
|
2007-04-03 21:36:49 +02:00
|
|
|
sed "s@+ g\?cc@gcc@;s@-o shcomp@-o ${root}/bin/shcomp@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g")
|
2009-12-11 16:15:17 +01:00
|
|
|
shcompt=$(grep -e '-o shcomp' $log | tail -n 1 |\
|
|
|
|
sed "s@+ g\?cc@gcc@;s@-o shcomp@-o ${root}/bin/shcomp.test@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g")
|
2008-02-15 01:27:23 +01:00
|
|
|
test -n "${shcomp}" || { echo build of shcomp failed; exit 1; }
|
2007-04-03 21:36:49 +02:00
|
|
|
suidex=$(grep -e '-o suid_exec' $log | tail -n 1 |\
|
|
|
|
sed "s@+ g\?cc@gcc@;s@-o shcomp@-o ${root}/bin/suid_exec@;s@[a-zA-Z0-9_/\.-]*lib\([a-z]\+\)\.a@-l\1@g;s@'@@g")
|
2008-02-15 01:27:23 +01:00
|
|
|
test -n "${suidex}" || { echo build of suidex failed; exit 1; }
|
2009-12-11 16:15:17 +01:00
|
|
|
${ksht} -Wl,-rpath,${root}/lib
|
|
|
|
${shcompt} -Wl,-rpath,${root}/lib
|
|
|
|
${ksh} -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast
|
|
|
|
${shcomp} -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast
|
|
|
|
${suidex} -Wl,-rpath-link,${root}/lib -Wl,-rpath,/%{_lib}/ast
|
2009-08-13 17:23:42 +02:00
|
|
|
OPATH=$PATH
|
|
|
|
OSHELL=$SHELL
|
|
|
|
PATH=$PATH:${root}/bin
|
2009-12-11 16:15:17 +01:00
|
|
|
SHELL=${root}/bin/ksh.test
|
|
|
|
SHCOMP=${root}/bin/shcomp.test
|
|
|
|
export PATH SHCOMP SHELL
|
2007-01-12 17:45:13 +01:00
|
|
|
pushd ${test}
|
2009-12-11 16:15:17 +01:00
|
|
|
${root}/bin/ksh.test shtests
|
|
|
|
${root}/bin/ksh.test %{S:10}
|
|
|
|
${root}/bin/ksh.test %{S:11}
|
|
|
|
${root}/bin/ksh.test -c 'g="false"; trap "print -u2 PIPED; \$g && exit 0 ; g=true" PIPE ; while true ; do echo hello ; done' | head -n 10
|
2007-01-12 17:45:13 +01:00
|
|
|
popd
|
|
|
|
pushd ${root}/bin
|
2009-08-13 17:23:42 +02:00
|
|
|
PATH=$PATH:.
|
2009-12-11 16:15:17 +01:00
|
|
|
set -- $(shcomp.test --version 2>&1)
|
2007-01-12 17:45:13 +01:00
|
|
|
eval version=\${$#}
|
2009-12-11 16:15:17 +01:00
|
|
|
shcomp.test --nroff 2>&1 | sed 's/\(\.TH .*\)/\1 "2003-03-02" "" "Korn shell utilities"/' > ../man/man1/shcomp.1
|
|
|
|
rm -v ksh.test shcomp.test
|
2007-01-12 17:45:13 +01:00
|
|
|
popd
|
2009-08-13 17:23:42 +02:00
|
|
|
SHELL=$OSHELL
|
|
|
|
PATH=$OPATH
|
2007-01-12 17:45:13 +01:00
|
|
|
popd
|
|
|
|
|
|
|
|
%install
|
|
|
|
root=$(echo ${PWD}/arch/linux*)
|
|
|
|
test -d $root || exit 1
|
|
|
|
pushd $root || exit 1
|
2007-04-03 21:36:49 +02:00
|
|
|
mkdir -p %{buildroot}/bin
|
2007-05-25 17:26:52 +02:00
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
2007-04-03 21:36:49 +02:00
|
|
|
mkdir -p %{buildroot}/%{_lib}/ast/bin
|
2007-05-25 17:26:52 +02:00
|
|
|
mkdir -p %{buildroot}%{_includedir}/ast
|
2007-04-03 21:36:49 +02:00
|
|
|
mkdir -p %{buildroot}%{_libdir}/ast
|
|
|
|
mkdir -p %{buildroot}%{_mandir}
|
|
|
|
mkdir %{buildroot}%{_mandir}/man1
|
|
|
|
mkdir %{buildroot}%{_mandir}/man3
|
2008-10-09 18:50:19 +02:00
|
|
|
%if %use_locale
|
2008-02-15 01:27:23 +01:00
|
|
|
mkdir -p %{buildroot}%{_datadir}/locale
|
2008-10-09 18:50:19 +02:00
|
|
|
%endif
|
2008-09-24 17:01:34 +02:00
|
|
|
mkdir -p %{buildroot}%{_datadir}/ksh/fun
|
2007-04-03 21:36:49 +02:00
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/permissions.d
|
|
|
|
install bin/ksh %{buildroot}/%{_lib}/ast/bin/
|
|
|
|
install bin/shcomp %{buildroot}/%{_lib}/ast/bin/
|
2008-09-24 17:01:34 +02:00
|
|
|
%if %use_suid_exe
|
|
|
|
install bin/suid_exec %{buildroot}/%{_lib}/ast/bin/
|
|
|
|
%endif
|
2008-03-19 12:59:19 +01:00
|
|
|
ln -sf bin/ksh %{buildroot}/%{_lib}/ast/ksh
|
2007-04-03 21:36:49 +02:00
|
|
|
ln -sf /bin/true %{buildroot}/bin/ksh
|
2007-05-25 17:26:52 +02:00
|
|
|
ln -sf /bin/true %{buildroot}%{_bindir}/ksh
|
|
|
|
ln -sf /%{_lib}/ast/bin/ksh %{buildroot}%{_bindir}/rksh
|
|
|
|
ln -sf /%{_lib}/ast/bin/shcomp %{buildroot}%{_bindir}/shcomp
|
2009-12-11 16:15:17 +01:00
|
|
|
ln -sf ast %{buildroot}/%{_lib}/ksh
|
|
|
|
cp -a lib/*.so* %{buildroot}/%{_lib}/ast/
|
|
|
|
cp -a fun/* %{buildroot}%{_datadir}/ksh/fun/
|
2007-04-03 21:36:49 +02:00
|
|
|
for so in %{buildroot}/%{_lib}/ast/*.so.*.* ; do
|
2007-01-12 17:45:13 +01:00
|
|
|
so=${so##*/}
|
2007-04-03 21:36:49 +02:00
|
|
|
ln -sf /%{_lib}/ast/$so %{buildroot}%{_libdir}/ast/${so%%%%.*}.so
|
2007-01-12 17:45:13 +01:00
|
|
|
done
|
2007-04-03 21:36:49 +02:00
|
|
|
rm -f %{buildroot}%{_libdir}/ast/*.so.*
|
2007-05-25 17:26:52 +02:00
|
|
|
install -m 0644 lib/*.a %{buildroot}%{_libdir}/ast/
|
|
|
|
install -m 0644 man/man1/sh.1 %{buildroot}%{_mandir}/man1/ksh.1
|
|
|
|
install -m 0644 man/man1/shcomp.1 %{buildroot}%{_mandir}/man1/shcomp.1
|
2007-01-12 17:45:13 +01:00
|
|
|
for man in man/man3/*.3 ; do
|
|
|
|
man=${man##*/}
|
|
|
|
ast=${man}ast
|
2007-05-25 17:26:52 +02:00
|
|
|
install -m 0644 man/man3/${man} %{buildroot}%{_mandir}/man3/${ast}
|
2007-01-12 17:45:13 +01:00
|
|
|
done
|
2007-05-25 17:26:52 +02:00
|
|
|
install -m 0644 include/ast/* %{buildroot}%{_includedir}/ast/
|
2007-01-12 17:45:13 +01:00
|
|
|
popd
|
2008-10-09 18:50:19 +02:00
|
|
|
%if %use_locale
|
2008-02-15 01:27:23 +01:00
|
|
|
for msg in share/lib/locale/* ; do
|
|
|
|
test -d $msg || continue
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/locale/${msg##*/}/LC_MESSAGES
|
|
|
|
cp -vp ${msg}/LC_MESSAGES/* %{buildroot}%{_datadir}/locale/${msg##*/}/LC_MESSAGES/
|
|
|
|
done
|
|
|
|
echo %%dir %{_datadir}/locale/C > ksh.lang
|
|
|
|
echo %%dir %{_datadir}/locale/C/LC_MESSAGES >> ksh.lang
|
|
|
|
find %{buildroot}/ -type f -o -type l | sed -r '
|
|
|
|
s:%{buildroot}::
|
|
|
|
s:(%{_datadir}/locale/)([^/_]+)(.*$):%%lang\(\2\) \1\2\3:
|
|
|
|
s:^([^%%].*)::
|
|
|
|
s:%%lang\(C\) ::
|
|
|
|
/^ *$/d' >> ksh.lang
|
2008-10-09 18:50:19 +02:00
|
|
|
%else
|
|
|
|
> ksh.lang
|
|
|
|
%endif
|
2007-01-12 17:45:13 +01:00
|
|
|
cp lib/package/LICENSES/ast LICENSE
|
|
|
|
mv src/cmd/ksh93/OBSOLETE src/cmd/ksh93/OBSOLETE.mm
|
|
|
|
cat src/cmd/ksh93/builtins.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > Builtins
|
|
|
|
cat src/cmd/ksh93/PROMO.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > PROMO
|
|
|
|
cat src/cmd/ksh93/OBSOLETE.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > OBSOLETE
|
|
|
|
cat src/cmd/ksh93/sh.memo | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > MEMORANDUM
|
2008-02-15 01:27:23 +01:00
|
|
|
cp %{S:21} .
|
2008-09-24 17:01:34 +02:00
|
|
|
%if %use_suid_exe
|
|
|
|
(cat > %{buildroot}%{_sysconfdir}/permissions.d/ksh) <<-EOF
|
|
|
|
/%{_lib}/ast/bin/suid_exec root:root 4755
|
|
|
|
EOF
|
|
|
|
(cat > %{buildroot}%{_sysconfdir}/permissions.d/ksh.paranoid) <<-EOF
|
|
|
|
/%{_lib}/ast/bin/suid_exec root:root 0755
|
|
|
|
EOF
|
|
|
|
%endif
|
2007-01-12 17:45:13 +01:00
|
|
|
|
|
|
|
%post
|
|
|
|
test -e etc/bash.bashrc && ln -sf bash.bashrc etc/ksh.kshrc || true
|
2007-04-03 21:36:49 +02:00
|
|
|
if test -x %{_lib}/ast/bin/ksh ; then
|
2007-01-12 17:45:13 +01:00
|
|
|
rm -f bin/ksh
|
2007-04-03 21:36:49 +02:00
|
|
|
ln -sf /%{_lib}/ast/bin/ksh bin/ksh
|
2007-01-12 17:45:13 +01:00
|
|
|
rm -f usr/bin/ksh
|
2007-04-03 21:36:49 +02:00
|
|
|
ln -sf /%{_lib}/ast/bin/ksh usr/bin/ksh
|
2007-01-12 17:45:13 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
%postun
|
2008-03-19 12:59:19 +01:00
|
|
|
if test ! -x %{_lib}/ast/bin/ksh ; then
|
2007-01-12 17:45:13 +01:00
|
|
|
if test ! -x bin/pdksh ; then
|
|
|
|
rm -f etc/ksh.kshrc
|
|
|
|
fi
|
|
|
|
if test ! -e bin/ksh ; then
|
|
|
|
rm -f bin/ksh usr/bin/ksh
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2008-02-15 01:27:23 +01:00
|
|
|
%files -f ksh.lang
|
2007-01-12 17:45:13 +01:00
|
|
|
%defattr(-,root,root)
|
2008-09-24 17:01:34 +02:00
|
|
|
%if %use_suid_exe
|
|
|
|
%{_sysconfdir}/permissions.d/ksh
|
|
|
|
%{_sysconfdir}/permissions.d/ksh.paranoid
|
|
|
|
%endif
|
2007-01-12 17:45:13 +01:00
|
|
|
%doc LICENSE src/cmd/ksh93/COMPATIBILITY src/cmd/ksh93/RELEASE*
|
|
|
|
%doc Builtins PROMO OBSOLETE MEMORANDUM
|
|
|
|
%doc %{_mandir}/man1/*.1.gz
|
|
|
|
%ghost %verify(not link) /bin/ksh
|
2007-05-25 17:26:52 +02:00
|
|
|
%ghost %verify(not link) %{_bindir}/ksh
|
|
|
|
%{_bindir}/rksh
|
|
|
|
%{_bindir}/shcomp
|
2007-04-03 21:36:49 +02:00
|
|
|
%dir /%{_lib}/ast
|
|
|
|
%dir /%{_lib}/ast/bin
|
2008-03-26 16:18:52 +01:00
|
|
|
/%{_lib}/ast/ksh
|
2007-04-03 21:36:49 +02:00
|
|
|
/%{_lib}/ast/bin/ksh
|
|
|
|
/%{_lib}/ast/bin/shcomp
|
2008-09-24 17:01:34 +02:00
|
|
|
%if %use_suid_exe
|
|
|
|
%attr(4755,root,root) /%{_lib}/ast/bin/suid_exec
|
|
|
|
%endif
|
2009-12-11 16:15:17 +01:00
|
|
|
/%{_lib}/ast/*.so*
|
|
|
|
/%{_lib}/ksh
|
2008-09-24 17:01:34 +02:00
|
|
|
%dir %{_datadir}/ksh
|
|
|
|
%dir %{_datadir}/ksh/fun
|
|
|
|
%{_datadir}/ksh/fun/*
|
2007-01-12 17:45:13 +01:00
|
|
|
|
|
|
|
%files -n ksh-devel
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc LICENSE Warning
|
|
|
|
%dir %{_libdir}/ast/
|
|
|
|
%{_libdir}/ast/*.so
|
|
|
|
%{_libdir}/ast/*.a
|
|
|
|
%doc %{_mandir}/man3/*
|
2007-05-25 17:26:52 +02:00
|
|
|
%{_includedir}/ast/
|
2007-11-23 02:11:50 +01:00
|
|
|
|
2007-03-29 00:44:12 +02:00
|
|
|
%changelog
|