Files
extra/ccze/PKGBUILD
2025-06-22 20:39:04 -05:00

64 lines
1.7 KiB
Bash

# Maintainer: Jesus E. <heckyel@riseup.net>
pkgname=ccze
pkgver=0.2.1
_debver=$pkgver
_debrel=5
pkgrel=3
pkgdesc="Robust and modular log colorizer with many plugins"
arch=('i686' 'x86_64')
license=('GPL-2')
depends=('ncurses' 'pcre')
makedepends=('quilt')
backup=('etc/cczerc')
source=(https://deb.debian.org/debian/pool/main/${pkgname::1}/${pkgname}/${pkgname}_${_debver}.orig.tar.gz
https://deb.debian.org/debian/pool/main/${pkgname::1}/${pkgname}/${pkgname}_${_debver}-${_debrel}.debian.tar.xz)
sha512sums=('1704da8d4c97a3403a57d7841db8a6e4ba6116e401f91d9ecf1b1371cc18b40641e5665c9414740d6a523874be6b6527f5c0d4f3a3796c7b96ed83192146b2b7'
'160690fa241467ea35bdb77ac1843f8235f6897246b573550d30cfefa0cda30eda9705c5e0b954fd5e30895111b40807e8be97426dc0b89d90549972e1020ae7')
prepare() {
cd "${srcdir}"/$pkgname-$pkgver
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
# Doesn't apply
rm -v debian/patches/dpkg-module.patch || true
quilt push -av
fi
# killing a bug
sed -e 's/-Wswitch -Wmulticharacter/-Wswitch/' -i src/Makefile.in
sed -e '/#undef error_t/d' -i system.h.in
autoreconf -vfi
}
build() {
cd "${srcdir}"/$pkgname-$pkgver
./configure \
--prefix=/usr \
--mandir=/usr/share/man
make
}
package() {
cd "${srcdir}"/$pkgname-$pkgver
make DESTDIR="${pkgdir}" install
install -Dm755 -t "${pkgdir}"/usr/bin src/ccze-dump
"${pkgdir}"/usr/bin/ccze-dump > "${srcdir}"/cczerc
install -Dm644 -t "${pkgdir}"/etc "${srcdir}"/cczerc
install -Dm644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname"
}