summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8ecfa20914fc477f618085c3a283685e19635b65 (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
# Maintainer: taotieren <admin@taotieren.com>

pkgbase=mfgtools-git
pkgname=(mfgtools{,-doc}-git)
pkgver=1.5.182.r4.g09fe178
pkgrel=1
epoch=
pkgdesc="uuu (Universal Update Utility), mfgtools 3.0. Freescale/NXP I.MX Chip image deploy tools."
arch=('x86_64' 'aarch64')
url="https://github.com/nxp-imx/mfgtools"
license=('BSD-3-Clause')
groups=()
depends=(
    bzip2
    gcc-libs
    glibc
    libusb
    tinyxml2
    openssl
    zlib
    zstd)
makedepends=(
    cmake
    git
    ninja
    asciidoc
    dblatex
    findutils
    coreutils)
checkdepends=()
optdepends=()
replaces=()
backup=()
options=()
install=
changelog=
source=("${pkgbase}::git+${url}.git"
    "mfgtools-doc-git::git+${url}.wiki.git"
    "uuu-complete.bash")
noextract=()
sha256sums=('SKIP'
            'SKIP'
            'ffc8e32655ce574a4719c85c5c9a3530a5ec619e933fc801a291df8ec506a442')
#validpgpkeys=()

pkgver() {
    cd "${srcdir}/${pkgbase}"
    ( set -o pipefail
        git describe --long --tag --abbrev=7 2>/dev/null | sed 's/^uuu_//g;s/\([^-]*-g\)/r\1/;s/-/./g' ||
        printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
    )
}

prepare()
{
    git -C "${srcdir}/${pkgbase}" clean -dfx
#     cd "${srcdir}/${pkgbase}"
#     git submodule update --init --recursive
}

build() {
    cd "${srcdir}/${pkgbase}"
    cmake -Bbuild -DCMAKE_INSTALL_PREFIX=/usr \
          -DCMAKE_BUILD_TYPE=None \
          -GNinja

    ninja -C build
}

package_mfgtools-git() {
    provides=('uuu' 'mfgtool')
    conflicts=(${pkgname%-git})
    depends=(
    bzip2
    gcc-libs
    glibc
    libusb
    tinyxml2
    openssl
    zlib
    zstd)

    cd "${srcdir}/${pkgbase}/build"
    DESTDIR="$pkgdir/" ninja -C "${srcdir}/${pkgbase}/build" install
    install -Dm0644 "${srcdir}/uuu-complete.bash" "${pkgdir}/etc/bash_completion.d/uuu-complete.bash"
    install -dm0755  "${pkgdir}/etc/udev/rules.d/"
    ./uuu/uuu -udev > "${pkgdir}/etc/udev/rules.d/70-uuu.rules"
}

package_mfgtools-doc-git() {
    pkgdesc+=" (doc)"
    depends=(asciidoc
        dblatex
        findutils
        coreutils)
    provides=(${pkgname%-git})
    conflicts=(${pkgname%-git})

    cd "${srcdir}/${pkgname}/"
    find . -type f -name "*.asciidoc" -exec sh -c 'mv "$0" "${0%.asciidoc}"' {} \;
    sed -i 's|=====|====|g' Release-Notes
    echo "<revhistory>" > UUU-docinfo.xml
    git log -n25 --reverse --format="format:<revision><revnumber>%h</revnumber><date>%cd</date><authorinitials>%an</authorinitials><revremark>%s</revremark></revision>" >> UUU-docinfo.xml
    echo "</revhistory>" >> UUU-docinfo.xml
    a2x -L -a docinfo UUU

    install -Dm0644 "${srcdir}/${pkgname}/UUU.pdf" -t "${pkgdir}/usr/share/doc/${pkgname}/"
}