summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7b17d74478d454e56cca45ce19f752fc9f40ff19 (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
# Maintainer: wenLiangcan <boxeed at gmail dot com>

_npmver=0.1.0
pkgname=electronic-wechat-git
_pkgname=electronic-wechat
pkgver=1.0.2.g39a7b5a
pkgrel=1
pkgdesc="An Electron application for WeChat"
arch=('any')
url="https://github.com/geeeeeeeeek/wechat-electron/"
license=('MIT')
depends=('electron' 'xdg-utils')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=('git+https://github.com/geeeeeeeeek/electronic-wechat.git')
sha1sums=('SKIP')
_desktop="${_pkgname}.desktop"

pkgver() {
    cd "${srcdir}/${_pkgname}"
    git describe --tags | sed 's/^v//;s/-/./g'
}

prepare() {
    cat > ${_desktop} << EOF
[Desktop Entry]
Type=Application
Name=Electronic WeChat
Comment=A better WeChat client on Mac OS X and Linux.
Exec=/usr/bin/${_pkgname}
Icon=/usr/share/${_pkgname}/icon.png
Categories=Network;InstantMessaging;Application;
Terminal=false
StartupNotify=true
Version=${pkgver}
EOF

    cat > "${_pkgname}.sh" << EOF
#!/usr/bin/env sh
cd /usr/share/${_pkgname}/
electron ./ \$*
EOF
}

package() {
    cd "${_pkgname}"
    find ./src -type f -exec install -Dm644 {} \
        "${pkgdir}/usr/share/${_pkgname}/{}" \;
    install -Dm644 ./{assets/icon.png,package.json} "${pkgdir}/usr/share/${_pkgname}/"
    install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
    install -Dm644 "${srcdir}/${_desktop}" "${pkgdir}/usr/share/applications/${_desktop}"
    install -Dm755 "${srcdir}/${_pkgname}.sh" "${pkgdir}/usr/bin/${_pkgname}"
}