makedeb


pokemonsay-newgenerations-git 1baccc6d2021.10.04-2


cowsay but with pokemons. is forked from the original as the original was abandoned. this is revived with even more pokemons!

Viewing /PKGBUILD.

View raw.

Click here to go back to the Git tree for pokemonsay-newgenerations-git.

# Maintainer: only_vip <onlyme_vip@protonmail.com>
pkgname=pokemonsay-newgenerations-git
_pkgname=pokemonsay-newgenerations
pkgver=1baccc6d2021.10.04
pkgrel=2
pkgdesc="cowsay but with pokemons. is forked from the original as the original was abandoned. this is revived with even more pokemons!"
arch=('amd64')
depends=('cowsay')
makedepends=()
optdepends=('fortunes'  'fortune-mod')
url="https://github.com/HRKings/pokemonsay-newgenerations.git"
license=('MIT')
source=("${_pkgname}::git+${url}")
sha256sums=("SKIP")
provides=('pokemonsay-newgenerations' 'pokemonsay')
conflicts=('pokemonsay-newgenerations' 'pokemonsay')
# replaces=('pokemonsay-newgenerations' 'pokemonsay')
options=(!strip)
#post_install=

pkgver() {
    cd "${srcdir}/${_pkgname}"
    _always=$(git describe --always | sed -e 's:-:.:g' -e 's:vNext::') # always is mobile, and switches between numbers and letters, can't use it for versioning
    _commits=$(git rev-list --count HEAD | sed 's:-:.:g') # total commits is the most sane way of getting incremental pkgver
    _date=$(git log -1 --date=short --pretty=format:%cd)
    printf "%s%s%s\n" "${_commits}" "${_always}" "${_date}" | sed -e 's:-:.:g'  -e 's:_:.:g'
}

package() {
	cd ${_pkgname}
	# Copy pokemon cowfiles
    install -d "${pkgdir}/opt/${_pkgname}/pokemons"
  	cp -vRf "pokemons/"* "${pkgdir}/opt/${_pkgname}/pokemons/"
        mv "${pkgdir}/opt/${_pkgname}/pokemons/029_"* "${pkgdir}/opt/${_pkgname}/pokemons/029_Nidorana"
        mv "${pkgdir}/opt/${_pkgname}/pokemons/032_"* "${pkgdir}/opt/${_pkgname}/pokemons/033_Nidorano"
        #mv "${pkgdir}/opt/${_pkgname}/pokemons/669_"* "${pkgdir}/opt/${_pkgname}/pokemons/669_Flabebe"

	## Put the installation path on the script
	sed -r "37s;.*;INSTALL_PATH=/opt/${_pkgname};" -i "pokemonsay.sh"
	## Change the pokemonthink to use the pokemonsay in the path
	sed -r "7s;.*;pokemonsay --think \$@;" -i "pokemonthink.sh"

	# Install the scripts	
  	install -Dm755 "pokemonsay.sh" "${pkgdir}/usr/bin/pokemonsay"
  	install -Dm755 "pokemonthink.sh" "${pkgdir}/usr/bin/pokemonthink"
	install -Dm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}