PKGBUILD 5.27 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.2.1
Philip Müller's avatar
Philip Müller committed
13
_pkgver=1.3.0
Philip Müller's avatar
Philip Müller committed
14
_commit=
Philip Müller's avatar
Philip Müller committed
15
pkgrel=7
Philip Müller's avatar
Philip Müller committed
16 17 18 19
pkgdesc="A library-based package manager with dependency support"
arch=('i686' 'x86_64')
url="http://www.archlinux.org/pacman/"
license=('GPL')
20
groups=('base-devel')
Philip Müller's avatar
Philip Müller committed
21 22 23
depends=('bash' 'glibc' 'libarchive' 'curl' 'perl' 'gpgme' 'archlinux-keyring'
         'manjaro-keyring' 'pacman-mirrors>=4.1.0')
checkdepends=('python' 'fakechroot')
24
makedepends=('asciidoc' 'pacman>=5.2')
Philip Müller's avatar
Philip Müller committed
25
optdepends=('haveged: for pacman-init.service'
Philip Müller's avatar
Philip Müller committed
26 27
            'perl-locale-gettext: translation support in makepkg-template')
provides=('pacman-contrib' 'pacman-init' 'libalpm.so')
Philip Müller's avatar
Philip Müller committed
28 29 30 31
conflicts=('pacman-contrib' 'pacman-init')
replaces=('pacman-contrib' 'pacman-init')
backup=(etc/pacman.conf etc/makepkg.conf)
install=pacman.install
32
options=('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>
36

Philip Müller's avatar
Philip Müller committed
37 38
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
39
        https://git.archlinux.org/pacman-contrib.git/snapshot/pacman-contrib-$_pkgver.tar.{gz,asc}
Philip Müller's avatar
Philip Müller committed
40 41 42 43
        pacman.conf.i686
        pacman.conf.x86_64
        makepkg.conf
        pacman-sync-first-option.patch
Philip Müller's avatar
Philip Müller committed
44
        pacman-max-size-32MB.patch
Bernhard Landauer's avatar
Bernhard Landauer committed
45
        pacman-5.2.1-fix-pactest-package-tar-format.patch::https://git.archlinux.org/pacman.git/patch/?id=b9faf652735c603d1bdf849a570185eb721f11c1
Helmut Stult's avatar
Helmut Stult committed
46
        pacman-5.2.1-reproducible-libprovides.patch::https://git.archlinux.org/pacman.git/patch/?id=8ce142a2552418f64a74e773f659d92b065d6209
Bernhard Landauer's avatar
Bernhard Landauer committed
47
        makepkg-fix-one-more-file-seccomp-issue.patch
Philip Müller's avatar
Philip Müller committed
48 49
        etc-pacman.d-gnupg.mount
        pacman-init.service)
Bernhard Landauer's avatar
Bernhard Landauer committed
50 51
sha256sums=('1930c407265fd039cb3a8e6edc82f69e122aa9239d216d9d57b9d1b9315af312'
            'SKIP'
Philip Müller's avatar
Philip Müller committed
52
            '2b8f614651dbe272c9b518c73e53fc194405c06fd8637159a8ac9012c84e9452'
Bernhard Landauer's avatar
Bernhard Landauer committed
53 54 55 56 57 58
            'SKIP'
            '7e0aa0144d9677ce4fa9e4a53d3007e8e6d3b96ce61639e65a2cd91e37f1664b'
            'b6eb7e06c60f599dc3a1474828a4e8ee79f7c08dfe51cdbd8835b005e6079fa9'
            '0aee6e468944bfd2b1a2f23423b923a92bdf6bf11bb02321a2dbda8090cb7999'
            '8167155d3a3e15fc4a1b1e989fdb826779e7b3690a52e2ca9d307ae0b1550e1d'
            'd36d49f7579202b55e6003fa2ab141b58bd26fa685479424621f42425a994e86'
Helmut Stult's avatar
Helmut Stult committed
59 60
            '41c582be4400f7de27530ff164cef7ea09996e4c63a59ea72d3d522104be8e9c'
            'de4a35cd0b9c6dd85a318f6bd9c3e3a8155fca4e92c1035f3f2f6c2e8df2d1aa'
Bernhard Landauer's avatar
Bernhard Landauer committed
61 62 63
            '83a4dd9ddff7611f2336636b4196a5ad7229f7e2866140160f19204d8350a2ee'
            'b6d14727ec465bb66d0a0358163b1bbfafcb4eaed55a0f57c30aabafae7eed68'
            '65d8bdccdcccb64ae05160b5d1e7f3e45e1887baf89dda36c1bd44c62442f91b')
Philip Müller's avatar
Philip Müller committed
64
prepare() {
Philip Müller's avatar
Philip Müller committed
65
  #mv $srcdir/$pkgname-$_commit $srcdir/$pkgname-$pkgver
66
  cd $pkgname-$pkgver
Philip Müller's avatar
Philip Müller committed
67 68 69 70

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

Bernhard Landauer's avatar
Bernhard Landauer committed
71
  # Manjaro Community Repo exceeds 25 MB of db.files
Philip Müller's avatar
Philip Müller committed
72 73
  patch -p1 -i $srcdir/pacman-max-size-32MB.patch

Bernhard Landauer's avatar
Bernhard Landauer committed
74 75 76
  # Archlinux patches
  patch -Np1 < ../pacman-5.2.1-fix-pactest-package-tar-format.patch
  patch -Np1 < ../makepkg-fix-one-more-file-seccomp-issue.patch
Helmut Stult's avatar
Helmut Stult committed
77
  patch -Np1 < ../pacman-5.2.1-reproducible-libprovides.patch
Bernhard Landauer's avatar
Bernhard Landauer committed
78

Philip Müller's avatar
Philip Müller committed
79
  cd $srcdir/pacman-contrib-$_pkgver
Philip Müller's avatar
Philip Müller committed
80 81 82 83
  ./autogen.sh
}

build() {
84
  cd $pkgname-$pkgver
Philip Müller's avatar
Philip Müller committed
85

86 87 88 89 90
  ./configure --prefix=/usr --sysconfdir=/etc \
    --localstatedir=/var --enable-doc \
    --with-scriptlet-shell=/usr/bin/bash \
    --with-ldconfig=/usr/bin/ldconfig
  make V=1
Philip Müller's avatar
Philip Müller committed
91 92

  cd $srcdir/pacman-contrib-$_pkgver
93 94 95 96 97

  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var
Philip Müller's avatar
Philip Müller committed
98 99 100 101
  make
}

check() {
102 103
#  make -C "$pkgname-$pkgver" check
  make -C pacman-contrib-$_pkgver check
Philip Müller's avatar
Philip Müller committed
104 105 106
}

package() {
107
  cd $srcdir/$pkgname-$pkgver
Philip Müller's avatar
Philip Müller committed
108

109
  make DESTDIR=$pkgdir install
Philip Müller's avatar
Philip Müller committed
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132

  # 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
133

Philip Müller's avatar
Philip Müller committed
134 135 136 137 138 139 140 141 142 143 144 145 146
  # 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"
}