abinfo "Generating documentation ..."
cmake --build "$SRCDIR" -- docs

install -dv "$PKGDIR"/usr/share/{doc/physfs,man/man3}
install -Dvm644 "$SRCDIR"/docs/html/* "$PKGDIR"/usr/share/doc/physfs
install -Dvm644 "$SRCDIR"/docs/man/man3/* "$PKGDIR"/usr/share/man/man3

for i in author Deinit description extension Free Init major Malloc minor \
         opaque patch Realloc remove url version deprecated; do
    mv -v "$PKGDIR"/usr/share/man/man3/$i.3 "$PKGDIR"/usr/share/man/man3/PHYSFS_$i.3
done
