summaryrefslogtreecommitdiff
path: root/nonsystemd/elogind/PKGBUILD
blob: cf3e8cf0faeba577ba722cd1905fd616bdbb3080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Maintainer: David P. <megver83@parabola.nu>
# Contributor: Luke Shumaker <lukeshu@parabola.nu>
# Maintainer (Artix): artoo <artoo@artixlinux.org>

# This package comes from Artix
# Parabola changes:
# - elogind and libelogind: do not provide {lib,}elogind=$pkgver, it's ridiculous
# - libelogind: make libsystemd.so a copy of libelogind.so instead of linking it,
#   so in that way it will provide the correct version according to the
#   architecture (libsystemd.so=0-64 or libsystemd.so=0-32)
# - remove prepare()

pkgbase=elogind
pkgname=('elogind' 'libelogind')
pkgver=246.10
pkgrel=2
pkgdesc="The systemd project's logind, extracted to a standalone package"
arch=('x86_64')
arch+=('i686' 'armv7h')
url="https://github.com/elogind/elogind"
license=('GPL' 'LGPL2.1')
makedepends=('acl' 'intltool' 'libtool' 'gperf' 'gtk-doc' 'polkit' 'dbus'
            'libseccomp' 'meson' 'kexec-tools' 'openrc' 'libcap')
options=('!libtool')
source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/elogind/elogind/archive/v${pkgver}.tar.gz"
        #'elogind.confd' 'elogind.initd'
        'elogind.sv.initd')
sha256sums=('c490dc158c8f5bca8d00ecfcc7ad5af24d1c7b9e59990a0b3b1323996221a922'
            'b4097e85f81f37d8529eb57563813e94b7c7afb9931d892907d805093187761b')

build() {
    local meson_options=(
        -Drootlibdir=/usr/lib
        -Drootlibexecdir=/usr/lib/elogind
        -Ddbuspolicydir=/usr/share/dbus-1/system.d
        -Ddocdir=/usr/share/doc/elogind
        -Ddefault-hierarchy=hybrid
        -Dcgroup-controller=openrc
        -Ddefault-kill-user-processes=false
        -Dman=true
    )

    arch-meson "$pkgbase-${pkgver}" build "${meson_options[@]}"

    ninja -C build
}

check(){
    meson test -C build --print-errorlogs
}

package_elogind() {
    pkgdesc="The systemd project's logind, extracted to a standalone package"
    provides=("systemd=${pkgver}" 'logind')
    depends=('acl' 'dbus' 'libseccomp' 'libelogind' 'kexec-tools' 'udev')
    optdepends=('polkit: polkit support')
    backup=('etc/elogind/logind.conf')

    provides+=("${pkgname}-openrc")
    conflicts=('systemd-udev' "${pkgname}-openrc")
    replaces=("${pkgname}-openrc")

    DESTDIR="$pkgdir" meson install -C build

    ln -sfv libelogind.pc "${pkgdir}"/usr/lib/pkgconfig/libsystemd.pc

    install -dm755 "${srcdir}"/_libelogind
    mv -v "${pkgdir}"/usr/lib/libelogind*.so* "${srcdir}"/_libelogind

    install -d "${pkgdir}"/{etc,usr/lib}/elogind/{logind,sleep}.conf.d

    # Init script
    #install -Dm755 "${srcdir}"/elogind.initd "${pkgdir}"/etc/init.d/elogind
    #install -Dm755 "${srcdir}"/elogind.confd "${pkgdir}"/etc/conf.d/elogind
    install -Dm755 "${srcdir}"/elogind.sv.initd "${pkgdir}"/etc/init.d/elogind

    install -d "${pkgdir}"/etc/runlevels/boot
    ln -sf /etc/init.d/elogind "${pkgdir}"/etc/runlevels/boot/elogind
}

package_libelogind(){
    pkgdesc="elogind client libraries"
    provides=('libelogind.so' 'liblogind')
    provides+=("libsystemd=${pkgver}" "systemd-libs=${pkgver}"
             'libsystemd.so')
    conflicts=('libsystemd.so')
    depends=('libcap' 'libudev')

    cd "${pkgbase}-${pkgver}"

    install -dm755 "${pkgdir}"/usr/lib
    mv "${srcdir}"/_libelogind/libelogind*.so* "${pkgdir}"/usr/lib

    install -m755 "${pkgdir}"/usr/lib/libelogind.so "${pkgdir}"/usr/lib/libsystemd.so
    ln -sfv libsystemd.so "${pkgdir}"/usr/lib/libsystemd.so.0
}