diff --git a/in/other=wicd.conf.in b/data/dbus/wicd.conf similarity index 97% rename from in/other=wicd.conf.in rename to data/dbus/wicd.conf index e82bb6f..598d12e 100644 --- a/in/other=wicd.conf.in +++ b/data/dbus/wicd.conf @@ -18,7 +18,7 @@ - + @@ -29,7 +29,7 @@ diff --git a/other/org.wicd.daemon.service b/data/dbus_service/org.wicd.daemon.service similarity index 100% rename from other/org.wicd.daemon.service rename to data/dbus_service/org.wicd.daemon.service diff --git a/encryption/templates/active b/data/encryption/active similarity index 100% rename from encryption/templates/active rename to data/encryption/active diff --git a/encryption/templates/active_wired b/data/encryption/active_wired similarity index 100% rename from encryption/templates/active_wired rename to data/encryption/active_wired diff --git a/encryption/templates/eap b/data/encryption/eap similarity index 100% rename from encryption/templates/eap rename to data/encryption/eap diff --git a/encryption/templates/eap-tls b/data/encryption/eap-tls similarity index 100% rename from encryption/templates/eap-tls rename to data/encryption/eap-tls diff --git a/encryption/templates/leap b/data/encryption/leap similarity index 100% rename from encryption/templates/leap rename to data/encryption/leap diff --git a/encryption/templates/peap b/data/encryption/peap similarity index 100% rename from encryption/templates/peap rename to data/encryption/peap diff --git a/encryption/templates/peap-tkip b/data/encryption/peap-tkip similarity index 100% rename from encryption/templates/peap-tkip rename to data/encryption/peap-tkip diff --git a/encryption/templates/psu b/data/encryption/psu similarity index 100% rename from encryption/templates/psu rename to data/encryption/psu diff --git a/encryption/templates/ttls b/data/encryption/ttls similarity index 100% rename from encryption/templates/ttls rename to data/encryption/ttls diff --git a/encryption/templates/wep-hex b/data/encryption/wep-hex similarity index 100% rename from encryption/templates/wep-hex rename to data/encryption/wep-hex diff --git a/encryption/templates/wep-passphrase b/data/encryption/wep-passphrase similarity index 100% rename from encryption/templates/wep-passphrase rename to data/encryption/wep-passphrase diff --git a/encryption/templates/wep-shared b/data/encryption/wep-shared similarity index 100% rename from encryption/templates/wep-shared rename to data/encryption/wep-shared diff --git a/encryption/templates/wired_8021x b/data/encryption/wired_8021x similarity index 100% rename from encryption/templates/wired_8021x rename to data/encryption/wired_8021x diff --git a/encryption/templates/wpa b/data/encryption/wpa similarity index 100% rename from encryption/templates/wpa rename to data/encryption/wpa diff --git a/encryption/templates/wpa-peap b/data/encryption/wpa-peap similarity index 100% rename from encryption/templates/wpa-peap rename to data/encryption/wpa-peap diff --git a/encryption/templates/wpa-psk b/data/encryption/wpa-psk similarity index 100% rename from encryption/templates/wpa-psk rename to data/encryption/wpa-psk diff --git a/encryption/templates/wpa-psk-hex b/data/encryption/wpa-psk-hex similarity index 100% rename from encryption/templates/wpa-psk-hex rename to data/encryption/wpa-psk-hex diff --git a/encryption/templates/wpa2-leap b/data/encryption/wpa2-leap similarity index 100% rename from encryption/templates/wpa2-leap rename to data/encryption/wpa2-leap diff --git a/encryption/templates/wpa2-peap b/data/encryption/wpa2-peap similarity index 100% rename from encryption/templates/wpa2-peap rename to data/encryption/wpa2-peap diff --git a/other/dhclient.conf.template.default b/data/etc/dhclient.conf.template.default similarity index 100% rename from other/dhclient.conf.template.default rename to data/etc/dhclient.conf.template.default diff --git a/data/logrotate/wicd.logrotate b/data/logrotate/wicd.logrotate new file mode 100644 index 0000000..71394f3 --- /dev/null +++ b/data/logrotate/wicd.logrotate @@ -0,0 +1,6 @@ +/var/log/wicd/wicd.log { + missingok + notifempty + size 30k + create 0600 root +} diff --git a/other/wicd.service b/data/systemd/wicd.service similarity index 100% rename from other/wicd.service rename to data/systemd/wicd.service diff --git a/in/other=wicd.logrotate.in b/in/other=wicd.logrotate.in deleted file mode 100644 index 88a4a03..0000000 --- a/in/other=wicd.logrotate.in +++ /dev/null @@ -1,6 +0,0 @@ -%LOG%wicd.log { - missingok - notifempty - size 30k - create %LOGPERMS% root %LOGGROUP% -} diff --git a/in/scripts=wicd-cli.in b/in/scripts=wicd-cli.in deleted file mode 100755 index 2c12882..0000000 --- a/in/scripts=wicd-cli.in +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exec %PYTHON% -O %SHARE%cli/wicd-cli.py $@ diff --git a/in/scripts=wicd-client.in b/in/scripts=wicd-client.in deleted file mode 100755 index 839972e..0000000 --- a/in/scripts=wicd-client.in +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# check_firstrun() -if [ ! -d "$HOME/.wicd" ]; then - mkdir -p "$HOME/.wicd" -fi -# Make sure the user knows WHEREAREMYFILES ;-) -if [ -e "%VARLIB%WHEREAREMYFILES" ] && [ ! -L "$HOME/.wicd/WHEREAREMYFILES" ]; then - ln -s "%VARLIB%WHEREAREMYFILES" "$HOME/.wicd/WHEREAREMYFILES" -fi -if [ "$DISPLAY" = "" ]; then - BOLD=$(tput bold) - BLUE=$(tput setaf 4) - NC=$(tput sgr0) - if [ -x "%BIN%wicd-curses" ]; then - if [ ! -f "$HOME/.wicd/CLIENT_CURSES_WARNING" ]; then - printf "NOTICE: You do not have an X server active on this console, \n" - printf "so ${BOLD}${BLUE}wicd-curses${NC} will be started instead. \n" - printf "Please see the wicd-client and/or wicd-curses manual pages \n" - printf "for more information about this error and resulting message. \n" - printf "\n" - printf "This message will not be displayed again. \n" - printf "Press enter to continue... \n" - - read _junk - cat >> "$HOME/.wicd/CLIENT_CURSES_WARNING" << EOF -The wicd-client script checks for the existence of this file to determine -whether it should warn the user before launching wicd-curses instead, in -the event of the gui client being launched outside of the X Window environment. - -If you delete this file, then wicd-client will print the warning if it is -launched outside of X (and then recreate this file again). -EOF - fi - exec %BIN%wicd-curses $@ - - else - printf "NOTICE: You do not have an X server active on this console, \n" - printf "but you do not appear to have ${BOLD}${BLUE}wicd-curses${NC}\n" - printf "installed on this system. We'd normally be running it here.\n" - printf "Please see the wicd-client manual page for more information.\n" - - fi -else - exec %BIN%wicd-gtk $@ -fi diff --git a/in/scripts=wicd-curses.in b/in/scripts=wicd-curses.in deleted file mode 100755 index d70d9d0..0000000 --- a/in/scripts=wicd-curses.in +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -if [ ! -d "$HOME/.wicd" ]; then - mkdir -p "$HOME/.wicd" -fi -if [ -e "%VARLIB%WHEREAREMYFILES" ] && [ ! -L "$HOME/.wicd/WHEREAREMYFILES" ]; then - ln -s "%VARLIB%WHEREAREMYFILES" "$HOME/.wicd/WHEREAREMYFILES" -fi - -exec %PYTHON% -O %SHARE%curses/wicd-curses.py $@ diff --git a/in/scripts=wicd-gtk.in b/in/scripts=wicd-gtk.in deleted file mode 100755 index c751b60..0000000 --- a/in/scripts=wicd-gtk.in +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# check_firstrun() -if [ ! -d "$HOME/.wicd" ]; then - mkdir -p "$HOME/.wicd" -fi -# Make sure the user knows WHEREAREMYFILES ;-) -if [ -e "/var/lib/wicd/WHEREAREMYFILES" ] && [ ! -L "$HOME/.wicd/WHEREAREMYFILES" ]; then - ln -s "/var/lib/wicd/WHEREAREMYFILES" "$HOME/.wicd/WHEREAREMYFILES" -fi - -exec %PYTHON% -O %SHARE%gtk/wicd-client.py $@ diff --git a/in/scripts=wicd.in b/in/scripts=wicd.in deleted file mode 100755 index 3206f2b..0000000 --- a/in/scripts=wicd.in +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec %PYTHON% -O %SHARE%daemon/wicd-daemon.py $@ diff --git a/in/wicd=wpath.py.in b/in/wicd=wpath.py.in deleted file mode 100755 index 257ddc4..0000000 --- a/in/wicd=wpath.py.in +++ /dev/null @@ -1,101 +0,0 @@ -"""Path configuration and functions for the wicd daemon and gui clients. - -chdir() -- Change directory to the location of the current file. - -""" -import os - -# The path containing the wpath.py file. -current = os.path.dirname(os.path.realpath(__file__)) + '/' - -# These paths can easily be modified to handle system wide installs, or -# they can be left as is if all files remain with the source directory -# layout. - -# These paths are replaced when setup.py configure is run - -# All directory paths *MUST* end in a / - -version = '%VERSION%' -revision = '%REVNO%' -curses_revision = '%CURSES_REVNO%' - -# DIRECTORIES - -lib = '%LIB%' -share = '%SHARE%' -etc = '%ETC%' -scripts = '%SCRIPTS%' -predisconnectscripts = '%SCRIPTS%predisconnect' -postdisconnectscripts = '%SCRIPTS%postdisconnect' -preconnectscripts = '%SCRIPTS%preconnect' -postconnectscripts = '%SCRIPTS%postconnect' -images = '%IMAGES%' -encryption = '%ENCRYPTION%' -bin = '%BIN%' -varlib = '%VARLIB%' -networks = '%NETWORKS%' -log = '%LOG%' -resume = '%RESUME%' -suspend = '%SUSPEND%' -sbin = '%SBIN%' -pmutils = '%PMUTILS%' -dbus = '%DBUS%' -dbus_service = '%DBUS_SERVICE%' -systemd = '%SYSTEMD%' -logrotate = '%LOGROTATE%' -desktop = '%DESKTOP%' -backends = '%BACKENDS%' -daemon = '%DAEMON%' -curses = '%CURSES%' -gtk = '%GTK%' -cli = '%CLI%' -gnome_shell_extensions = '%GNOME_SHELL_EXTENSIONS%' -translations = '%TRANSLATIONS%' -icons = '%ICONS%' -pixmaps = '%PIXMAPS%' -autostart = '%AUTOSTART%' -init = '%INIT%' -docdir = '%DOCDIR%' -mandir = '%MANDIR%' -kdedir = '%KDEDIR%' - -# FILES - -# python begins the file section -python = '%PYTHON%' -pidfile = '%PIDFILE%' -# stores something like other/wicd -# really only used in the install -initfile = '%INITFILE%' -# stores only the file name, i.e. wicd -initfilename = '%INITFILENAME%' -wicd_group = '%WICDGROUP%' -log_group = '%LOGGROUP%' -log_perms = '%LOGPERMS%' - -# BOOLEANS -no_install_pmutils = %NO_INSTALL_PMUTILS% -no_install_init = %NO_INSTALL_INIT% -no_install_man = %NO_INSTALL_MAN% -no_install_i18n = %NO_INSTALL_I18N% -no_install_i18n_man = %NO_INSTALL_I18N_MAN% -no_install_kde = %NO_INSTALL_KDE% -no_install_acpi = %NO_INSTALL_ACPI% -no_install_docs = %NO_INSTALL_DOCS% -no_install_gtk = %NO_INSTALL_GTK% -no_install_ncurses = %NO_INSTALL_NCURSES% -no_install_cli = %NO_INSTALL_CLI% -no_install_gnome_shell_extensions = %NO_INSTALL_GNOME_SHELL_EXTENSIONS% -no_use_notifications = %NO_USE_NOTIFICATIONS% - - -def chdir(f): - """Change directory to the location of the specified file. - - Keyword arguments: - f -- the file to switch to (usually __file__) - - """ - os.chdir(os.path.dirname(os.path.realpath(f))) - diff --git a/in/wpath.py.in b/in/wpath.py.in deleted file mode 120000 index 920fa33..0000000 --- a/in/wpath.py.in +++ /dev/null @@ -1 +0,0 @@ -wicd=wpath.py.in \ No newline at end of file diff --git a/setup.py b/setup.py index fcbac75..3d154e7 100755 --- a/setup.py +++ b/setup.py @@ -192,13 +192,6 @@ class configure(setuptools.Command): except (OSError, ValueError, FileNotFoundError): pass # use our default - self.python = '/usr/bin/python3' - self.pidfile = '/var/run/wicd/wicd.pid' - self.initfilename = os.path.basename(self.initfile) - self.wicdgroup = 'users' - self.loggroup = '' - self.logperms = '0600' - def distro_check(self): log.info("Distro is: %s", self.distro) @@ -385,60 +378,22 @@ class install(_install.install): with open('wpath.json') as fobj: wpath = config.Config(json.load(fobj)) + data.extend([(wpath.log, [empty_file]), + (wpath.networks, [empty_file]), + (wpath.scripts, [empty_file]), + (wpath.predisconnectscripts, [empty_file]), + (wpath.postdisconnectscripts, [empty_file]), + (wpath.preconnectscripts, [empty_file]), + (wpath.postconnectscripts, [empty_file])]) - data.extend([ - (wpath.dbus, ['other/wicd.conf']), - (wpath.dbus_service, ['other/org.wicd.daemon.service']), - (wpath.systemd, ['other/wicd.service']), - (wpath.logrotate, ['other/wicd.logrotate']), - (wpath.log, [empty_file]), - (wpath.etc, ['other/dhclient.conf.template.default']), - (wpath.encryption, [('encryption/templates/' + b) for b in - os.listdir('encryption/templates') - if not b.startswith('.')]), - (wpath.networks, [empty_file]), - (wpath.sbin, ['scripts/wicd']), - (wpath.daemon, ['wicd/monitor.py', 'wicd/wicd-daemon.py', - 'wicd/suspend.py', 'wicd/autoconnect.py']), - (wpath.backends, ['wicd/backends/be-external.py', - 'wicd/backends/be-ioctl.py']), - (wpath.scripts, [empty_file]), - (wpath.predisconnectscripts, [empty_file]), - (wpath.postdisconnectscripts, [empty_file]), - (wpath.preconnectscripts, [empty_file]), - (wpath.postconnectscripts, [empty_file]) - ]) - - if not wpath.no_install_ncurses: - data.append((wpath.curses, ['curses/curses_misc.py'])) - data.append((wpath.curses, ['curses/prefs_curses.py'])) - data.append((wpath.curses, ['curses/wicd-curses.py'])) - data.append((wpath.curses, ['curses/netentry_curses.py'])) - data.append((wpath.curses, ['curses/configscript_curses.py'])) - data.append((wpath.bin, ['scripts/wicd-curses'])) - if not wpath.no_install_man: - data.append((wpath.mandir + 'man8/', ['man/wicd-curses.8'])) - if not wpath.no_install_man and not wpath.no_install_i18n_man: - data.append((wpath.mandir + 'nl/man8/', - ['man/nl/wicd-curses.8'])) - if not wpath.no_install_docs: - data.append((wpath.docdir, ['curses/README.curses'])) - if not wpath.no_install_cli: - data.append((wpath.cli, ['cli/wicd-cli.py'])) - data.append((wpath.bin, ['scripts/wicd-cli'])) - if not wpath.no_install_man: - data.append((wpath.mandir + 'man8/', ['man/wicd-cli.8'])) - if not wpath.no_install_docs: - data.append((wpath.docdir, ['cli/README.cli'])) - piddir = os.path.dirname(wpath.pidfile) - if not piddir.endswith('/'): - piddir += '/' if not wpath.no_install_docs: - data.append((wpath.docdir, ['INSTALL', 'LICENSE', 'AUTHORS', - 'README', 'CHANGES', ])) - data.append((wpath.varlib, ['other/WHEREAREMYFILES'])) + data.append((wpath.docdir, ['AUTHORS', 'CHANGES', 'INSTALL', + 'LICENSE', 'README.cli', + 'README.curses', 'README.old', + 'README.rst'])) if not wpath.no_install_init: data.append((wpath.init, [wpath.initfile])) + if not wpath.no_install_man: data.append((wpath.mandir + 'man8/', ['man/wicd.8'])) data.append((wpath.mandir + 'man5/', @@ -447,32 +402,38 @@ class install(_install.install): ['man/wicd-wired-settings.conf.5'])) data.append((wpath.mandir + 'man5/', ['man/wicd-wireless-settings.conf.5'])) - data.append((wpath.mandir + 'man1/', ['man/wicd-client.1'])) - if not wpath.no_install_man and not wpath.no_install_i18n_man: - # Dutch translations of the man - data.append((wpath.mandir + 'nl/man8/', ['man/nl/wicd.8'])) - data.append((wpath.mandir + 'nl/man5/', - ['man/nl/wicd-manager-settings.conf.5'])) - data.append((wpath.mandir + 'nl/man5/', - ['man/nl/wicd-wired-settings.conf.5'])) - data.append((wpath.mandir + 'nl/man5/', - ['man/nl/wicd-wireless-settings.conf.5'])) - data.append((wpath.mandir + 'nl/man1/', - ['man/nl/wicd-client.1'])) + data.append((wpath.mandir + 'man8/', ['man/wicd-curses.8'])) + data.append((wpath.mandir + 'man8/', ['man/wicd-cli.8'])) + + if not wpath['no_install_i18n_man']: + # Dutch translations of the man + data.append((wpath.mandir + 'nl/man8/', ['man/nl/wicd.8'])) + data.append((wpath.mandir + 'nl/man5/', + ['man/nl/wicd-manager-settings.conf.5'])) + data.append((wpath.mandir + 'nl/man5/', + ['man/nl/wicd-wired-settings.conf.5'])) + data.append((wpath.mandir + 'nl/man5/', + ['man/nl/wicd-wireless-settings.conf.5'])) + data.append((wpath.mandir + 'nl/man8/', + ['man/nl/wicd-curses.8'])) + + # TODO(gryf): sort out paths for pmutils/acpi if not wpath.no_install_acpi: data.append((wpath.resume, ['other/80-wicd-connect.sh'])) data.append((wpath.suspend, ['other/50-wicd-suspend.sh'])) if not wpath.no_install_pmutils: data.append((wpath.pmutils, ['other/55wicd'])) + log.info('Using pid path %s', os.path.basename(wpath.pidfile)) + if not wpath.no_install_i18n: - print('Language support for', end=' ') for language in sorted(glob('translations/*')): language = language.replace('translations/', '') log.info('Language support for %s', language) - data.append((wpath.translations + language + '/LC_MESSAGES/', - ['translations/' + language + - '/LC_MESSAGES/wicd.mo'])) + data.append((os.path.join(wpath.translations, language, + '/LC_MESSAGES/'), + [os.path.join('translations/', language, + 'LC_MESSAGES', 'wicd.mo')])) for dir_ in (os.listdir('data')): path = os.path.join('data', dir_)