123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- # Build recipe for mksh and lksh.
- #
- # Copyright (c) 2017-2019 Matias Fonzo, <selk@dragora.org>.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- program=mksh
- version=R57
- release=3
- # Set 'outdir' for a nice and well-organized output directory
- outdir="${outdir}/${arch}/shells"
- tarname=${program}-${version}.tgz
- # Remote source(s)
- fetch=http://www.mirbsd.org/MirOS/dist/mir/mksh/$tarname
- description="
- The MirBSD Korn Shell.
- mksh is the MirBSD enhanced version of the Public Domain Korn shell
- (pdksh), a Bourne-compatible shell which is largely similar to the
- original AT&T Korn shell; mksh is the only pdksh derivate currently
- being actively developed. It includes bug fixes and feature
- improvements, in order to produce a modern, robust shell good for
- interactive and especially script use.
- "
- homepage=http://www.mirbsd.org/mksh.htm
- license="The MirOS Licence, ISC, special terms for use the BSD daemon mascot"
- # Limit package name to the program name
- full_pkgname=$program
- # Source documentation
- docsdir="${docdir}/${program}"
- # Source directory name
- srcdir=mksh
- build()
- {
- set -e
- # Create package structure
- mkdir -p "${destdir}/etc/skel" \
- "${destdir}/usr/bin" \
- "${destdir}/${mandir}/man1"
- unpack "${tardir}/$tarname"
- cd "$srcdir"
- # Set sane permissions
- chmod -R u+w,go-w,a+rX-s .
- # Create a separate build directory
- rm -rf ../mksh-build ../lksh-build
- mkdir ../mksh-build ../lksh-build
- # Build and install mksh
- cd ../mksh-build
- (
- # Build and ignore tests for now in this version of mksh-r57
- # (../mksh/check.t:xxx-stat-1 needs further work)
- #sh ../${srcdir}/Build.sh -r && ./test.sh
- env CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" LDSTATIC=-static \
- sh ../${srcdir}/Build.sh -r
- )
- cp -p mksh "${destdir}/usr/bin/"
- chmod 755 "${destdir}/usr/bin/mksh"
- #cp -p ../${srcdir}/dot.mkshrc "${destdir}/etc/skel/.mkshrc"
- cp -p "${archive}/etc/skel/.mkshrc" "${destdir}/etc/skel/"
- chmod 644 "${destdir}/etc/skel/.mkshrc"
- # To manage (dot new) config file
- touch "${destdir}/etc/skel/.graft-config"
- cp -p ../${srcdir}/mksh.1 "${destdir}/${mandir}/man1/"
- chmod 644 "${destdir}/${mandir}/man1/mksh.1"
- # Build and install lksh (legacy)
- cd ../lksh-build
- (
- # Build and ignore tests for now in this version of mksh-r57
- # (../mksh/check.t:xxx-stat-1 needs further work)
- #sh ../${srcdir}/Build.sh -L -r && ./test.sh
- env CPPFLAGS="$CPPFLAGS -DMKSH_BINSHPOSIX" \
- CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" LDSTATIC=-static \
- sh ../${srcdir}/Build.sh -L -r
- )
- cp -p lksh "${destdir}/usr/bin/"
- chmod 755 "${destdir}/usr/bin/lksh"
- cp -p ../${srcdir}/lksh.1 "${destdir}/${mandir}/man1/"
- chmod 644 "${destdir}/${mandir}/man1/lksh.1"
- # Make symlink to compose the default shell
- ( cd "${destdir}/usr/bin" && ln -sf lksh sh )
- # Compress manual pages
- if test -d "${destdir}/$mandir"
- then
- lzip -9 "${destdir}/${mandir}"/man?/*
- fi
- # Delete temporary build directories
- cd -- "$TMPDIR"
- rm -rf ./mksh-build ./lksh-build
- }
|