aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fcbcf44c7cabba8713f697106433c512afe8c032 (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
# Maintainer: Mathieu Bacou <mathieu at bacou dot me>
# Contributor: Joey Pabalinas <alyptik at protonmail dot com>
# Contributor: Allan McRae <allan at archlinux dot org>
# Committer: dorphell <dorphell at gmx dot net>

pkgname=screen-git
# screen will report its version as 4.99.0.
pkgver=4.9.1.r1286.cd4d02f
pkgrel=2
pkgdesc='Full-screen window manager that multiplexes a physical terminal'
url='https://www.gnu.org/software/screen/'
arch=('x86_64' 'aarch64' 'armv7l' 'armv7h' 'armv6h' 'armv5')
license=('GPL')
depends=('ncurses' 'pam')
source=("${pkgname}::git+https://git.savannah.gnu.org/git/screen.git"
        'tmpfiles.d'
        'pam.d')
sha256sums=('SKIP'
            '1f33ce4faca7bd05dd80403411af31e682d5d23e79558e884ae5a35f1dd96223'
            '971c25929ea97422c09e10679ab98e9e6c59295aae1a4a9970909d2206e23090')
makedepends=('git')
backup=('etc/screenrc' 'etc/pam.d/screen')
options=('!makeflags')
conflicts=('screen')
provides=('screen')

_ptygroup=5 #the UID of our PTY/TTY group

pkgver() {
    cd "${srcdir}/${pkgname}" || exit 2

    set -o pipefail
    # Tag without the `.v` prefix
    tag=$(git tag --list --sort -v:refname | head -n1 | sed 's/^v.//')
    rev=$(git rev-list --count HEAD)
    hash=$(git rev-parse --short HEAD)
    printf "%s.r%s.%s" "$tag" "$rev" "$hash"
}

prepare() {
    cd "${srcdir}/${pkgname}/src" || exit 2

    NOCONFIGURE=1 ./autogen.sh
}

build() {
    cd "${srcdir}/${pkgname}/src" || exit 2

    ./configure \
        --prefix=/usr \
        --mandir=/usr/share/man \
        --infodir=/usr/share/info \
        --enable-colors256 \
        --enable-pam \
        --enable-rxvt_osc \
        --enable-telnet \
        --with-pty-group=$_ptygroup \
        --with-socket-dir=/run/screens \
        --with-sys-screenrc=/etc/screenrc

    make
}

package() {
    cd "${srcdir}/${pkgname}/src" || exit 2

    make DESTDIR="${pkgdir}" install

    install -Dm644 etc/etcscreenrc "${pkgdir}"/etc/screenrc
    install -Dm644 etc/screenrc "${pkgdir}"/etc/skel/.screenrc

    cd "${srcdir}"

    install -Dm644 pam.d "${pkgdir}"/etc/pam.d/screen
    install -Dm644 tmpfiles.d "${pkgdir}"/usr/lib/tmpfiles.d/screen.conf
}