summaryrefslogtreecommitdiff
path: root/repo/system/networkmanager.xibuild
blob: 14c4cbcb4bd89b87b747c13183a7cac11d703f9c (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
#!/bin/bash

MAKEDEPS=(grep meson ninja python intltool glib)
DEPS=(jansson libndp curl wpa_supplicant newt nss polkit libpsl audit dbus gobject-introspection)

PKG_VER=1.35.5
SOURCE=https://download.gnome.org/sources/NetworkManager/$(echo $PKG_VER | cut -d. -f-2)/NetworkManager-$PKG_VER.tar.xz

BOOTSCRIPTS=network-manager-sysvinit-compat_21.02.01
ADDITIONAL=(
        https://mxrepo.com/mx/repo/pool/main/n/network-manager-sysvinit-compat/$BOOTSCRIPTS.tar.xz
    )

DESC="Network connection manager and user applications"

prepare () {
    grep -rl '^#!.*python$' | xargs sed -i '1s/python/&3/'

}

build () {
    mkdir build &&
    cd    build &&

    CXXFLAGS+="-O2 -fPIC"            \
    meson --prefix=/usr              \
          --buildtype=release        \
          -Dlibaudit=no              \
          -Dlibpsl=false             \
          -Dnmtui=true               \
          -Dovs=false                \
          -Dppp=false                \
          -Dselinux=false            \
          -Dsession_tracking=elogind \
          -Dmodem_manager=false      \
          -Dsystemdsystemunitdir=no  \
          -Dsystemd_journal=false    \
          -Dqt=false                 \
          .. &&
    ninja
}

package () {
    DESTDIR=$PKG_DEST ninja install &&
    mv -v $PKG_DEST/usr/share/doc/NetworkManager{,-$PKG_VER}

    # create minimum config file
    cat >> $PKG_DEST/etc/NetworkManager/NetworkManager.conf << "EOF"
[main]
plugins=keyfile
EOF
    cat > $PKG_DEST/etc/NetworkManager/conf.d/polkit.conf << "EOF"
[main]
auth-polkit=true
EOF

cat > $PKG_DEST/etc/NetworkManager/conf.d/dhcp.conf << "EOF"
[main]
dhcp=dhclient
EOF

    cd ..
    tar xf $BOOTSCRIPTS.tar.xz
    cd all

    mkdir $PKG_DEST/etc/init.d
    cp -v network-manager $PKG_DEST/etc/init.d/networkmanager


}