Name less
Description A terminal based program for viewing text files
Version 1:692-1
Package Base less
Homepage https://www.greenwoodsoftware.com/less/
Maintainers ['Sébastien "Seblu" Luttringer <seblu@archlinux.org>', 'Tobias Powalowski <tpowa@archlinux.org>']
Contributors ['Allan McRae <allan@archlinux.org>', 'judd <jvinet@zeroflux.org>']
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/less
Sources ['https://www.greenwoodsoftware.com/less/less-692.tar.gz', 'less-692.tar.gz.sig::https://www.greenwoodsoftware.com/less/less-692.sig']
Dependencies ['glibc', 'ncurses', 'pcre2']
Optional-Dependencies []
Build-Dependencies ['git']
Provides []
Builddate 09-02-2026 07:05:39
Architecture x86_64
Distro-Version
Licenses ['GPL-3.0-or-later OR LicenseRef-Less']
Hash 6c509bfc69d1ff66d1432d7bacd8d7e91773f531d40b3e995901ad664025035d
# Maintainer: Sébastien "Seblu" Luttringer <seblu@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=less
pkgver=692
pkgrel=1
epoch=1
pkgdesc='A terminal based program for viewing text files'
license=('GPL-3.0-or-later OR LicenseRef-Less')
arch=('x86_64')
url='https://www.greenwoodsoftware.com/less/'
depends=(
  glibc
  ncurses 
  pcre2
)
makedepends=(
  git
)
validpgpkeys=('AE27252BD6846E7D6EAE1DD6F153A7C833235259') # Mark Nudelman
source=(
  https://www.greenwoodsoftware.com/$pkgname/$pkgname-$pkgver.tar.gz
  $pkgname-$pkgver.tar.gz.sig::https://www.greenwoodsoftware.com/$pkgname/$pkgname-$pkgver.sig
)
b2sums=('379d7738894f16fed1b429c9e26c2e46fd27c790be2b0b8b6c0f6744913845ea6003d5b50db4186847c4daf430fb5a23d2c9f35780577a0fb1c1a3b603bfbb41'
        'SKIP')

prepare() {
  cd $pkgname-$pkgver
  # apply patch from the source array (should be a pacman feature)
  local src
  for src in "${source[@]}"; do
    src="${src%%::*}"
    src="${src##*/}"
    [[ $src = *.patch ]] || continue
    echo "Applying patch $src..."
    # TODO: reactivate when dropping the git exclude patch patch -Np1 < "../$src"
    git apply --exclude NEWS --exclude version.c "../$src"
  done
}

build() {
  cd $pkgname-$pkgver
  sh configure --prefix=/usr --sysconfdir=/etc --with-regex=pcre2
  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
  install -Dm644 {,"$pkgdir"/usr/share/licenses/$pkgname/}LICENSE
}

# vim:set ts=2 sw=2 et: