void-packages

Void Source Packages
git clone git://ezup.dev/void-packages.git
Log | Files | Refs | README | LICENSE

10-pkglint-devel-paths.sh (2830B)


      1# vim: set ts=4 sw=4 et:
      2#
      3# This hook executes the following tasks:
      4#   - Looks on non -devel packages for files that should be in the -devel package
      5#   - Searches for solinks (.so) and archives (.a) on usr/lib
      6#   - Searches for executables in usr/bin that end with -config and a respective manpage
      7
      8hook() {
      9    local solink archive
     10
     11    if [[ "$pkgname" == *"-devel" ]]; then
     12        return 0
     13    fi
     14
     15    if [[ "$subpackages" != *"-devel" ]]; then
     16        return 0
     17    fi
     18
     19    for f in $(find $PKGDESTDIR -type d); do
     20        case "${f#$PKGDESTDIR}" in
     21            /usr/include)
     22                msg_warn "usr/include should be in -devel package\n"
     23                ;;
     24            /usr/share/pkgconfig)
     25                msg_warn "usr/share/pkgconfig should be in -devel package\n"
     26                ;;
     27            /usr/lib/pkgconfig)
     28                msg_warn "usr/lib/pkgconfig should be in -devel package\n"
     29                ;;
     30            /usr/share/vala)
     31                msg_warn "usr/share/vala should be in -devel package\n"
     32                ;;
     33            /usr/share/gir-1.0)
     34                msg_warn "usr/share/gir-1.0 should be in -devel package\n"
     35                ;;
     36            /usr/share/man/man3)
     37                msg_warn "usr/share/man/man3 should be in -devel package\n"
     38                ;;
     39            /usr/share/aclocal)
     40                msg_warn "usr/share/aclocal should be in -devel package\n"
     41                ;;
     42            /usr/share/cmake)
     43                msg_warn "usr/share/cmake should be in -devel package\n"
     44                ;;
     45            /usr/lib/cmake)
     46                msg_warn "usr/lib/cmake should be in -devel package\n"
     47                ;;
     48            /usr/share/gtk-doc)
     49                msg_warn "usr/share/gtk-doc should be in -devel package\n"
     50                ;;
     51            /usr/lib/qt5/mkspecs)
     52                msg_warn "usr/lib/qt5/mkspecs should be in -devel package\n"
     53                ;;
     54        esac
     55    done
     56
     57    if [ -n "$(find $PKGDESTDIR/usr/lib -maxdepth 1 -type l -iname '*.so' 2>/dev/null)" ]; then
     58        solink=1
     59    fi
     60
     61    if [ -n "$(find $PKGDESTDIR/usr/lib -maxdepth 1 -type f -iname '*.a' 2>/dev/null)" ]; then
     62        archive=1
     63    fi
     64
     65    if [ -d $PKGDESTDIR/usr/bin ]; then
     66        for x in $(find $PKGDESTDIR/usr/bin -type f -executable -iname '*-config'); do
     67            msg_warn "${x#$PKGDESTDIR\/} should be in -devel package\n"
     68        done
     69    fi
     70
     71    if [ -d $PKGDESTDIR/usr/man/man1 ]; then
     72        for m in $(find $PKGDESTDIR/usr/man/man1 -type f -iname '*-config.1'); do
     73            msg_warn "${m#$PKGDESTDIR\/} should be in -devel package\n"
     74        done
     75    fi
     76
     77    if [ -n "$solink" ]; then
     78        msg_warn "usr/lib/*.so should be in -devel package\n"
     79    fi
     80
     81    if [ -n "$archive" ]; then
     82        msg_warn "usr/lib/*.a should be in -devel package\n"
     83    fi
     84}