diff options
| author | kj-sh604 | 2024-06-30 07:12:10 -0400 |
|---|---|---|
| committer | kj-sh604 | 2024-06-30 07:12:10 -0400 |
| commit | 4ffcdb90c9fef1aa3847c00f4f5e442aa8650fbd (patch) | |
| tree | 5e3a5199a9aed554fd4c7dc9754476ff5d9e19e9 | |
| parent | b69c2366169e14fde5821ba53607a33732f225da (diff) | |
kj-gitbot: grep-compat/
| -rw-r--r-- | grep-compat/.SRCINFO | 16 | ||||
| -rw-r--r-- | grep-compat/.gitignore | 7 | ||||
| -rw-r--r-- | grep-compat/PKGBUILD | 58 |
3 files changed, 81 insertions, 0 deletions
diff --git a/grep-compat/.SRCINFO b/grep-compat/.SRCINFO new file mode 100644 index 0000000..b1e1324 --- /dev/null +++ b/grep-compat/.SRCINFO @@ -0,0 +1,16 @@ +pkgbase = grep-compat + pkgdesc = A string search utility (without egrep and fgrep warnings when used in scripts) + pkgver = 3.11 + pkgrel = 1 + url = https://www.gnu.org/software/grep/ + arch = x86_64 + license = GPL3 + makedepends = texinfo + depends = glibc + depends = pcre2 + provides = grep + conflicts = grep + source = https://ftp.gnu.org/gnu/grep/grep-3.11.tar.xz + sha512sums = f254a1905a08c8173e12fbdd4fd8baed9a200217fba9d7641f0d78e4e002c1f2a621152d67027d9b25f0bb2430898f5233dc70909d8464fd13d7dd9298e65c42 + +pkgname = grep-compat diff --git a/grep-compat/.gitignore b/grep-compat/.gitignore new file mode 100644 index 0000000..58d77f2 --- /dev/null +++ b/grep-compat/.gitignore @@ -0,0 +1,7 @@ +pkg/ +src/ +*.sig +*.tar +*.tar.zst +*.tar.gz +*.tar.xz diff --git a/grep-compat/PKGBUILD b/grep-compat/PKGBUILD new file mode 100644 index 0000000..ea1ebc5 --- /dev/null +++ b/grep-compat/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: kj_sh604 <406hs_jk@proton.me> + +pkgname=grep-compat +pkgname_=grep +pkgver=3.11 +pkgrel=1 +pkgdesc='A string search utility (without egrep and fgrep warnings when used in scripts)' +arch=('x86_64') +license=('GPL3') +url='https://www.gnu.org/software/grep/' +depends=('glibc' 'pcre2') +makedepends=('texinfo') +provides=('grep') +conflicts=('grep') +source=("https://ftp.gnu.org/gnu/$pkgname_/$pkgname_-$pkgver.tar.xz") +sha512sums=('f254a1905a08c8173e12fbdd4fd8baed9a200217fba9d7641f0d78e4e002c1f2a621152d67027d9b25f0bb2430898f5233dc70909d8464fd13d7dd9298e65c42') + +prepare() { + cd $pkgname_-$pkgver + local src + for src in "${source[@]}"; do + src="${src%%::*}" + src="${src##*/}" + [[ $src = *.patch ]] || continue + msg2 "Applying patch $src..." + patch -Np1 < "../$src" + done +} + +build() { + cd $pkgname_-$pkgver + ./configure --prefix=/usr + make +} + +check() { + cd $pkgname_-$pkgver + make check +} + +package() { + cd $pkgname_-$pkgver + make DESTDIR="$pkgdir" install + + # add egrep wrapper script with no warnings + install -Dm755 /dev/stdin "$pkgdir/usr/bin/egrep" <<END +#!/bin/sh +cmd=\${0##*/} +exec grep -E "\$@" +END + + # add fgrep wrapper script with no warnings + install -Dm755 /dev/stdin "$pkgdir/usr/bin/fgrep" <<END +#!/bin/sh +cmd=\${0##*/} +exec grep -F "\$@" +END +} |
