diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh index f7934acebec..20b8fe799a9 100644 --- a/common/hooks/pre-pkg/99-pkglint.sh +++ b/common/hooks/pre-pkg/99-pkglint.sh @@ -13,10 +13,12 @@ hook() { error=1 fi done + if [ -d ${PKGDESTDIR}/usr/sbin ]; then msg_red "${pkgver}: /usr/sbin directory is not allowed, use /usr/bin.\n" error=1 fi + for f in sys dev home root run var/run tmp usr/lib64 usr/local; do if [ -d ${PKGDESTDIR}/${f} ]; then msg_red "${pkgver}: /${f} directory is not allowed, remove it!\n" @@ -39,6 +41,28 @@ hook() { error=1 fi + # Prevent packages from installing to these paths in etc, they should use + # their equivalent in usr/lib + for f in udev/{rules.d,hwdb.d} modprobe.d sysctl.d; do + if [ -d ${PKGDESTDIR}/etc/${f} ]; then + msg_red "${pkgver}: /etc/${f} is forbidden. Use /usr/lib/${f}\n" + error=1 + fi + done + + # Likewise with the comment above but for usr/share + for f in X11/xorg.conf.d gconf/schemas; do + if [ -d ${PKGDESTDIR}/etc/${f} ]; then + msg_red "${pkgver}: /etc/${f} is forbidden. Use /usr/share/${f}\n" + error=1 + fi + done + + if [ -d ${PKGDESTDIR}/etc/dracut.conf.d ]; then + msg_red "${pkgver}: /etc/dracut.conf.d is forbidden. Use /usr/lib/dracut/dracut.conf.d\n" + error=1 + fi + # Forbid empty packages unless build_style=meta if [ "$build_style" != "meta" ]; then if [ "$(find $PKGDESTDIR/* -maxdepth 1 -type d 2>/dev/null)" = "" ]; then