PKGBUILD 4.69 KB
Newer Older
Philip Müller's avatar
Philip Müller committed
1 2 3 4 5 6 7 8 9 10 11
# Based on the file created for Arch Linux by:
# Dan McGee <dan@archlinux.org>
# Dave Reisner <dreisner@archlinux.org>

# Maintainer: Philip Müller <philm@manjaro.org>
# Maintainer: Guinux <guillaume@manjaro.org>

# Note: since we include pacman-contrib with this package we have to build pacman twice
# Example: pacsort: error while loading shared libraries

pkgname=pacman
Philip Müller's avatar
Philip Müller committed
12
pkgver=5.1.3
Philip Müller's avatar
Philip Müller committed
13
_pkgver=1.1.0
Philip Müller's avatar
Philip Müller committed
14
pkgrel=1
Philip Müller's avatar
Philip Müller committed
15 16 17 18 19 20 21 22 23
pkgdesc="A library-based package manager with dependency support"
arch=('i686' 'x86_64')
url="http://www.archlinux.org/pacman/"
license=('GPL')
groups=('base' 'base-devel')
depends=('bash>=4.2.042-2' 'glibc>=2.17-2' 'libarchive>=3.1.2' 'curl>=7.39.0'
         'gpgme' 'archlinux-keyring' 'manjaro-keyring' 'pacman-mirrors>=4.1.0')
checkdepends=('python2' 'fakechroot')
makedepends=('asciidoc' 'pacman>=5.1')
Philip Müller's avatar
Philip Müller committed
24
optdepends=('haveged: for pacman-init.service'
Philip Müller's avatar
Philip Müller committed
25 26
            'perl-locale-gettext: translation support in makepkg-template'
            'xdelta3: delta support in repo-add')
Philip Müller's avatar
Philip Müller committed
27 28 29 30 31
provides=('pacman-contrib' 'pacman-init')
conflicts=('pacman-contrib' 'pacman-init')
replaces=('pacman-contrib' 'pacman-init')
backup=(etc/pacman.conf etc/makepkg.conf)
install=pacman.install
Philip Müller's avatar
Philip Müller committed
32
options=('emptydirs' 'strip' 'debug')
Philip Müller's avatar
Philip Müller committed
33 34 35
validpgpkeys=('6645B0A8C7005E78DB1D7864F99FFE0FEAE999BD'  # Allan McRae <allan@archlinux.org>
              'B8151B117037781095514CA7BBDFFC92306B1121'  # Andrew Gregory (pacman) <andrew@archlinux.org>
              '5134EF9EAF65F95B6BB1608E50FB9B273A9D0BB5') # Johannes Löthberg <johannes@kyriasis.com>
Philip Müller's avatar
Philip Müller committed
36 37
source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig}
        #https://git.archlinux.org/pacman.git/snapshot/pacman-$_commit.tar.gz
Philip Müller's avatar
Philip Müller committed
38 39 40 41 42 43 44 45 46
        https://sources.archlinux.org/other/community/pacman-contrib/pacman-contrib-$_pkgver.tar.gz{,.asc}
        pacman.conf.i686
        pacman.conf.x86_64
        makepkg.conf
        pacman-sync-first-option.patch
        etc-pacman.d-gnupg.mount
        pacman-init.service)

prepare() {
Philip Müller's avatar
Philip Müller committed
47
  #mv $srcdir/$pkgname-$_commit $srcdir/$pkgname-$pkgver
Philip Müller's avatar
Philip Müller committed
48 49 50 51 52
  cd $srcdir/$pkgname-$pkgver

  # Manjaro patches
  patch -p1 -i $srcdir/pacman-sync-first-option.patch

Philip Müller's avatar
Philip Müller committed
53
  #./autogen.sh
Philip Müller's avatar
Philip Müller committed
54

Philip Müller's avatar
Philip Müller committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
  ./configure --prefix=/usr --sysconfdir=/etc \
    --localstatedir=/var --enable-doc \
    --with-scriptlet-shell=/usr/bin/bash \
    --with-ldconfig=/usr/bin/ldconfig
}

build() {
  cd $srcdir/$pkgname-$pkgver
  make V=1

  cd $srcdir/pacman-contrib-$_pkgver

  ./configure \
      --prefix=/usr \
      --sysconfdir=/etc \
      --localstatedir=/var
  make
}

check() {
  make -C "$pkgname-$pkgver" check
  make -C pacman-contrib-$_pkgver check
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make DESTDIR=$pkgdir install

  # install Arch specific stuff
  install -dm755 $pkgdir/etc
  install -m644 $srcdir/pacman.conf.$CARCH $pkgdir/etc/pacman.conf
  
  case "$CARCH" in
    i686)    
      mycarch="i686"
      mychost="i686-pc-linux-gnu"
      myflags="-march=i686"
      ;;
    x86_64)
      mycarch="x86_64"
      mychost="x86_64-pc-linux-gnu"
      myflags="-march=x86-64"
      ;;
  esac
  install -m644 $srcdir/makepkg.conf $pkgdir/etc/
  # set things correctly in the default conf file
  sed -i $pkgdir/etc/makepkg.conf \
    -e "s|@CARCH[@]|$mycarch|g" \
    -e "s|@CHOST[@]|$mychost|g" \
    -e "s|@CARCHFLAGS[@]|$myflags|g"
Philip Müller's avatar
Philip Müller committed
105 106 107 108 109 110 111 112 113

  # put bash_completion in the right location
  install -dm755 "$pkgdir/usr/share/bash-completion/completions"
  mv "$pkgdir/etc/bash_completion.d/pacman" "$pkgdir/usr/share/bash-completion/completions"
  rmdir "$pkgdir/etc/bash_completion.d"

  for f in makepkg pacman-key; do
    ln -s pacman "$pkgdir/usr/share/bash-completion/completions/$f"
  done
Philip Müller's avatar
Philip Müller committed
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
    
  # install pacman-init
  install -dm755 $pkgdir/usr/lib/systemd/system/
  install -m644 $srcdir/etc-pacman.d-gnupg.mount $pkgdir/usr/lib/systemd/system/etc-pacman.d-gnupg.mount
  install -m644 $srcdir/pacman-init.service $pkgdir/usr/lib/systemd/system/pacman-init.service

  cd $srcdir/pacman-contrib-$_pkgver

  make DESTDIR="$pkgdir" install

  # replace rankmirrors
  rm "$pkgdir/usr/bin/rankmirrors"
  ln -sfv "/usr/bin/pacman-mirrors" "$pkgdir/usr/bin/rankmirrors"
}

Philip Müller's avatar
Philip Müller committed
129
sha256sums=('10db61a0928d619871340c3f93a677d1541d6c52353c516aec4f8d96e830d4eb'
Philip Müller's avatar
Philip Müller committed
130
            'SKIP'
Philip Müller's avatar
Philip Müller committed
131
            '308c3b8dc15ed8bd419cba1eb3103afe9250cf415626334a0c3a753b550549a6'
Philip Müller's avatar
Philip Müller committed
132
            'SKIP'
Philip Müller's avatar
Philip Müller committed
133 134
            '4421dc5d63a24e926852c1ea83b575355772aaa2add71cc522cd04ca22b131d6'
            'a9f21ebe59f1a2c8309145930ee96b8e3dc6e96e150fb77269d9958a80550950'
Philip Müller's avatar
Philip Müller committed
135
            'eec71e0b23f2ac1f06ad6ec5890d9de62effe0883ffd16573eed2153d0c87475'
Philip Müller's avatar
Philip Müller committed
136
            'fe0901a02d34ccf288743397fa32526f6dd878db8337e666082bced10e24e754'
Philip Müller's avatar
Philip Müller committed
137 138
            'b6d14727ec465bb66d0a0358163b1bbfafcb4eaed55a0f57c30aabafae7eed68'
            '65d8bdccdcccb64ae05160b5d1e7f3e45e1887baf89dda36c1bd44c62442f91b')