# Maintainer: American_Jesus <american.jesus.pt AT gmail DOT com>

pkgname=nano-syntax-highlighting
conflicts=(${pkgname}-git)
replaces=(${pkgname}-git)
pkgver=2025.07.01
pkgrel=2
pkgdesc="Nano editor syntax highlighting enhancements"
arch=('any')
depends=('nano')
url="https://github.com/galenguyer/nano-syntax-highlighting"
license=('custom')
install=nano-syntax-highlighting.install
source=("${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('ae1138a436fb0c505ea0d309c70a5f43f9764a5deb9cedce71f8ba00a0a09e5c')
noextract=("${pkgname}-${pkgver}.tar.gz")

prepare() {
  tar -xzf "${pkgname}-${pkgver}.tar.gz" || true
}

build() {
  cd "${pkgname}-${pkgver}"
  find *.nanorc -type f | sed "s@^@include /usr/share/${pkgname}/@" > nanorc.sample
}

package() {
  cd "${pkgname}-${pkgver}"

  find . -name '*.nanorc' | xargs install -D -m644 -t ${pkgdir}/usr/share/${pkgname}/
  install -D -m644 nanorc.sample ${pkgdir}/usr/share/${pkgname}/nanorc.sample
}
