summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e901402175ff43d419a6ab345ddbf4c59c4ce550 (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=mailmaster-bin
pkgver=5.0.2.1011
pkgrel=7
pkgdesc="Professional full-platform email client. One email, multiple syncs. All platforms give you a great experience.专业的全平台邮箱客户端。一封邮件,多端同步。所有平台都能给你出色的体验。"
arch=('x86_64')
url="https://dashi.163.com"
_sparkurl="https://mirrors.sdu.edu.cn/spark-store-repository"
_ablrun_url="https://portrait.gitee.com/spark-store-project/additional-base-lib"
_ubuntu_debdl_url="https://mirrors.sdu.edu.cn/ubuntu"
license=('LicenseRef-custom')
conflicts=("${pkgname%-bin}")
depends=(
    'qt5-base'
    'alsa-lib'
    'libxrandr'
    'nss'
    'at-spi2-core'
    'pango'
    'gconf'
    'libxcomposite'
    'bubblewrap'
    'libxdamage'
)
makedepends=(
    'imagemagick'
)
noextract=(
    "libnss-wrapper-1.1.2.deb"
    "libsasl2-2.1.28.deb"
    "ablrun-2.38-9.deb"
    "ubuntu-libc6-2.35.deb"
    "ubuntu-libc-2.35.deb"
    "ubuntu-libstdc++6-12.3.0.deb"
)
options=('!strip')
source=(
    "${pkgname%-bin}-${pkgver}.deb::${_sparkurl}/store//network/mailmaster/${pkgname%-bin}_${pkgver}_amd64.deb"
    "libnss-wrapper-1.1.2.deb::${_ubuntu_debdl_url}/pool/main/n/nss-wrapper/libnss-wrapper_1.1.2-1_amd64.deb"
    "libsasl2-2.1.28.deb::${_ubuntu_debdl_url}/pool/main/c/cyrus-sasl2/libsasl2-2_2.1.28+dfsg1-8_amd64.deb"
    "ablrun-2.38-9.deb::${_ablrun_url}/releases/download/abl-9-release3/additional-base-lib_2.38-13-9_amd64.deb"
    "ubuntu-libc6-2.35.deb::${_ubuntu_debdl_url}/pool/main/g/glibc/libc6_2.35-0ubuntu3.8_amd64.deb"
    "ubuntu-libc-2.35.deb::${_ubuntu_debdl_url}/pool/main/g/glibc/libc-bin_2.35-0ubuntu3_amd64.deb"
    "ubuntu-libstdc++6-12.3.0.deb::${_ubuntu_debdl_url}/pool/main/g/gcc-12/libstdc++6_12.3.0-1ubuntu1~22.04_amd64.deb"
    "LICENSE.html::https://mail.163.com/html/agreement/doc.html"
    "${pkgname%-bin}.sh"
)
sha256sums=('d7c272d50798b4f0dc5279efba383e8f12decef19e434b144e07c3c26c25c58a'
            'c1c9649b1bbd095a03c648d89b7bfeedcc7c15ae819e2a1a778427908eebb284'
            '9ee74510d31ca60eaac871b2d153e1f85823de785ec50ebd62f4ec6b7336b9ab'
            'e48281949f890c0b1eb81328584ec8c92af1609d8b26a6c14ddf564ec2e8ef79'
            '76d582e6b5a7057acd8b239edf102329a5a966303d7d1b7a024b447e057b342e'
            '0fbbb920bb9b3b24c357cca9035671fcfee5f9ed49175f6145db979406dbc532'
            '83873058e692936a09649ede2f8e70b87dde1f3f5488db53da8081b81c79a5d9'
            'd3dc6df916c1600e66a673b63f2346777421d6cbcdbaf4a9eb0d182054c8b6a5'
            '048b9c6c54f1fe46fa2d0844088d81e0c8e334dd7a8ed49699039b6d18348ee3')
build() {
    #extract mailmaster
    sed -e "
        s/@appname@/${pkgname%-bin}/g
        s/@runname@/${pkgname%-bin}/g
    " -i "${srcdir}/${pkgname%-bin}.sh"
    bsdtar -xf "${srcdir}/data."*
    sed -e "
        s/\/opt\/${pkgname%-bin}\/launch.sh/${pkgname%-bin}/g
        s/\/opt\/${pkgname%-bin}\/logo.ico/${pkgname%-bin}/g
        5i\Categories=Network;
    " -i "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop"
    convert "${srcdir}/opt/${pkgname%-bin}/logo.ico" "${srcdir}/${pkgname%-bin}.png"

    #extract nss-wrapper
    install -Dm755 -d "${srcdir}/libnss-wrapper"
    bsdtar -xf "libnss-wrapper-1.1.2.deb" -C "${srcdir}/libnss-wrapper"
    bsdtar -xf "${srcdir}/libnss-wrapper/data."* -C "${srcdir}/libnss-wrapper"
    install -Dm644 "${srcdir}/libnss-wrapper/usr/lib/libnss_wrapper.so" -t "${srcdir}/opt/${pkgname%-bin}/lib"

    #extract sasl
    install -Dm755 -d "${srcdir}/libsasl2"
    bsdtar -xf "${srcdir}/libsasl2-2.1.28.deb" -C "${srcdir}/libsasl2"
    bsdtar -xf "${srcdir}/libsasl2/data."* -C "${srcdir}/libsasl2"
    install -Dm644 "${srcdir}/libsasl2/usr/lib/${CARCH}-linux-gnu/libsasl2.so"* -t "${srcdir}/opt/${pkgname%-bin}/lib"

    #extract ablrun
    install -Dm755 -d "${srcdir}/ablrun"
    bsdtar -xf "${srcdir}/ablrun-2.38-9.deb" -C "${srcdir}/ablrun"
    bsdtar -xf "${srcdir}/ablrun/data."* -C "${srcdir}/ablrun"
    mv "${srcdir}/ablrun/usr/lib/${CARCH}-linux-gnu/additional-base-lib" "${srcdir}/ablrun/usr/lib"
    rm -rf "${srcdir}/ablrun/usr/lib/${CARCH}-linux-gnu"
    sed "s/\/${CARCH}-linux-gnu//g" -i "${srcdir}/ablrun/usr/bin/ablrun"

    #extract ubuntu-libc6
    install -Dm755 -d "${srcdir}/libc6"
    bsdtar -xf "${srcdir}/ubuntu-libc6-2.35.deb" -C "${srcdir}/libc6"
    bsdtar -xf "${srcdir}/libc6/data."* -C "${srcdir}/libc6"
    install -Dm644 "${srcdir}/libc6/lib/${CARCH}-linux-gnu/"*.so* -t "${srcdir}/ablrun/usr/lib/additional-base-lib"
    install -Dm644 "${srcdir}/libc6/lib/${CARCH}-linux-gnu/ld-linux-x86-64.so.2" -t "${srcdir}/ablrun/usr/lib/additional-base-lib/lib64"

    #extract ubuntu-libc
    install -Dm755 -d "${srcdir}/libc"
    bsdtar -xf "${srcdir}/ubuntu-libc-2.35.deb" -C "${srcdir}/libc"
    bsdtar -xf "${srcdir}/libc/data."* -C "${srcdir}/libc"
    install -Dm755 "${srcdir}/libc/usr/bin/ldd" -t "${srcdir}/ablrun/usr/lib/additional-base-lib"

    #extract ubuntu-libstdc++6
    install -Dm755 -d "${srcdir}/libstdc++6"
    bsdtar -xf "${srcdir}/ubuntu-libstdc++6-12.3.0.deb" -C "${srcdir}/libstdc++6"
    bsdtar -xf "${srcdir}/libstdc++6/data."* -C "${srcdir}/libstdc++6"
    install -Dm644 "${srcdir}/libstdc++6/usr/lib/${CARCH}-linux-gnu/libstdc++.so.6.0.30" \
        "${srcdir}/ablrun/usr/lib/additional-base-lib/libstdc++.so.6"
}
package() {
    install -Dm755 "${srcdir}/${pkgname%-bin}.sh" "${pkgdir}/usr/bin/${pkgname%-bin}"
    install -Dm755 "${srcdir}/ablrun/usr/bin/ablrun" -t "${pkgdir}/usr/bin"
    cp -r "${srcdir}/opt" "${pkgdir}"
    install -Dm644 "${srcdir}/usr/share/applications/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
    install -Dm644 "${srcdir}/${pkgname%-bin}.png" -t "${pkgdir}/usr/share/pixmaps"
    cp -r "${srcdir}/ablrun/usr/lib" "${pkgdir}/usr"
    install -Dm644 "${srcdir}/LICENSE.html" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}