On Wed, 22 Mar 2023 07:55:44 -0300
jamil bio <jamilbi...@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?

There's no problems leaving the .sh on there. If that's what upstream does, I
would leave it.

> 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 <jamilbi...@gmail.com>
>      pkgname='datediff.sh'
>      pkgbase='shellDatediff'

This was already addressed, but don't do this. The name of the script doesn't
matter here in any way.

>      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')

This isn't correct, see the license section of the PKGBUILD wiki page.

>      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}"
>      }

This entire prepare function is just wrong. The PKGBUILD shouldn't be doing
different things based on what random things it might find on the system.

Reply via email to