PKGBUILD 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Maintainer: Sébastien Luttringer <seblu@archlinux.org>
  2. # Contributor: Allan McRae <allan@archlinux.org>
  3. # Contributor: Andreas Radke <andyrtr@archlinux.org>
  4. pkgname=file
  5. pkgver=5.38
  6. pkgrel=1
  7. pkgdesc='File type identification utility'
  8. arch=('x86_64')
  9. arch+=('armv7h' 'i686' 'ppc64le')
  10. license=('custom')
  11. groups=('base-devel')
  12. url='https://www.darwinsys.com/file/'
  13. depends=('glibc' 'zlib' 'xz' 'bzip2' 'libseccomp' 'libseccomp.so')
  14. provides=('libmagic.so')
  15. source=("ftp://ftp.astron.com/pub/$pkgname/$pkgname-$pkgver.tar.gz"{,.asc})
  16. validpgpkeys=('BE04995BA8F90ED0C0C176C471112AB16CB33B3A') # Christos Zoulas
  17. sha256sums=('593c2ffc2ab349c5aea0f55fedfe4d681737b6b62376a9b3ad1e77b2cc19fa34'
  18. 'SKIP')
  19. prepare() {
  20. cd $pkgname-$pkgver
  21. # apply patch from the source array (should be a pacman feature)
  22. local src
  23. for src in "${source[@]}"; do
  24. src="${src%%::*}"
  25. src="${src##*/}"
  26. [[ $src = *.patch ]] || continue
  27. msg2 "Applying patch $src..."
  28. patch -Np1 < "../$src"
  29. done
  30. }
  31. build() {
  32. cd $pkgname-$pkgver
  33. # Fix linking libmagic (vfork needs libpthread)
  34. CFLAGS+=" -pthread"
  35. ./configure \
  36. --prefix=/usr \
  37. --datadir=/usr/share/file \
  38. --enable-fsect-man5 \
  39. --enable-libseccomp
  40. sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  41. make
  42. }
  43. check() {
  44. cd $pkgname-$pkgver
  45. make check
  46. }
  47. package() {
  48. cd $pkgname-$pkgver
  49. make DESTDIR="$pkgdir" install
  50. install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  51. }
  52. # vim:set ts=2 sw=2 et: