commit 2aaeceb89dffaff3d83a1f968fd9179eccb83ab3 Author: EnumDev Date: Mon Sep 1 17:09:01 2025 +0300 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..5115cc3 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Gitlab repository +REPO="NetworkManager/NetworkManager" + +# Replace slash with URL encoded representation +REPO=$(echo "$REPO" | sed 's|/|%2F|g') + +# Get tag name using Gitlab Rest API +TAG_NAME=$(curl -s -L https://gitlab.freedesktop.org/api/v4/projects/"$REPO"/repository/tags | jq -r '.[].name' | grep -v '-' | head -n1) + +echo "$TAG_NAME" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..a901c26 --- /dev/null +++ b/pkg.info @@ -0,0 +1,11 @@ +name: networkmanager +description: Network management daemon and tools +version: 1.54.0 +url: https://networkmanager.dev/ +license: GPL2-or-later,LGPL2.1-or-later,GFDL1.1-or-later +architecture: any +depends: ["curl","elogind","gcc-libs","glib","glibc","iproute2","jansson","libndp","newt","libpsl","mobile-broadband-provider-info","nspr","nss","readline"] +optional_depends: ["blez","dhcpcd","iptables","iwd","modemmanager","nftables","polkit","wpa_supplicant"] +make_depends: ["dhcpcd","gobject-introspection","iptables","iwd","meson","modemmanager","polkit","python-pygobject","vala","libx11","python-dbus","wpa_supplicant"] +keep: ["etc/NetworkManager/NetworkManager.conf"] +type: source diff --git a/source-files/NetworkManager.conf b/source-files/NetworkManager.conf new file mode 100644 index 0000000..7850db4 --- /dev/null +++ b/source-files/NetworkManager.conf @@ -0,0 +1,5 @@ +# Configuration file for NetworkManager. +# See "man 5 NetworkManager.conf" for details. +[main] +plugins=keyfile +hostname-mode=none diff --git a/source-files/networkmanager.esv b/source-files/networkmanager.esv new file mode 100644 index 0000000..5a4af47 --- /dev/null +++ b/source-files/networkmanager.esv @@ -0,0 +1,7 @@ +name: networkmanager +description: start the NetworkManager daemon +dependencies: ["dbus"] +type: background +start_cmd: /usr/sbin/NetworkManager -n +exit_method: kill +restart: true diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..05c5a09 --- /dev/null +++ b/source.sh @@ -0,0 +1,59 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +DOWNLOAD="https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/archive/${BPM_PKG_VERSION}/NetworkManager-${BPM_PKG_VERSION}.tar.gz" +FILENAME="${DOWNLOAD##*/}" + +# The prepare function is executed in the root of the temp directory +# This function is used for downloading files and putting them into the correct location +prepare() { + wget "$DOWNLOAD" + tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + mkdir build + cd build + + meson setup --prefix=/usr \ + --buildtype=release \ + -Dlibaudit=no \ + -Dnmtui=true \ + -Dppp=false \ + -Dnbft=false \ + -Dselinux=false \ + -Dsession_tracking=elogind \ + -Dsystemdsystemunitdir=no \ + -Dsystemd_journal=false \ + -Dnm_cloud_setup=false \ + -Dqt=false + meson compile +} + +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + cd build + + meson test --print-errorlogs +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + cd build + + meson install --destdir="$BPM_OUTPUT" + + # Install configuration file + install -m644 "$BPM_WORKDIR"/NetworkManager.conf "$BPM_OUTPUT"/etc/NetworkManager/NetworkManager.conf + + # Install ESVM service + install -Dm644 "$BPM_WORKDIR"/networkmanager.esv "$BPM_OUTPUT"/etc/esvm/services/networkmanager.esv + + # Install package license + install -Dm644 "$BPM_SOURCE"/COPYING{,.LGPL,.GFDL} -t "$BPM_OUTPUT"/usr/share/licenses/networkmanager/ +}