PKGBUILD文件内容如下
2013-07-02 修正
===============================================================
# $Id: PKGBUILD 2013-06-26 GunsNRose $
# Maintainer: GunsNRose <zlbgps AT gmail.com>
# Contributor: GunsNRose <zlbgps AT gmail.com>
pkgname=exfat-nofuse-git
_pkgname=${pkgname/-git}
pkgver=20130626
pkgrel=1
pkgdesc="Free exFAT file system implementation kernel module"
arch=('i686' 'x86_64')
url="https://github.com/rxrz/exfat-nofuse"
license=('GPL3')
depends=('linux>=3.9' 'linux<3.10')
makedepends=('git' 'linux-headers>=3.9' 'linux-headers<3.10')
install="${_pkgname}.install"
optdepends=('exfat-utils: utilities for exFAT file system'
'util-linux: to mount exFAT volumes automatically')
_gitroot="https://github.com/rxrz/${_pkgname}.git"
_gitname="$_pkgname"
build() {
echo "_pkgname = ${_pkgname}"
cd $srcdir
if [ -d $_gitname ]; then
cd $_gitname && git pull origin || return 1
else
git clone $_gitroot || return 1
fi
cd $srcdir/$_gitname
export LC_ALL=C
export LANG=C
_kernver=${_kernver:-$(uname -r)}
_extramodules=$(readlink -f "/usr/lib/modules/${_kernver}/extramodules" || true)
_kernver=$(< "${_extramodules}/version")
echo "<<<<< _kernver = $_kernver >>>>>>"
make || return 1
}
package() {
cd "$srcdir/$_gitname" || return 1
_kernver=${_kernver:-$(uname -r)}
_extramodules=$(readlink -f "/usr/lib/modules/${_kernver}/extramodules" || true)
_kernver=$(< "${_extramodules}/version")
# replace ${pkgname}-${pkgver} -->>> ${_pkgname}
make -C "${_extramodules%/*}/${_kernver}/build" \
INSTALL_MOD_PATH="${pkgdir}/${_extramodules%%/lib/*}" \
M="${srcdir}/${_pkgname}" modules_install
cd "${pkgdir}/${_extramodules%/*}"
mv "${_kernver}/extra" "${_extramodules##*/}"
rmdir "${_kernver}"
# compress kernel modules
find "${pkgdir}" -name "*.ko" -exec gzip -9 {} +
# load module on startup
echo exfat-fs > "${srcdir}/${_pkgname}.conf"
install -Dm644 "${srcdir}/${_pkgname}.conf" "${pkgdir}/usr/lib/modules-load.d/${_pkgname}.conf"
# update kernel version in install file
sed -ri "s#^(extramodules=).*\$#\1${_extramodules}#" "${startdir}/${_pkgname}.install"
}
===============================================================
exfat-nofuse.install 文件内容
-------------------------------------------------------------------------------------------
extramodules=/usr/lib/modules/extramodules-3.9-ARCH
post_install() {
depmod -v $(< "$extramodules/version") &>/dev/null
}
post_upgrade() {
post_install
}
post_remove() {
post_install
}
===============================================================