Hacking:Common packaging mistakes

From ParabolaWiki
Jump to: navigation, search

Here's a list of common packaging mistakes.

  • It's become convention to indent with two spaces. Not doing that isn't a mistake per se, but consistency is nice.
  • Make sure you have a line beginning with "# Maintainer: ". Also having things like "# Maintainer (AUR): " is fine, but "# Maintainer (Parabola): " isn't a substitute for the plain version. A few packages do that; it's a mistake (popularized by lukeshu).
  • Every instance of srcdir and pkgdir should be double-quoted.
  • Network access cannot be used during build() or package(). (This is enforced by libremakepkg).
  • If a package is named in depends, then it does not need to be mentioned in makedepends.
  • Packages in base do not need to be mentioned in depends, unless the package being built is also in base (but they may need to be mentioned in makedepends).
  • Packages in base-devel do not need to be mentioned in makedepends, unless the package being built is also in base-devel (but they may need to be mentioned in depends).
  • The files in install= and changelog= should not be mentioned in source=()
  • When creating a replacement for a package in a group, don't have the replacement be in the same group. Groups cannot contain conflicting members.
  • The best practices for VCS packages have changed quite a bit.
    • The no-no's:
      • Don't use _gitroot and similar "underscore" variables (even though they are recommended in /usr/share/pacman/). They are deprecated in Arch as of pacman 4.1, require network during build(), and over-complicate things.
      • Don't have 'SKIP' entries in md5sums, except for *.sig and *.asc files.
        • That means don't use makepkg 4.1 VCS URLs directly in source=(), put them in mksource or a SRCBUILD instead.
      • Don't track a "branch", make sure you reference a specific commit or tag.
    • Luke's current recommendation:
      • Make sure you have libretools installed (If you are a packager, you should have done this anyway.)
      • set source=("https://repo.parabolagnulinux.org/other/$pkgname/$pkgname-$pkgver.tar.gz") (use other/~username/ for personal repos) librefetch will know to automatically generate the file for you if it doesn't exist.
      • set mksource=("$pkgname-$pkgver::VCS-URL")
      • set mkmd5sums=('SKIP')
      • set md5sums with makepkg -g like any other package.
      • librestage/librerelease will also upload the generated source file for you.