template (2020B)
1 # Template file for 'dosfstools' 2 pkgname=dosfstools 3 version=4.2 4 revision=0 5 short_desc="FAT filesystem utilities (mkfs.fat, fsck.fat)" 6 maintainer="finwo <finwo@pm.me>" 7 license="GPL-3.0-or-later" 8 homepage="https://github.com/dosfstools/dosfstools" 9 distfiles="https://github.com/dosfstools/dosfstools/releases/download/v${version}/dosfstools-${version}.tar.gz" 10 checksum=64926eebf90092dca21b14259a5301b7b98e7b1943e8a201c7d726084809b527 11 depends="glibc busybox" 12 13 # Notes: 14 # - Why: the ESP is FAT, so the installer creates one on every install and a 15 # rescue image needs to be able to REPAIR one. busybox has an mkfs.vfat 16 # applet but no fsck for FAT at all, which means a corrupt ESP -- the single 17 # partition that decides whether the switch boots -- was unfixable in place. 18 # - busybox's MKFS_VFAT applet is disabled in packages/busybox/template so 19 # there is exactly one mkfs.vfat on the system. Two providers of the same 20 # command name resolved by PATH order is the kind of ambiguity that only 21 # shows up when the two behave differently; busybox's also emits codepage 22 # warnings on every run because it wants iconv data our glibc does not carry. 23 # - iconv/nls off: the codepage machinery is for long-filename charset 24 # conversion, which an ESP does not need and which our C.UTF-8-only glibc 25 # cannot satisfy anyway. 26 27 do_configure() { 28 cd "${WRKSRC}" 29 ./configure \ 30 --prefix=/usr \ 31 --sbindir=/usr/sbin \ 32 --mandir=/usr/share/man \ 33 --enable-compat-symlinks \ 34 --without-udev \ 35 --without-iconv 36 } 37 38 do_build() { 39 cd "${WRKSRC}" 40 make -j"$(nproc)" 41 } 42 43 do_install() { 44 cd "${WRKSRC}" 45 make install DESTDIR="${DESTDIR}" 46 47 rm -rf "${DESTDIR}/usr/share/doc" "${DESTDIR}/usr/share/locale" 48 49 # --enable-compat-symlinks gives the names callers actually use: 50 # installer/install.sh invokes mkfs.vfat, and fsck.vfat is what anyone 51 # reaching for a FAT repair will type. 52 for t in mkfs.fat fsck.fat mkfs.vfat fsck.vfat fatlabel; do 53 [ -e "${DESTDIR}/usr/sbin/${t}" ] || die "dosfstools: missing ${t}" 54 done 55 }