summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 60aa597620ed850fc08b68f5f9cd3b609f861878 (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
# Maintainer: BadBoy <luckmelove2@gmail.com>

_pkgname='bing-wallpaper'
pkgbase='bing-wallpaper-download'
pkgname=(
        'bing-wallpaper-download'
        'bing-wallpaper-download-cn'
)
pkgver=0.1
pkgrel=1
pkgdesc="Automatic daily download of Bing wallpapers"
arch=(
    'x86_64'
    'i686'
    'arm'
    'armv6h'
    'armv7h'
    'aarch64'
)
license=('GPL3')
url='https://github.com/wo2ni/bing-wallpaper-download'
depends=('glibc' 'feh')
makedepends=('go')
install="${pkgname}.install"

source=(
        "git+${url}.git"
        "${pkgbase}.install"
)

sha256sums=('SKIP'
            '53ccca643c0554fcf610437fbf0c6c18adee3f5c9bc1e111fe05a8a9b720d33d')

build() {
    cd "${srcdir}/${pkgbase}"
    make -j $(nproc)
    mv -v "${_pkgname}" "${srcdir}/${pkgbase}/${_pkgname}-us" 

    sed -i 's/return fmt.Sprintf("%s%s", bingURL, link), nil/return fmt.Sprintf("%s", link), nil/g' "${srcdir}/${pkgname}/${_pkgname}.go"
    make -j $(nproc)
}

package_bing-wallpaper-download() {
    msg "Install ${pkgname[0]}"
    install -dm755 "${pkgdir}/usr/local/bin/"
    install -Dm755 "${srcdir}/${pkgname}/${_pkgname}-us" "${pkgdir}/usr/local/bin/${_pkgname}"

    msg "Install ${pkgname[0]} systemd timer and service"
    install -dm755 "${pkgdir}/etc/systemd/system/"
    for i in "${srcdir}/${pkgbase}"/*{timer,service}; do
        install -Dm644 "${i}" "${pkgdir}/etc/systemd/system/"
    done
}

package_bing-wallpaper-download-cn() {
    msg "Install ${pkgname[1]}"
    install -dm755 "${pkgdir}/usr/local/bin/"
    install -Dm755 "${srcdir}/${pkgbase}/${_pkgname}" "${pkgdir}/usr/local/bin"

    msg "Install ${pkgname[1]} systemd timer and service"
    install -dm755 "${pkgdir}/etc/systemd/system/"
    for i in "${srcdir}/${pkgbase}"/*{timer,service}; do
        install -Dm644 "${i}" "${pkgdir}/etc/systemd/system/"
    done
}