Difference between revisions of "PKGBUILD Templates"

From ArchWiki
Jump to: navigation, search
(Basic PKGBUILD with Links and Comments added a coment about ${pakage}::source)
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
[[Category:Package development]]
 
[[Category:Package development]]
 
 
== Basic PKGBUILD ==
 
== Basic PKGBUILD ==
  
You can find prototype package builds and .install files in '''/usr/share/pacman'''
+
You can find prototype package build and .install files in {{ic|/usr/share/pacman}}.
  
 
  # Maintainer: Your Name <youremail@domain.com>
 
  # Maintainer: Your Name <youremail@domain.com>
Line 45: Line 44:
 
  # Maintainer: Your Name <your email>
 
  # Maintainer: Your Name <your email>
 
   
 
   
  # Name of the Software your PKGBUILD will install - should be unique
+
  # Name of the Software your PKGBUILD will install - should be unique. See [[PKGBUILD#pkgname]]
  pkgname=Derp
+
  pkgname=derp
 
   
 
   
 
  # The version number for the software
 
  # The version number for the software
Line 52: Line 51:
 
   
 
   
 
  #The release number for the arch package, as fixes are added to the PKGBUILD, the release number will increase
 
  #The release number for the arch package, as fixes are added to the PKGBUILD, the release number will increase
  pkgrel=900
+
  pkgrel=9001
 
   
 
   
 
  # The description of the package, should be about 80 characters long (one line)
 
  # The description of the package, should be about 80 characters long (one line)
Line 61: Line 60:
 
   
 
   
 
  # The official website for the software your PKGBUILD will install
 
  # The official website for the software your PKGBUILD will install
  url="http://archlinux.org"
+
  url="https://archlinux.org"
 
   
 
   
 
  # The License that the software is released under. See [[PKGBUILD#license]]
 
  # The License that the software is released under. See [[PKGBUILD#license]]
  license=('GPLv3')
+
  license=('GPL3')
 
   
 
   
 
  # The group a package belongs in. An example would be kdebase (install all the KDE  packages)
 
  # The group a package belongs in. An example would be kdebase (install all the KDE  packages)
  groups=allyourbase
+
  groups=allyourdatabasearebelongtous
 
   
 
   
 
  # Packages that your software needs to run. If the dependancy requires a minimum version number use the >= operator
 
  # Packages that your software needs to run. If the dependancy requires a minimum version number use the >= operator
Line 73: Line 72:
 
   
 
   
 
  # Packages that must be installed to build the software, but at not necessary to run it
 
  # Packages that must be installed to build the software, but at not necessary to run it
  makedepends=('supercompiler300')
+
  makedepends=('pony' 'wings' 'horns' 'supercompany2600')
 
   
 
   
 
  # Optional packages that extend the software's functionality
 
  # Optional packages that extend the software's functionality
  optdepends=('derp-toolbar: a browser plugin')
+
  optdepends=('derp-hoofbar: a browser plugin')
 
   
 
   
 
  # List of Package names that this PKGBUILD provides. Put modified packages that will be installed here.
 
  # List of Package names that this PKGBUILD provides. Put modified packages that will be installed here.
Line 82: Line 81:
 
   
 
   
 
  # Packages that cannot be installed at the same time as this package
 
  # Packages that cannot be installed at the same time as this package
  conflicts=('foobar')
+
  conflicts=('pegasi')
 
   
 
   
 
  # Obsolete Packages that this Package replaces
 
  # Obsolete Packages that this Package replaces
  replaces=('dur')
+
  replaces=('dinky')
 
   
 
   
 
  # User files that should be saved. They are kept as [[Pacnew and Pacsave Files]]
 
  # User files that should be saved. They are kept as [[Pacnew and Pacsave Files]]
Line 94: Line 93:
 
   
 
   
 
  install='foo.install'
 
  install='foo.install'
  source=("http://server.tl;dr/${pkgname}-${pkgver}.tar.gz"
+
 +
# Source for the package, you can specify a folder (for git or download name to overriding the default
 +
# name saved useful if the upstream use tarballs named 'pinkieþæý' for example
 +
  source=("${pkgname}.tar.gz::http://server.tl;dr/${pkgname}-${pkgver}.tar.gz"
 
         "derp.desktop")
 
         "derp.desktop")
 
  md5sums=('a0b2c3d4e5f6g7h8i9'
 
  md5sums=('a0b2c3d4e5f6g7h8i9'
 
           'j10k11l12m13n14o15')
 
           'j10k11l12m13n14o15')
 +
 +
For more details, see [[PKGBUILD]].

Revision as of 19:33, 30 October 2013

Basic PKGBUILD

You can find prototype package build and .install files in /usr/share/pacman.

# Maintainer: Your Name <youremail@domain.com>
pkgname=NAME
pkgver=VERSION
pkgrel=1
pkgdesc=""
arch=()
url=""
license=('GPL')
groups=()
depends=()
makedepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=(http://server/$pkgname-$pkgver.tar.gz)
noextract=()
md5sums=() #generate with 'makepkg -g'

build() {
  cd "$srcdir/$pkgname-$pkgver"

  ./configure --prefix=/usr
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make DESTDIR="$pkgdir/" install
}

Basic PKGBUILD with Links and Comments

# Maintainer: Your Name <your email>

# Name of the Software your PKGBUILD will install - should be unique. See PKGBUILD#pkgname
pkgname=derp

# The version number for the software
pkgver=6.6.6

#The release number for the arch package, as fixes are added to the PKGBUILD, the release number will increase
pkgrel=9001

# The description of the package, should be about 80 characters long (one line)
pkgdesc="Derp is an example package for this PKGBUILD file."

# The type of processor this software can build and work on. See PKGBUILD#arch
arch=('i686' 'x86_64')

# The official website for the software your PKGBUILD will install
url="https://archlinux.org"

# The License that the software is released under. See PKGBUILD#license
license=('GPL3')

# The group a package belongs in. An example would be kdebase (install all the KDE  packages)
groups=allyourdatabasearebelongtous

# Packages that your software needs to run. If the dependancy requires a minimum version number use the >= operator
depends=('herp' 'fuuuuu>=2.0')

# Packages that must be installed to build the software, but at not necessary to run it
makedepends=('pony' 'wings' 'horns' 'supercompany2600')

# Optional packages that extend the software's functionality
optdepends=('derp-hoofbar: a browser plugin')

# List of Package names that this PKGBUILD provides. Put modified packages that will be installed here.
provides=('lol-git')

# Packages that cannot be installed at the same time as this package
conflicts=('pegasi')

# Obsolete Packages that this Package replaces
replaces=('dinky')

# User files that should be saved. They are kept as Pacnew and Pacsave Files
backup=('etc/derp.conf')

# Change the default behavior of makepkg see PKGBUILD#options
options=

install='foo.install'

# Source for the package, you can specify a folder (for git or download name to overriding the default
# name saved useful if the upstream use tarballs named 'pinkieþæý' for example
source=("${pkgname}.tar.gz::http://server.tl;dr/${pkgname}-${pkgver}.tar.gz"
        "derp.desktop")
md5sums=('a0b2c3d4e5f6g7h8i9'
         'j10k11l12m13n14o15')

For more details, see PKGBUILD.