PKGBUILD 3.54 KB
Newer Older
Xuetian Weng's avatar
Xuetian Weng committed
1 2
pkgname=lib32-systemd
_pkgbasename=systemd
Xuetian Weng's avatar
Xuetian Weng committed
3
# latest commit on stable branch
4
_commit='63f95c0297aea62ce47d1389e5221c54992f580e'
Xuetian Weng's avatar
Xuetian Weng committed
5 6
# Bump this to latest major release for signed tag verification,
# the commit count is handled by pkgver() function.
7
pkgver=239.303
Xuetian Weng's avatar
Xuetian Weng committed
8
pkgrel=1
Xuetian Weng's avatar
Xuetian Weng committed
9 10
pkgdesc="system and service manager (32-bit)"
arch=('x86_64')
Xuetian Weng's avatar
Xuetian Weng committed
11 12
url="https://www.github.com/systemd/systemd"
license=('GPL2' 'LGPL2.1')
Xuetian Weng's avatar
Xuetian Weng committed
13
depends=('lib32-gcc-libs' 'lib32-libcap' 'lib32-libgcrypt' 'lib32-xz' "$_pkgbasename=$pkgver")
14
makedepends=('git' 'gperf' 'intltool' 'lib32-acl' 'lib32-bzip2'
Xuetian Weng's avatar
Xuetian Weng committed
15 16 17
             'lib32-curl' 'lib32-libdbus' 'lib32-gcc-libs' 'lib32-glib2'
             'lib32-gnutls' 'lib32-libelf' 'lib32-libidn' 'lib32-pcre2'
             'libxslt' 'meson')
Xuetian Weng's avatar
Xuetian Weng committed
18
options=('strip')
Xuetian Weng's avatar
Xuetian Weng committed
19 20
validpgpkeys=('63CDA1E5D3FC22B998D20DD6327F26951A015CC4'  # Lennart Poettering <lennart@poettering.net>
              '5C251B5FC54EB2F80F407AAAC54CA336CFEB557E') # Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Luca Giambonini's avatar
Luca Giambonini committed
21 22 23
source=(# fragment is latest tag for source verification, final merge in prepare()
        "git+https://github.com/systemd/systemd-stable#tag=v${pkgver%.*}"
        "git+https://github.com/systemd/systemd#tag=v${pkgver%.*}")
Xuetian Weng's avatar
Xuetian Weng committed
24
sha256sums=('SKIP'
Luca Giambonini's avatar
Luca Giambonini committed
25
            'SKIP')
Xuetian Weng's avatar
Xuetian Weng committed
26 27 28 29 30 31 32

_backports=(
)

_reverts=(
)

Xuetian Weng's avatar
Xuetian Weng committed
33 34 35
prepare() {
  cd "$_pkgbasename-stable"

Luca Giambonini's avatar
Luca Giambonini committed
36
  # add upstream repository for cherry-picking
Xuetian Weng's avatar
Xuetian Weng committed
37 38
  git remote rm upstream || true
  git remote add -f upstream ../systemd
Luca Giambonini's avatar
Luca Giambonini committed
39 40 41
  # merge the latest stable commit (fast-foward only to make sure
  # the verified tag is in)
  git merge --ff-only "${_commit}"
Xuetian Weng's avatar
Xuetian Weng committed
42 43 44 45 46 47 48 49

  local c
  for c in "${_backports[@]}"; do
    git cherry-pick -n "$c"
  done
  for c in "${_reverts[@]}"; do
    git revert -n "$c"
  done
Xuetian Weng's avatar
Xuetian Weng committed
50 51 52 53 54 55 56 57 58 59 60
}

pkgver() {
  local version count

  cd "$_pkgbasename-stable"

  version="$(git describe --abbrev=0 --tags)"
  count="$(git rev-list --count ${version}..)"
  printf '%s.%s' "${version#v}" "${count}"
}
61

Xuetian Weng's avatar
Xuetian Weng committed
62
build() {
Xuetian Weng's avatar
Xuetian Weng committed
63 64 65 66
  export CC="gcc -m32"
  export CXX="g++ -m32"
  export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"

Luca Giambonini's avatar
Luca Giambonini committed
67
  local _timeservers=({0..3}.chakra.pool.ntp.org)
68 69 70 71 72 73 74 75 76 77 78 79 80
  local _nameservers=(
    # We use these public name services, ordered by their
    # privacy policy (hopefully):
    #  * Cloudflare (https://1.1.1.1/)
    #  * Quad9 without filtering (https://www.quad9.net/)
    #  * Google (https://developers.google.com/speed/public-dns/)
    1.1.1.1
    9.9.9.10
    8.8.8.8
    2606:4700:4700::1111
    2620:fe::10
    2001:4860:4860::8888
  )
81

Xuetian Weng's avatar
Xuetian Weng committed
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
  local meson_options=(
    --libexecdir	/usr/lib32
    --libdir		/usr/lib32

    -Daudit=false
    -Dgnuefi=false
    -Dima=false
    -Dlz4=false
    -Dblkid=false
    -Dkmod=false
    -Dlibcryptsetup=false
    -Dlibiptc=false
    -Dmanpages=false
    -Dnetworkd=false
    -Dpam=false
    -Dpython=false
    -Dseccomp=false
    -Dman=false
    -Dhtml=false
    -Dmicrohttpd=false
    -Dqrencode=false
    -Dxkbcommon=false

    -Ddbuspolicydir=/usr/share/dbus-1/system.d
    -Ddefault-dnssec=no
    # TODO(dreisner): consider changing this to unified
    -Ddefault-hierarchy=hybrid
    -Ddefault-kill-user-processes=false
110
    -Dfallback-hostname='chakralinux'
Luca Giambonini's avatar
Luca Giambonini committed
111
    -Dntp-servers="${_timeservers[*]}"
112
    -Ddns-servers="${_nameservers[*]}"
Xuetian Weng's avatar
Xuetian Weng committed
113 114 115 116 117 118 119 120
    -Drpmmacrosdir=no
    -Dsysvinit-path=
    -Dsysvrcnd-path=
  )

  chakra-meson "$_pkgbasename-stable" build "${meson_options[@]}"

  ninja -C build
Xuetian Weng's avatar
Xuetian Weng committed
121 122
}

123 124 125 126
check() {
  meson test -C build
}

Xuetian Weng's avatar
Xuetian Weng committed
127
package() {
128
  DESTDIR="$pkgdir" meson install -C build
Xuetian Weng's avatar
Xuetian Weng committed
129

Xuetian Weng's avatar
Xuetian Weng committed
130
  rm -rf "${pkgdir}"/{etc,var}
131
  rm -rf "${pkgdir}"/usr/{bin,sbin,include,lib,share}
132 133 134

  install -m755 -d "${pkgdir}/usr/share/licenses"
  ln -s systemd "$pkgdir/usr/share/licenses/lib32-systemd"
Xuetian Weng's avatar
Xuetian Weng committed
135
}