aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/my_alpine/PKGBUILD
blob: b29328e4e4bfc9f31898a5de370086392047824d (plain) (blame)
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
# Maintainer: LightDot <lightdot -a-t- g m a i l>

pkgname=alpine
pkgver=2.26
pkgrel=1
arch=('i686' 'x86_64' 'aarch64')
pkgdesc="A free software email client, a rewrite of Pine which was a continuation of the venerable ELM."
url="https://alpineapp.email/"
license=('APACHE')
depends=('libxcrypt' 'ncurses' 'openssl')
optdepends=('aspell: for spell-checking support'
            'hunspell: for spell-checking support'
            'topal: glue program that links GnuPG and alpine')
provides=('pico' 'pine' 're-alpine')
conflicts=('pico' 'pine' 're-alpine' 'alpine-fancythreading')
replaces=('pico' 'pine' 're-alpine' 'alpine-fancythreading')
options=('!makeflags')
source=("git+https://git.umaneti.net/alpine/#branch=various-imp"
        "maildir-${pkgver}.patch.gz::https://alpineapp.email/alpine/patches/alpine-${pkgver}/maildir.patch.gz"
        "fancy-${pkgver}.patch.gz::https://alpineapp.email/alpine/patches/alpine-${pkgver}/fancy.patch.gz"
        "fillpara-${pkgver}.patch.gz::https://alpineapp.email/alpine/patches/alpine-${pkgver}/fillpara.patch.gz"
        "compose-${pkgver}.patch.gz::https://alpineapp.email/alpine/patches/alpine-${pkgver}/compose.patch.gz"
        "longurl-${pkgver}.patch.gz::https://alpineapp.email/alpine/patches/alpine-${pkgver}/longurl.patch.gz")
sha256sums=('SKIP'
            '01020ca0cec24793a39d5ab72c0beefc0cfbb92d11348b5bd5bf7bfbcb203f63'
            'c178459dd885e4caa32640e5ce63c689ec4752a1e039ddb149e034b935fe5181'
            '960bb9656353529964e86f0f782bf032f9aae36af9493ed7f2c8ccfd5695330f'
            '013d31d95dbf6e31c1ebfdcb745481cf31fd0df466b81e077a7538dcfe75a9f4'
            'b29b4b6f8986c4c07ce2db21b6ff27341b4f7c0844c3dee8c1c63b0536fc88b2')

pkgver() {
    cat "$srcdir/$pkgname/VERSION"
}

prepare() {
    cd "$pkgname"

    # Apply select patches to Alpine
    # https://alpineapp.email/alpine/
    # Maildir patch
    echo '  -> Maildir patch'
    patch -p1 -i "${srcdir}/maildir-${pkgver}.patch"
    # Fancy Thread Interface
    echo '  -> Fancy thread patch'
    sed -i '/^  char     \*choose_a_rule(int);$/d' \
        "${srcdir}/fancy-${pkgver}.patch"
    sed -i 's/^  char     \*choose_a_keyword(void);$/  char     *choose_a_keyword(char *);\n  int	  keyword_complete(char *, int);/' \
        "${srcdir}/fancy-${pkgver}.patch"
    patch -p1 -i "${srcdir}/fancy-${pkgver}.patch"
    # Justify paragraphs that contain more than one level of quoting
    echo '  -> Fill paragraph patch'
    patch -p1 -i "${srcdir}/fillpara-${pkgver}.patch"
    # Add new subcommands to the compose command
    echo '  -> New compose subcommands patch'
    patch -p1 -i "${srcdir}/compose-${pkgver}.patch"
    # Recognize multiline URLs
    echo '  -> Long URL patch'
    patch -p1 -i "${srcdir}/longurl-${pkgver}.patch"
}

build() {
    cd "$pkgname"

    # Configure Alpine
    LIBS+="-lpam -lcrypto" \
         ./configure --prefix=/usr \
             --with-passfile=.${pkgname}.passfile \
             --with-system-pinerc=/etc/${pkgname}.d/pine.conf \
             --with-system-fixed-pinerc=/etc/${pkgname}.d/pine.conf.fixed \
             --without-password-prog \
             --without-tcl --without-krb5 --without-ldap --without-ntlm \
             --disable-mouse --enable-quotas \
             --disable-shared --disable-static

    # Build Alpine
    make
}

package() {
    cd "$pkgname"

    # Install Alpine
    make DESTDIR="$pkgdir" install
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 NOTICE "${pkgdir}/usr/share/doc/${pkgname}/NOTICE"
    install -m644 README "${pkgdir}/usr/share/doc/${pkgname}/README"
    install -m644 README.maildir "${pkgdir}/usr/share/doc/${pkgname}/README.maildir"
}