summaryrefslogtreecommitdiff
path: root/repo/system/networkmanager
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
committerdavidovski <david@davidovski.xyz>2022-05-04 23:52:30 +0100
commit739c65c54cb0e957df5e9b76f93fb02554e5cac3 (patch)
tree09ddfa0a342f3ea9de136cb50abdd79821bf1b53 /repo/system/networkmanager
parent4c585ad54388285500fd18a6aaa516894e0f2c16 (diff)
moved everything to new file formatting
Diffstat (limited to 'repo/system/networkmanager')
-rw-r--r--repo/system/networkmanager/networkmanager-dispatcher.initd12
-rw-r--r--repo/system/networkmanager/networkmanager.conf2
-rw-r--r--repo/system/networkmanager/networkmanager.initd17
-rw-r--r--repo/system/networkmanager/networkmanager.rules9
-rw-r--r--repo/system/networkmanager/networkmanager.xibuild66
5 files changed, 106 insertions, 0 deletions
diff --git a/repo/system/networkmanager/networkmanager-dispatcher.initd b/repo/system/networkmanager/networkmanager-dispatcher.initd
new file mode 100644
index 0000000..552cc15
--- /dev/null
+++ b/repo/system/networkmanager/networkmanager-dispatcher.initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+
+supervisor=supervise-daemon
+command=/usr/libexec/nm-dispatcher
+command_args_foreground="--persist"
+
+description="Network Manager Dispatcher Daemon"
+
+depend() {
+ need dbus
+ before networkmanager
+}
diff --git a/repo/system/networkmanager/networkmanager.conf b/repo/system/networkmanager/networkmanager.conf
new file mode 100644
index 0000000..526d2e4
--- /dev/null
+++ b/repo/system/networkmanager/networkmanager.conf
@@ -0,0 +1,2 @@
+[main]
+dhcp=internal
diff --git a/repo/system/networkmanager/networkmanager.initd b/repo/system/networkmanager/networkmanager.initd
new file mode 100644
index 0000000..4ca6a0d
--- /dev/null
+++ b/repo/system/networkmanager/networkmanager.initd
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+# Copyright (c) 2008 Saleem Abdulrasool <compnerd@compnerd.org>
+# Distributed under the terms of the GNU General Purpose License v2
+# $Header: $
+
+supervisor=supervise-daemon
+command=/usr/sbin/NetworkManager
+command_args_foreground="-n"
+
+description="Network Manager Daemon"
+
+depend() {
+ need dbus
+ provide net
+}
+
+# vim: set ft=gentoo-init-d ts=3 sw=3 et:
diff --git a/repo/system/networkmanager/networkmanager.rules b/repo/system/networkmanager/networkmanager.rules
new file mode 100644
index 0000000..66d21d6
--- /dev/null
+++ b/repo/system/networkmanager/networkmanager.rules
@@ -0,0 +1,9 @@
+// Let users in plugdev group modify NetworkManager
+polkit.addRule(function(action, subject) {
+ if (action.id == "org.freedesktop.NetworkManager.settings.modify.system" &&
+ subject.isInGroup("plugdev") && subject.active) {
+ return "yes";
+ }
+});
+
+
diff --git a/repo/system/networkmanager/networkmanager.xibuild b/repo/system/networkmanager/networkmanager.xibuild
new file mode 100644
index 0000000..910b601
--- /dev/null
+++ b/repo/system/networkmanager/networkmanager.xibuild
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+MAKEDEPS="grep meson ninja python intltool glib"
+DEPS="libndp curl wpa_supplicant newt nss polkit libpsl dbus gobject-introspection dhcp eudev libintl modemmanager nspr mobile-broadband-provider-info python-gobject"
+
+PKG_VER=1.39.2
+SOURCE=https://download.gnome.org/sources/NetworkManager/${PKG_VER%.*}/NetworkManager-$PKG_VER.tar.xz
+
+ADDITIONAL="
+networkmanager.conf
+networkmanager-dispatcher.initd
+networkmanager.initd
+networkmanager.rules
+"
+
+DESC="Network connection manager and user applications"
+
+prepare () {
+ ggrep -rl '^#!.*python$' | xargs sed -i '1s/python/&3/'
+ dbus-uuidgen --ensure
+}
+
+build () {
+ mkdir build &&
+ cd build &&
+ meson \
+ --prefix=/usr \
+ -Dsystemdsystemunitdir=no \
+ -Dudev_dir=/lib/udev \
+ -Dmodify_system=true \
+ -Dselinux=false \
+ -Dsystemd_journal=false \
+ -Dlibaudit=no \
+ -Diwd=true \
+ -Dppp=false \
+ -Dconfig_plugins_default=ifupdown \
+ -Difupdown=true \
+ -Ddhcpcd=true \
+ -Dconfig_dhcp_default=internal \
+ -Dvapi=true \
+ -Dtests="no" \
+ -Dpolkit=true \
+ -Dsession_tracking=no \
+ -Dqt=false \
+ -Dovs=false \
+ -Dofono=true \
+ -Dcrypto=nss \
+ -Ddbus_conf_dir=/usr/share/dbus-1/system.d \
+ -Ddocs=false \
+ ..
+ ninja
+}
+
+package () {
+ DESTDIR=$PKG_DEST ninja install &&
+ mv $PKG_DEST/usr/share/doc/NetworkManager \
+ $PKG_DEST/usr/share/doc/NetworkManager-$PKG_VER
+
+ install -m644 -D networkmanager.rules \
+ "$PKG_DEST/usr/share/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules"
+
+ cd ..
+ install -m755 -D networkmanager.initd $PKG_DEST/etc/init.d/networkmanager
+ install -m755 -D networkmanager-dispatcher.initd $PKG_DEST/etc/init.d/networkmanager-dispatcher
+ install -m755 -D networkmanager.conf $PKG_DEST/etc/NetworkManager/NetworkManager.conf
+}