Would installing the script as `datediff.sh' to /usr/bin be standard?
I believe /usr/bin/datediff would. Adding the extension to the executable is non-standard, lots of binaries are plaintext, but they do not carry their extension. Imagine you rewrite your tool to use python instead, now you and everyone else who relies on the tool has to deal with the breaking change, whereas if the extension is never present, this isn't a problem. It also makes it nicer to be typed out in a terminal without having to mash TAB. However(!), datediff is already an existing tool in community/dateutils, which seems to have a similar use case as your tool does.
Suggestions are appreciated
md5 is broken and should not be used, sha256 or similar would be advised. On Wed, Mar 22, 2023 at 11:55 AM jamil bio <jamilbio20@gmail.com> wrote:
Hello!
I would like to introduce my project to the AUR mailing list. I am about to upload a PKGBUILD of a `datediff.sh' script which does calendrical calculations with shell built-ins, and has got some other few functions as well.
Would installing the script as `datediff.sh' to /usr/bin be standard?
Suggestions are appreciated. I am thinking about making a man page, that is why one line in package() is still commented out - but may use it in the future.
# Maintainer: Jamil SN <jamilbio20@gmail.com> pkgname='datediff.sh' pkgbase='shellDatediff' pkgver=0.23.4 pkgrel=1 #epoch= pkgdesc='Calculate time differences with Ksh, Bash, and Zsh builtins. Check moon phases, Easter dates and next Friday 13th.' arch=('any') url="https://github.com/mountaineerbr/${pkgbase}" license=('GPL') depends=('bash') optdepends=( 'date: convert input to iso-8601' 'bc: fractional time units (bash)' ) provides=('datediff.sh') #conflicts=('datediff.sh') source=("https://github.com/mountaineerbr/${pkgbase}/releases/download/v${pkgver}/${pkgbase}.tar.zst") md5sums=('949f88594bba40f7a62ff65e6dda7cf8')
prepare() { cd "${pkgbase}-${pkgver}"
#check defaults interpreter if command -v ksh then return 0 elif command -v bash then _sh=bash elif command -v zsh then _sh=zsh else return 0 fi
sed -i -e "1s/ksh/${_sh}/" "${pkgname}" }
package() { cd "${pkgbase}-${pkgver}"
#install -Dm644 "${pkgname}.1" "${pkgdir}/usr/local/man/man1/${pkgname}.1" install -Dm755 "${pkgname}" "${pkgdir}/usr/bin/${pkgname}" }