Permalink
Browse files

Update template for spec file for copr builds

Also add configurations files for fedora
  • Loading branch information...
siteshwar committed Jan 5, 2018
1 parent a0459f0 commit 8d37d840c9bdabe20c53b237dd954320f4f7d3c4
Showing with 86 additions and 19 deletions.
  1. +3 −1 .copr/prep.sh
  2. +12 −0 packaging/fedora/dotkshrc
  3. +17 −18 packaging/fedora/ksh.spec.in
  4. +1 −0 packaging/fedora/kshcomp.conf
  5. +53 −0 packaging/fedora/kshrc.rhs
View
@@ -3,10 +3,12 @@
COMMIT=$(git rev-parse HEAD)
COMMIT_SHORT=$(git rev-parse --short HEAD)
COMMIT_NUM=$(git rev-list HEAD --count)
COMMIT_DATE=$(date --date="@$(git show -s --format=%ct HEAD)" +%Y%m%d)
sed "s,#COMMIT#,${COMMIT},;
s,#SHORTCOMMIT#,${COMMIT_SHORT},;
s,#COMMITNUM#,${COMMIT_NUM}," \
s,#COMMITNUM#,${COMMIT_NUM},;
s,#COMMITDATE#,${COMMIT_DATE}," \
packaging/fedora/ksh.spec.in > packaging/fedora/ksh.spec
git archive --prefix "ast-${COMMIT}/" --format "tar.gz" "${COMMIT}" -o "packaging/fedora/ksh-${COMMIT_SHORT}.tar.gz"
View
@@ -0,0 +1,12 @@
# .kshrc
# Source global definitions
if [ -f /etc/kshrc ]; then
. /etc/kshrc
fi
# use emacs editing mode by default
set -o emacs
# User specific aliases and functions
@@ -1,28 +1,25 @@
%global commit #COMMIT#
%global shortcommit #SHORTCOMMIT#
%global commitnum #COMMITNUM#
%global commitdate #COMMITDATE#
Name: ksh
Summary: The Original ATT Korn Shell
URL: http://www.kornshell.com/
License: EPL
Version: %(date +%Y%m%d)+git.%{commitnum}.%{shortcommit}
Version: %{commitdate}+git.%{commitnum}.%{shortcommit}
Release: 0%{?dist}
Source0: https://github.com/att/ast/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
#Source1: kshcomp.conf
#Source2: kshrc.rhs
#Source3: dotkshrc
Source1: kshcomp.conf
Source2: kshrc.rhs
Source3: dotkshrc
BuildRequires: meson
BuildRequires: gcc
BuildRequires: bison
BuildRequires: glibc-devel
BuildRequires: glibc-langpack-zh
BuildRequires: ed
# regression test suite uses 'ps'
BuildRequires: %{_bindir}/ps
Conflicts: pdksh
Requires: coreutils, diffutils, chkconfig
Requires(post): grep, coreutils, systemd-units
Requires(postun): sed
@@ -43,10 +40,9 @@ with "sh" (the Bourne Shell).
%install
%meson_install
%__install -Dpm0644 -t %{buildroot}%{_mandir}/man1 arch/*/man/man1/ksh.1
#__install -Dpm0644 -t %{buildroot}%{_sysconfdir}/binfmt.d %{S:1}
#__install -Dpm0644 -t %{buildroot}%{_sysconfdir} %{S:2}
#__install -Dpm0644 -t %{buildroot}%{_sysconfdir}/skel %{S:3}
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/binfmt.d/kshcomp.conf
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/kshrc
install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/skel/.kshrc
%post
if [ ! -f /etc/shells ]; then
@@ -58,7 +54,7 @@ else
fi
if ! grep -q '^/usr/bin/ksh$' /etc/shells ; then
echo "/usr/bin/ksh" >> /etc/shells
fi
fi
fi
/bin/systemctl try-restart systemd-binfmt.service >/dev/null 2>&1 || :
@@ -80,14 +76,17 @@ else
echo "found"
fi
%files
%doc src/cmd/ksh93/COMPATIBILITY src/cmd/ksh93/RELEASE src/cmd/ksh93/TYPES
%files
%doc src/cmd/ksh93/COMPATIBILITY src/cmd/ksh93/RELEASE src/cmd/ksh93/TYPES
# LICENSE file is missing, temporarily?
%{_bindir}/ksh
%{_bindir}/shcomp
%{_libdir}/libast.so
%{_libdir}/libcmd.so
%{_libdir}/libcoshell.so
%{_mandir}/man1/ksh.1*
#config(noreplace) %{_sysconfdir}/skel/.kshrc
#config(noreplace) %{_sysconfdir}/kshrc
#config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf
%config(noreplace) %{_sysconfdir}/skel/.kshrc
%config(noreplace) %{_sysconfdir}/kshrc
%config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf
%changelog
@@ -0,0 +1 @@
:kshcomp:M::\x0b\x13\x08::/bin/ksh:
View
@@ -0,0 +1,53 @@
#
# /etc/kshrc is sourced in interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
# Set prompts
#PROMPT='[%n@%m]%~%# ' # default prompt
#RPROMPT=' %~' # prompt for right side of screen
_src_etc_profile_d()
{
# from zshrc, with ksh fixes
if [[ ! -o login ]]; then # We're not a login shell
for i in /etc/profile.d/*.sh; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
fi
}
pathmunge () {
case ":${PATH}:" in
*:"$1":*)
;;
*)
if [ "$2" = "after" ]; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
esac
}
_src_etc_profile_d
unset -f _src_etc_profile_d
unset -f pathmunge
# key bindings - make Delete, Home, End,... work
keybd_trap () {
case ${.sh.edchar} in
$'\e[1~') .sh.edchar=$'\001';; # Home = beginning-of-line
$'\e[F') .sh.edchar=$'\005';; # End = end-of-line
$'\e[5~') .sh.edchar=$'\e>';; # PgUp = history-previous
$'\e[6~') .sh.edchar=$'\e<';; # PgDn = history-next
$'\e[3~') .sh.edchar=$'\004';; # Delete = delete-char
esac
}
trap keybd_trap KEYBD

0 comments on commit 8d37d84

Please sign in to comment.