summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 827f951e3a5a8a68f8e0d7e60d0ba63d665a0645 (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: taotieren <admin@taotieren.com>

pkgbase=hbdinetd-git
pkgname=hbdinetd-git
pkgver=r118.e7b1f42
pkgrel=6
pkgdesc="The daemon managing network interfaces for HybridOS."
arch=(x86_64
    aarch64
    riscv64)
url="https://github.com/HybridOS2/HBDInetd"
license=('GPL-3.0')
groups=(hybridos2-git)
provides=(${pkgbase%-git})
conflicts=(${pkgbase%-git})
replaces=()
depends=(
    hbdbus
    wpa_supplicant
    purc)
makedepends=(ccache
    cmake
    git
    ninja
    openssl
    pkgconf)
checkdepends=()
optdepends=()
source=("${pkgname%-git}::git+${url}.git")
sha256sums=('SKIP')
options=('!strip')

pkgver() {
    cd "${srcdir}/${pkgname%-git}/"
#     git describe --long --tags | sed 's/ver.//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}/${pkgname%-git}" clean -dfx
}

build() {
    cd "${srcdir}/${pkgname%-git}"

    sed -i 's|{HBDINETD_APP_INSTALL_DIR}/sbin/|{CMAKE_INSTALL_PREFIX}/bin|g' source/${pkgbase%-git}/CMakeLists.txt
#    sed -i 's|{HBDINETD_APP_INSTALL_DIR}|{CMAKE_INSTALL_PREFIX}/\${HBDINETD_APP_INSTALL_DIR}|g' source/${pkgbase%-git}/PlatformLinux.cmake

# see:https://wiki.archlinux.org/title/CMake_package_guidelines
#     cmake -DCMAKE_BUILD_TYPE=Release \
    cmake -DCMAKE_BUILD_TYPE=None \
        -DPORT=Linux \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -DCMAKE_INSTALL_LIBEXECDIR=lib \
        -B build \
        -G Ninja

    ninja -C build
}

package() {
    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${pkgname%-git}/build install
}