summaryrefslogtreecommitdiff
path: root/packages/x11-libs/libutempter/libutempter-1.1.6.exheres-0
blob: 3e41ec1de7cd0119233a75d9c903f2baec59f24d (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
# Copyright 2009 Saleem Abdulrasool <compnerd@compnerd.org>
# Distributed under the terms of the GNU General Public License v2
# Based in part upon 'libutempter-1.1.5.ebuild' which is:
#    Copyright 1999-2007 Gentoo Foundation

SUMMARY="A library interface for terminal emulators to record user sessions to utmp and wtmp"
HOMEPAGE=""
DOWNLOADS="ftp://ftp.altlinux.org/pub/people/ldv/${PN}/${PNV}.tar.bz2"

REMOTE_IDS="freecode:${PN}"

LICENCES="LGPL-2.1"
SLOT="0"
PLATFORMS="~amd64 ~armv7 ~armv8"
MYOPTIONS=""

DEPENDENCIES="
    build+run:
        group/utmp
"

DEFAULT_SRC_PREPARE_PATCHES=(
    -p2 "${FILES}"/${PNV}-musl.patch
)

DEFAULT_SRC_COMPILE_PARAMS=(
    libdir="/usr/$(exhost --target)/lib"
    libexecdir="/usr/$(exhost --target)/libexec"
    RPM_OPT_FLAGS="$CFLAGS"
)

DEFAULT_SRC_INSTALL_PARAMS=(
    libdir="/usr/$(exhost --target)/lib"
    includedir="/usr/$(exhost --target)/include"
    libexecdir="/usr/$(exhost --target)/libexec"
)

src_prepare() {
    default

    edo sed -e "s/ranlib/$(exhost --tool-prefix)ranlib/" \
            -i Makefile
}

src_install() {
    default

    edo chown root:utmp "${IMAGE}"/usr/$(exhost --target)/libexec/utempter/utempter
    edo chmod 2755 "${IMAGE}"/usr/$(exhost --target)/libexec/utempter/utempter
}

pkg_postinst() {
    if [[ -f "${ROOT}var/log/wtmp" ]] ; then
        chown root:utmp "${ROOT}var/log/wtmp"
        chmod 644 "${ROOT}var/log/wtmp"
    fi

    if [[ -f "${ROOT}var/log/utmp" ]] ; then
        chown root:utmp "${ROOT}var/log/utmp"
        chmod 644 "${ROOT}var/log/utmp"
    fi
}