summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a44e239df433eb6fba87b169660e826fab83639d (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
# Maintainer: vvxxp8 <concatenate[g] the characters[x] in square[b] brackets[1] in[5] order[3] at gmail dot com>

pkgname=cajviewer-appimage
_installdir=/opt/${pkgname}
pkgver=1.0.0
pkgrel=1
pkgdesc="CAJViewer for Linux"
arch=("x86_64")
url="http://cajviewer.cnki.net"
noextract=("CAJViewer-x86_64-libc-2.24.AppImage")
options=("!strip")
provides=('cajviewer')
conflicts=('cajviewer')
_pkgname="CAJViewer-x86_64-libc-2.24.AppImage"
source=("http://viewer.d.cnki.net/CAJViewer-x86_64-libc-2.24.AppImage")
sha256sums=("2ee4ca35cc031ebdc413bcb46d63bb1b7f720c7a9db45641e25614f589f4933f")

prepare() {
    cd "${srcdir}"
    chmod a+x "${_pkgname}"
    ${srcdir}/${_pkgname} --appimage-extract
    sed -i "s+Exec=cajviewer+Exec=env DESKTOPINTEGRATION=yes ${_installdir}/${_pkgname} %U+" "squashfs-root/cajviewer.desktop"
    find "squashfs-root/usr/share/icons/hicolor" -type d -exec chmod 755 {} \;
}

package() {
    install -dm755 "${pkgdir}/usr/share/icons"
    install -Dm755 "${_pkgname}" "${pkgdir}/${_installdir}/${_pkgname}"
    install -Dm644 "squashfs-root/cajviewer.desktop" "${pkgdir}/usr/share/applications/cajviewer.desktop"
    cp -R "squashfs-root/usr/share/icons/hicolor" "${pkgdir}/usr/share/icons"
}