summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 094a862e3a6c033c008a8f5d0ee0b461b0814859 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Maintainer: taotieren <admin@taotieren.com>

pkgbase=nanomq-git
pkgname=(nanomq{,-sqlite,-msquic,-full}-git)
pkgver=0.23.5.r3.gf6e8cde4
pkgrel=1
pkgdesc="Nano MQTT Broker - An Ultra-light and Blazing-fast MQTT Broker for IoT Edge"
arch=($CARCH)
url="https://github.com/nanomq/nanomq"
license=('MIT')
provides=(
    ${pkgbase%-git}
    nanonng
    nng
)
conflicts=(${pkgbase%-git})
depends=(
    mbedtls
    python
)
makedepends=(
    asciidoctor
    boost
    cmake
    gcc
    git
    ninja
    sqlite
    vector
    vector-blf
    zeromq
)
backup=(
    etc/nanomq.conf
    etc/nanomq_acl.conf
    etc/nanomq_bridge.conf
    etc/nanomq_dds_gateway.conf
    etc/nanomq_example.conf
    etc/nanomq_old.conf
    etc/nanomq_pwd.conf
    etc/nanomq_vsomeip_gateway.conf
    etc/nanomq_zmq_gateway.conf
)
options=('!strip' '!lto')
source=(
    "${pkgname%-git}::git+${url}.git"
    #     "nng::git+https://github.com/nanomq/NanoNNG.git"
    #     "l8w8jwt::git+https://github.com/GlitchedPolygons/l8w8jwt.git"
    #     "nftp-codec::git+https://github.com/nanomq/nftp-codec.git"
    #     "msquic::git+https://github.com/microsoft/msquic.git"
    #     "mbedtls::git+https://github.com/ARMmbed/mbedtls.git"
    #     "chillbuff::git+https://github.com/GlitchedPolygons/chillbuff.git"
    #     "jsmn::git+https://github.com/zserge/jsmn.git"
    #     "checknum::git+https://github.com/GlitchedPolygons/checknum.git"
    #     "acutest::git+https://github.com/mity/acutest.git"
    #     "ed25519::git+https://github.com/GlitchedPolygons/GlitchEd25519.git"
    #     "doxygen-awesome::git+https://github.com/GlitchedPolygons/doxygen-awesome-css.git"
    #     "googletest::git+https://github.com/google/googletest.git"
    #     "openssl::git+https://github.com/quictls/openssl.git"
    #     "clog::git+https://github.com/microsoft/CLOG.git"
    #     "xdp-for-windows::git+https://github.com/microsoft/xdp-for-windows.git"
)
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgbase%-git}/"
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    #     git -C "${srcdir}/openssl/" clean -dfx
    #     cd "${srcdir}/openssl/"
    #     git submodule update --init --recursive
    #     #     git submodule init
    #     #     git config submodule.submodules/googletest.url "$srcdir/googletest"
    #     #     git -c protocol.file.allow=always submodule update
    #
    #     git -C "${srcdir}/xdp-for-windows/" clean -dfx
    #     cd "${srcdir}/xdp-for-windows/"
    #     git submodule update --init --recursive
    #     #     git submodule init
    #     #     git config submodule.submodules/googletest.url "$srcdir/googletest"
    #     #     git -c protocol.file.allow=always submodule update
    #
    #     git -C "${srcdir}/msquic/" clean -dfx
    #     cd "${srcdir}/msquic/"
    #     #     git submodule update --init --recursive
    #     git submodule init
    #     git config submodule.submodules/googletest.url "$srcdir/googletest"
    #     git config submodule.submodules/openssl.url "$srcdir/openssl"
    #     git config submodule.submodules/openssl3.url "$srcdir/openssl"
    #     git config submodule.submodules/clog.url "$srcdir/clog"
    #     git config submodule.submodules/xdp-for-windows.url "$srcdir/xdp-for-windows"
    #     git -c protocol.file.allow=always submodule update
    #
    #     git -C "${srcdir}/nng/" clean -dfx
    #     cd "${srcdir}/nng/"
    #     #     git submodule update --init --recursive
    #     git submodule init
    #     git config submodule.extern/msquic.url "$srcdir/msquic"
    #     git -c protocol.file.allow=always submodule update
    #
    #     git -C "${srcdir}/l8w8jwt/" clean -dfx
    #     cd "${srcdir}/l8w8jwt/"
    #     #     git submodule update --init --recursive
    #     git submodule init
    #     git config submodule.lib/mbedtls.url "$srcdir/mbedtls"
    #     git config submodule.lib/chillbuff.url "$srcdir/chillbuff"
    #     git config submodule.lib/jsmn.url "$srcdir/jsmn"
    #     git config submodule.lib/checknum.url "$srcdir/checknum"
    #     git config submodule.lib/acutest.url "$srcdir/acutest"
    #     git config submodule.lib/ed25519.url "$srcdir/ed25519"
    #     git config submodule.lib/doxygen-awesome.url "$srcdir/doxygen-awesome"
    #     git -c protocol.file.allow=always submodule update
    #
    #     git -C "${srcdir}/chillbuff/" clean -dfx
    #     cd "${srcdir}/chillbuff/"
    #     #     git submodule update --init --recursive
    #     git submodule init
    #     git config submodule.lib/doxygen-awesome.url "$srcdir/doxygen-awesome"
    #     git -c protocol.file.allow=always submodule update

    #     git -C "${srcdir}/${pkgbase%-git}/" clean -dfx
    cd "${srcdir}/${pkgbase%-git}/"
    git submodule update --init --recursive
    #     git submodule init
    #     git config submodule.nanonng.url "$srcdir/nng"
    #     git config submodule.extern/l8w8jwt.url "$srcdir/l8w8jwt"
    #     git config submodule.nanomq_cli/nftp-codec.url "$srcdir/nftp-codec"
    #     git -c protocol.file.allow=always submodule update
}

package_nanomq-git() {
    pkgdesc+=" (base Broker)"
    provides+=(${pkgname%-git})

    cd "${srcdir}/${pkgbase%-git}/"
    cmake -DCMAKE_BUILD_TYPE=None \
        -DNNG_ENABLE_TLS=ON \
        -DBUILD_SHARED_LIBS=ON \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
        -Wno-dev \
        -B build_nanomq \
        -G Ninja

    ninja -C build_nanomq

    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${pkgbase%-git}/build_nanomq install
    mv "${pkgdir}"/usr/etc "${pkgdir}"/
}

package_nanomq-sqlite-git() {
    pkgdesc+=" (sqlite Broker)"
    provides+=(${pkgname%-git})

    cd "${srcdir}/${pkgbase%-git}/"
    cmake -DCMAKE_BUILD_TYPE=None \
        -DNNG_ENABLE_TLS=ON \
        -DNNG_ENABLE_SQLITE=ON \
        -DBUILD_SHARED_LIBS=ON \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
        -Wno-dev \
        -B build_nanomq-sqlite \
        -G Ninja

    ninja -C build_nanomq-sqlite

    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${pkgbase%-git}/build_nanomq-sqlite install
    mv "${pkgdir}"/usr/etc "${pkgdir}"/
}

package_nanomq-msquic-git() {
    pkgdesc+=" (msquic Broker)"
    provides+=(${pkgname%-git})
    conflicts=(msquic)

    #         -DNNG_ENABLE_QUIC=ON \

    cd "${srcdir}/${pkgbase%-git}/"
    cmake -DCMAKE_BUILD_TYPE=None \
        -DNNG_ENABLE_TLS=ON \
        -DNNG_ENABLE_SQLITE=ON \
        -DBUILD_SHARED_LIBS=ON \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
        -Wno-dev \
        -B build_nanomq-msquic \
        -G Ninja

    ninja -C build_nanomq-msquic

    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${pkgbase%-git}/build_nanomq-msquic install
    mv "${pkgdir}"/usr/etc "${pkgdir}"/
}

package_nanomq-full-git() {
    pkgdesc+=" (full Broker)"
    provides+=(
        ${pkgname%-git}
        l8w8jwt
    )
    conflicts=(
        msquic
        mbedtls
    )
    depends=(
        mbedtls
        python
    )

    cd "${srcdir}/${pkgbase%-git}/"
    cmake -DCMAKE_BUILD_TYPE=None \
        -DNNG_ENABLE_TLS=ON \
        -DNNG_ENABLE_SQLITE=ON \
        -DNNG_ENABLE_SQLITE=ON \
        -DENABLE_RULE_ENGINE=ON \
        -DENABLE_JWT=ON \
        -DBUILD_ZMQ_GATEWAY=ON \
        -DBUILD_BENCH=ON \
        -DBUILD_SHARED_LIBS=ON \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
        -Wno-dev \
        -B build_nanomq-full \
        -G Ninja

    ninja -C build_nanomq-full

    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${pkgbase%-git}/build_nanomq-full install
    mv "${pkgdir}"/usr/etc "${pkgdir}"/
}