From 4e457e0efd0e5fd5df24c7e9ed63b02d0196ea8d Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Fri, 28 Dec 2012 02:38:58 +0100 Subject: Forking netcfg to netctl (1/2) This commit contains the moving of files. --- contrib/PKGBUILD | 31 ++++++++--------- contrib/iptables.hook | 17 ---------- contrib/logging.hook | 86 ------------------------------------------------ contrib/pm-utils.handler | 73 ---------------------------------------- contrib/zsh-completion | 52 ----------------------------- 5 files changed, 13 insertions(+), 246 deletions(-) delete mode 100755 contrib/iptables.hook delete mode 100755 contrib/logging.hook delete mode 100755 contrib/pm-utils.handler delete mode 100644 contrib/zsh-completion (limited to 'contrib') diff --git a/contrib/PKGBUILD b/contrib/PKGBUILD index 9ccc600..e743bfe 100644 --- a/contrib/PKGBUILD +++ b/contrib/PKGBUILD @@ -1,37 +1,32 @@ # Maintainer: Jouke Witteveen -pkgname=netcfg +pkgname=netctl pkgver=%pkgver% pkgrel=1 pkgdesc="Network configuration and profile scripts" -url="http://archlinux.org/netcfg/" -license=("BSD") -backup=(etc/iftab etc/conf.d/netcfg) -groups=(base) -depends=("coreutils" "dhcpcd" "iproute2") +url="http://archlinux.org/netctl/" +license=("GPL") +depends=("coreutils" "iproute2" "openresolv") #makedepends=('asciidoc') # The source tarball includes pre-built documentation. -optdepends=('dialog: for the menu based profile and wifi selectors' +optdepends=('dialog: for the menu based wifi assistant' + 'dhclient: for DHCP support (or dhcpcd)' + 'dhcpcd: for DHCP support (or dhclient)' 'wpa_supplicant: for wireless networking support' - 'ifplugd: for automatic wired connections through net-auto-wired' - 'wpa_actiond: for automatic wireless connections through net-auto-wireless' - 'wireless_tools: for interface renaming through net-rename' + 'ifplugd: for automatic wired connections through netctl-ifplugd' + 'wpa_actiond: for automatic wireless connections through netctl-auto' 'ifenslave: for bond connections' 'bridge-utils: for bridge connections' ) -source=(ftp://ftp.archlinux.org/other/netcfg/netcfg-${pkgver}.tar.xz) +conflicts=("netcfg") +source=(ftp://ftp.archlinux.org/other/netctl/netctl-${pkgver}.tar.xz) arch=(any) md5sums=('%md5sum%') package() { - cd "$srcdir/netcfg-${pkgver}" + cd "$srcdir/netctl-${pkgver}" make DESTDIR="$pkgdir" install - install -D -m644 LICENSE "$pkgdir/usr/share/licenses/netcfg/LICENSE" # Shell Completion - install -D -m644 contrib/bash-completion "$pkgdir/usr/share/bash-completion/completions/netcfg" - install -D -m644 contrib/zsh-completion "$pkgdir/usr/share/zsh/site-functions/_netcfg" - - # Compatibility - ln -s netcfg.service "$pkgdir/usr/lib/systemd/system/net-profiles.service" + install -D -m644 contrib/bash-completion "$pkgdir/usr/share/bash-completion/completions/netctl" } diff --git a/contrib/iptables.hook b/contrib/iptables.hook deleted file mode 100755 index 95546ba..0000000 --- a/contrib/iptables.hook +++ /dev/null @@ -1,17 +0,0 @@ -### Sample netcfg hook script for location based firewall rules. -### To install, make this executable and put it in /usr/lib/network/hooks - -### USAGE -## You need to have iptables installed to use this script. -## Add a location to your network profile and add firewall to your POST_UP. -## The iptables setup in /etc/iptables/$LOCATION.rules will now be loaded -## automatically when a connection is established. -## -## Sample excerpt from the profile: -## LOCATION="library" -## POST_UP="firewall" - -function firewall { - /usr/sbin/iptables-restore < "/etc/iptables/$LOCATION.rules" -} - diff --git a/contrib/logging.hook b/contrib/logging.hook deleted file mode 100755 index 82d0ed1..0000000 --- a/contrib/logging.hook +++ /dev/null @@ -1,86 +0,0 @@ -### Sample netcfg hook script for logging/debugging connections -### To install, make this executable and put it in /usr/lib/network/hooks - - -. /etc/rc.conf -. /etc/rc.d/functions - - -# if NETCFG_DEBUG is set, debugging messages go to stderr instead of syslog - -# What facility to send log messages to? if set to "", nothing will be sent to syslog -NETCFG_LOG="${NETCFG_LOG-local0}" - - - -function report_log { - if [[ -n "$NETCFG_LOG" ]]; then - local caller level="$1" - shift - case "$0" in - net-auto|netcfg-auto-*) caller=net-auto;; - net-profiles) caller=net-profiles;; - net-rename) caller=net-rename;; - *) caller=netcfg;; - esac - logger -p "${NETCFG_LOG}.$level" -t "$caller" -- "$*" - fi -} - - -function report_err { - report_log err "$*" - printhl "$*" -} - - -function report_notice { - report_log notice "$*" - # print "$*" >&2 - checkyesno "$NETCFG_DEBUG" && echo "DEBUG: $*" >&2 -} - - -function report_debug { - if checkyesno "$NETCFG_DEBUG"; then - echo "DEBUG: $*" >&2 - else - report_log debug "$*" - fi -} - - -function report_try { - report_log notice "trying $*..." - stat_busy "$*" - REPORT_TRYING=1 -} - - -function report_fail { - if [[ -n "$*" ]]; then - report_log err "$*" - if [[ -n "$REPORT_TRYING" ]]; then - stat_append "- $*" - REPORT_TRYING= - stat_fail - else - printhl "$*" - fi - elif [[ -n "$REPORT_TRYING" ]]; then - REPORT_TRYING= - stat_fail - fi -} - - -function report_success { - if [[ -n "$*" ]]; then - stat_append "- $*" - REPORT_TRYING= - fi - report_log notice "${*:-succeeded}" - stat_done -} - -# vim: ft=sh ts=4 et sw=4: diff --git a/contrib/pm-utils.handler b/contrib/pm-utils.handler deleted file mode 100755 index 378d32d..0000000 --- a/contrib/pm-utils.handler +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -. /usr/lib/pm-utils/functions - -[[ -f /usr/lib/network/network ]] || exit $NA -. /usr/lib/network/network -. /etc/conf.d/netcfg - -WIRELESS_INTERFACE=${WIRELESS_INTERFACE:-wlan0} - -auto_resume() -{ - if checkyesno ${RESTOREPROFILES:-no}; then - all_resume - sleep 2 - fi - restartservice net-auto-wireless - restartservice net-auto-wired - restartservice net-profiles -} - -daemon_suspend_all() -{ - stopservice net-auto-wireless - stopservice net-auto-wired - stopservice net-profiles -} - -case "$1" in - hibernate|suspend_hybrid|suspend) - report_notice "suspending all interfaces..." - daemon_suspend_all - if checkyesno "${RESTOREPROFILES:-no}"; then - interface_suspend all - fi - ;; - thaw|resume) - if [ -f "$STATE_DIR/interface/${WIRELESS_INTERFACE}" ]; then - report_notice "resuming all interfaces..." - auto_resume ${WIRELESS_INTERFACE} - else - report_notice "resuming all interfaces except wireless..." - all_resume ${WIRELESS_INTERFACE} - fi - ;; - radio_off) - report_notice "suspending wireless interface..." - interface_suspend ${WIRELESS_INTERFACE} no - set_iface disabled ${WIRELESS_INTERFACE} - bring_interface forcedown ${WIRELESS_INTERFACE} - ;; - radio_on) - report_notice "resuming wireless interface..." - auto_resume ${WIRELESS_INTERFACE} - if [ -x /etc/pm/power.d/??wifi ]; then - /usr/bin/on_ac_power # this is in pm-utils - case $? in - 0) # on ac - /etc/pm/power.d/??wifi false - ;; - 1) # on battery - /etc/pm/power.d/??wifi true - ;; - esac - fi - ;; - *) - ;; -esac - -exit $? - -# vim: ft=sh ts=4 et sw=4: diff --git a/contrib/zsh-completion b/contrib/zsh-completion deleted file mode 100644 index e05e183..0000000 --- a/contrib/zsh-completion +++ /dev/null @@ -1,52 +0,0 @@ -#compdef netcfg -local -a disp - -all_options() { - local _subcommands - _subcommands=('list:List all available profiles' - 'current:Report currently running profiles' - 'check-iface:Start the specified profile, only if its interface is not currently up' - 'up:Start the specified profile' - 'reconnect:Disconnect and reconnect the specified profile' - 'iface-recon:Reconnect profile active on specified interface' - 'down:Stop the specified profile' - 'iface-down:Stop the profile up on the specified interface' - 'all-down:Stop all connected profiles' - 'all-suspend:Suspend and store the name of all active profiles' - 'all-resume:Reconnect any profiles that have been suspended') - - _path_files -W "/etc/network.d" -g "*(.)" - _describe 'subcommand' _subcommands -} - -all_profiles() { - _path_files -W "/etc/network.d" -g "*(.)" -} - -up_profiles() { - _files -W "/run/network/profiles" -} - -up_ifaces() { - _files -W "/run/network/interfaces" -} - -_arguments -C \ -'(- *)-l[List all available profiles]' \ -'(- *)-c[Start the specified profile, only if its interface is not currently up]:Network profile:all_profiles' \ -'(- *)-u[Start specified profile]:Network profile:all_profiles' \ -'(- *)-r[Disconnect and reconnect the specified profile]:Active profiles:up_profiles' \ -'(- *)-R[Reconnect profile active on specified interface]:Active interface:up_ifaces' \ -'(- *)-d[Take specified profile down]:Active profile:up_profiles' \ -'(- *)-D[Take down profile active on specified interface]:Active interface:up_ifaces' \ -'(- *)-a[Take all active profiles down]' \ -'(- *)*:All options:all_options' - -if [[ ${#words} == 3 ]]; then - case $words[2] in - 'check-iface' | 'up') all_profiles;; - 'reconnect' | 'down') up_profiles;; - 'iface-recon' | 'iface-down') up_ifaces;; - esac -fi - -- cgit v1.2.3-24-g4f1b