GithubHelp home page GithubHelp logo

nebulosa2007 / pkgbuilds Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 58 KB

A set of packages that I maintain on the AUR

Home Page: https://aur.archlinux.org/packages?SeB=m&K=Nebulosa

Shell 100.00%
btw-i-use-arch

pkgbuilds's Introduction

Main guideline for PKGBUILD

Other packaging guidelines & tips

Common

  • don't use custom variables when not needed (use ${pkgname%-git} instead). All custom variables should contain leading "_"
  • quoting in arch=() license=() depends=() makedepends=() depends=() is pointless and a personal choice, except when needed: optdepends=('gst-libav: additional codecs') license=('custom:WTFPL') license=('custom:corp EULA'). But always use double quotting for "$pkgdir" and "$pkgscr"
  • remember to quote variables for avoiding failures due to whitespaces in paths

pkgbase

pkgname

  • just name of the package or name-git or name-bin. Do not use custom variables for naming

pkgver

  • cut 'v' and other prefixes from pkgver

pkgrel

  • number should be increased after any edit of PKGBUILD file

pkgdesc

  • Do not add "A" at description at start, just: pkgdesc="Web user interface to manage your WireGuard setup"

arch

  • if developer of package provide other versions of arches you can add them, e.g. arch=(aarch64 armv7h i686 x86_64)

url

  • use pkgname for url - $pkgname, ${pkgname%-bin}, ${pkgname%-git}

license

  • install not common licenses in "$pkgdir"/usr/share/licenses/$pkgname, not mandatory to install common licenses; see 'licenses' package. Use proper identifier from SPDX list. For -git -bin -whatever packages use install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/${pkgname%-bin}/

groups

depends

  • All depends should be writed at new string, and brackets too:
    depends=(
      gcc-libs
      glib2
      glibc
    ...
    )
    

makedepends

  • Same as depends

checkdepends

  • Same as depends

optdepends

  • Same as depends

provides

  • Use for -git and -bin packages only but not for named packages: provides=(${pkgname%-bin}) or provides=(${pkgname%-git})

conflicts

  • Use for -git and -bin packages only but not for named packages: conflicts=(${pkgname%-bin}) or conflicts=(${pkgname%-git}) Not need to list all other packages, just write the main name

replaces

backup

options

Recommeneded: options=(!debug). And for Rust packages also need add !lto

install

changelog

source

  • prefer git+$url over git:// for taking advantage of TLS encryption

  • pkgrel is for internal use of the PKGBUILD and must not be used in source=() or as part of pkgver

  • use source_$ARCH for $ARCH specific sources

  • use a common source folder, SRCDEST= in /etc/makepkg.conf

  • add git submodules to source=(), it is a good packaging practice and make sources re-usable, especially with a common SRCDEST

  • make downloaded sources non-conflicting and re-usable, i.e.

    for Github releases use just source=($url/archive/v$pkgver/$pkgname-$pkgver.tar.gz) or source=($pkgname-$pkgver.tar.gz::$url/....) for other hostings.

    for git repository find a common ground for source name

    • for git avoid $pkgname-$pkgver::git+url/name.git (waste as redownload whole source )

    • for git avoid $pkgname::git+url/name.git when pkgname=$NAME-git (i.e. textosaurus and textosaurus-git use the same source)

    • for git avoid $pkgname::git+url/name.git when pkgname=name (pointless since source is already called 'name')

    • for ease of use when git source have uppercase name ${pkgname%-git}::git+url/Name.git

    • use source=(${pkgname%-git}::git+$url.git

noextract

validpgpkeys

Integrity

  • b2sum is the preferred hash check

prepare()

  • for packages -bin you can use additional hashsum check (if contributor of software provide it) in prepare function:
prepare(){
    md5sum -c $pkgname-$pkgver.md5
    #OR
    echo $(<*.md5) *.tar.gz | md5sum -c -
}

build()

check()

package()

Example for installing files:

install -vDm755 usr/bin/${pkgname%-bin}{,-session} -t "$pkgdir"/usr/bin/

pkgbuilds's People

Contributors

nebulosa2007 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.