MSYS2-packages/file/PKGBUILD
Christoph Reiter 38126d763e makedepend on autotools for packages using configure
In some cases this will introduce cycles which could likely be cleaned
up by only depending on some unix tools instead of the whole autotools.

Rebuilding doesn't make much sense at this point since it just adds a subset
of base-devel which is still installed by default.
2021-12-12 14:20:50 +01:00

56 lines
1.6 KiB
Bash

# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=file
pkgver=5.41
pkgrel=1
pkgdesc="File type identification utility"
arch=('i686' 'x86_64')
license=('custom')
groups=('base-devel')
url="https://www.darwinsys.com/file/"
depends=('gcc-libs' 'zlib' 'libbz2')
makedepends=('python' 'zlib-devel' 'libbz2-devel' 'autotools')
options=('!libtool')
source=("https://astron.com/pub/$pkgname/$pkgname-$pkgver.tar.gz"{,.asc}
file-5.38-msys2.patch)
sha256sums=('13e532c7b364f7d57e23dfeea3147103150cb90593a57af86c10e4f6e411603f'
'SKIP'
'b9ba0c890e7eccbc9913918daa675e48d7211f7b8182a4e2a87657cd5d1c9acf')
validpgpkeys=('BE04995BA8F90ED0C0C176C471112AB16CB33B3A') # Christos Zoulas <christos@zoulas.com>
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch -p1 -i ${srcdir}/file-5.38-msys2.patch
autoreconf -fiv
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
./configure \
--prefix=/usr \
--build=${CHOST} \
--host=${CHOST} \
--target=${CHOST} \
--enable-fsect-man5
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR=${pkgdir} install
install -Dm644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
PYTHON_SITELIB=$(/usr/bin/python -c 'from distutils.sysconfig import * ; print(get_python_lib(0,0));')
mkdir -p ${pkgdir}/${PYTHON_SITELIB}
cp -f ${srcdir}/${pkgname}-${pkgver}/python/magic.py ${pkgdir}/$PYTHON_SITELIB
cat ${srcdir}/${pkgname}-${pkgver}/magic/Magdir/* > ${pkgdir}/usr/share/misc/magic
cp -rf ${pkgdir}/usr/share/misc/magic ${pkgdir}/usr/share/magic
mkdir -p ${pkgdir}/usr/share/file
cp -rf ${pkgdir}/usr/share/magic ${pkgdir}/usr/share/file/magic
}