From 3cd11fc3f3329894f08ebb9ca9ed6b7784c6d16c Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 00:44:15 +0000 Subject: [PATCH 01/12] initial automake/autoconf configuration --- Makefile.am | 1 + configure.ac | 18 ++++++++++++++++++ usr/bin/Makefile.am | 2 ++ usr/lib/byobu/Makefile.am | 3 +++ usr/share/doc/byobu/Makefile.am | 2 ++ usr/share/man/man1/Makefile.am | 2 ++ 6 files changed, 28 insertions(+) create mode 100644 Makefile.am create mode 100644 configure.ac create mode 100644 usr/bin/Makefile.am create mode 100644 usr/lib/byobu/Makefile.am create mode 100644 usr/share/doc/byobu/Makefile.am create mode 100644 usr/share/man/man1/Makefile.am diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 00000000..34be018f --- /dev/null +++ b/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = usr/share/doc/byobu usr/lib/byobu usr/share/man/man1 usr/bin diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..ba3669ac --- /dev/null +++ b/configure.ac @@ -0,0 +1,18 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.65]) +AC_INIT(byobu, 2.83, http://bugs.launchpad.net/byobu) +AM_INIT_AUTOMAKE(byobu, 2.83) + +# Checks for programs. + +# Checks for libraries. + +# Checks for header files. + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +AC_OUTPUT(Makefile usr/share/doc/byobu/Makefile usr/lib/byobu/Makefile usr/share/man/man1/Makefile usr/bin/Makefile) diff --git a/usr/bin/Makefile.am b/usr/bin/Makefile.am new file mode 100644 index 00000000..b6726525 --- /dev/null +++ b/usr/bin/Makefile.am @@ -0,0 +1,2 @@ +bin_SCRIPTS = byobu byobu-config byobu-export byobu-janitor byobu-launch byobu-launcher byobu-launcher-install byobu-launcher-uninstall byobu-reconnect-sockets byobu-select-profile byobu-select-session byobu-status byobu-status-detail shell + diff --git a/usr/lib/byobu/Makefile.am b/usr/lib/byobu/Makefile.am new file mode 100644 index 00000000..cf17970e --- /dev/null +++ b/usr/lib/byobu/Makefile.am @@ -0,0 +1,3 @@ +libdirdir = $(datadir)/lib/@PACKAGE@ +libdir_SCRIPTS = apport arch battery cpu_count cpu_freq cpu_temp custom date disk disk_io ec2_cost fan_speed hostname ip_address load_average logo mail mem_available mem_used menu network processes rcs_cost reboot_required release services time time_utc updates_available uptime users whoami wifi_quality + diff --git a/usr/share/doc/byobu/Makefile.am b/usr/share/doc/byobu/Makefile.am new file mode 100644 index 00000000..3c8fcd12 --- /dev/null +++ b/usr/share/doc/byobu/Makefile.am @@ -0,0 +1,2 @@ +docdir = $(datadir)/doc/@PACKAGE@ +doc_DATA = help.txt diff --git a/usr/share/man/man1/Makefile.am b/usr/share/man/man1/Makefile.am new file mode 100644 index 00000000..41da813c --- /dev/null +++ b/usr/share/man/man1/Makefile.am @@ -0,0 +1,2 @@ +man_MANS = byobu.1 byobu-config.1 byobu-export.1 byobu-launcher.1 byobu-reconnect-sockets.1 byobu-select-profile.1 byobu-select-session.1 byobu-status.1 byobu-status-detail.1 shell.1 + From 38bcf1416ff191a80d5696d2d4372e6d42d578f2 Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 00:51:17 +0000 Subject: [PATCH 02/12] add changelog, applications makefile.am --- ChangeLog | 1 + Makefile.am | 2 +- configure.ac | 2 +- usr/share/applications/Makefile.am | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) create mode 120000 ChangeLog create mode 100644 usr/share/applications/Makefile.am diff --git a/ChangeLog b/ChangeLog new file mode 120000 index 00000000..d526672c --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ +debian/changelog \ No newline at end of file diff --git a/Makefile.am b/Makefile.am index 34be018f..cf336ffe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1 @@ -SUBDIRS = usr/share/doc/byobu usr/lib/byobu usr/share/man/man1 usr/bin +SUBDIRS = usr/share/applications usr/share/doc/byobu usr/lib/byobu usr/share/man/man1 usr/bin diff --git a/configure.ac b/configure.ac index ba3669ac..9c6339fe 100644 --- a/configure.ac +++ b/configure.ac @@ -15,4 +15,4 @@ AM_INIT_AUTOMAKE(byobu, 2.83) # Checks for library functions. -AC_OUTPUT(Makefile usr/share/doc/byobu/Makefile usr/lib/byobu/Makefile usr/share/man/man1/Makefile usr/bin/Makefile) +AC_OUTPUT(Makefile usr/share/applications/Makefile usr/share/doc/byobu/Makefile usr/lib/byobu/Makefile usr/share/man/man1/Makefile usr/bin/Makefile) diff --git a/usr/share/applications/Makefile.am b/usr/share/applications/Makefile.am new file mode 100644 index 00000000..c89c60b3 --- /dev/null +++ b/usr/share/applications/Makefile.am @@ -0,0 +1,2 @@ +applicationdir = $(datadir)/applications/ +application_SCRIPTS = byobu.desktop From 7843ba61eaa018c363a360fd53d0f334dc8e7b1b Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 01:03:36 +0000 Subject: [PATCH 03/12] add ec2 makefile --- Makefile.am | 7 ++++++- configure.ac | 2 +- usr/share/byobu/ec2/Makefile.am | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 usr/share/byobu/ec2/Makefile.am diff --git a/Makefile.am b/Makefile.am index cf336ffe..5eeb9e1e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1,6 @@ -SUBDIRS = usr/share/applications usr/share/doc/byobu usr/lib/byobu usr/share/man/man1 usr/bin +SUBDIRS = usr/share/applications \ + usr/share/byobu/ec2 \ + usr/share/doc/byobu \ + usr/lib/byobu \ + usr/share/man/man1 \ + usr/bin diff --git a/configure.ac b/configure.ac index 9c6339fe..475ee0b4 100644 --- a/configure.ac +++ b/configure.ac @@ -15,4 +15,4 @@ AM_INIT_AUTOMAKE(byobu, 2.83) # Checks for library functions. -AC_OUTPUT(Makefile usr/share/applications/Makefile usr/share/doc/byobu/Makefile usr/lib/byobu/Makefile usr/share/man/man1/Makefile usr/bin/Makefile) +AC_OUTPUT(Makefile usr/share/applications/Makefile usr/share/byobu/ec2/Makefile usr/share/doc/byobu/Makefile usr/lib/byobu/Makefile usr/share/man/man1/Makefile usr/bin/Makefile) diff --git a/usr/share/byobu/ec2/Makefile.am b/usr/share/byobu/ec2/Makefile.am new file mode 100644 index 00000000..23f8bf60 --- /dev/null +++ b/usr/share/byobu/ec2/Makefile.am @@ -0,0 +1,2 @@ +ec2dir = $(datadir)/@PACKAGE@/ec2 +ec2_DATA = rates.eu_ie rates.us_ca rates.us_va From b6f81fddae02139ca6ecae63a23c9eaf6ef006d3 Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 01:13:23 +0000 Subject: [PATCH 04/12] added profiles makefile --- Makefile.am | 1 + configure.ac | 2 +- usr/share/byobu/profiles/Makefile.am | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 usr/share/byobu/profiles/Makefile.am diff --git a/Makefile.am b/Makefile.am index 5eeb9e1e..288b4949 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = usr/share/applications \ usr/share/byobu/ec2 \ + usr/share/byobu/profiles \ usr/share/doc/byobu \ usr/lib/byobu \ usr/share/man/man1 \ diff --git a/configure.ac b/configure.ac index 475ee0b4..68f3e27a 100644 --- a/configure.ac +++ b/configure.ac @@ -15,4 +15,4 @@ AM_INIT_AUTOMAKE(byobu, 2.83) # Checks for library functions. -AC_OUTPUT(Makefile usr/share/applications/Makefile usr/share/byobu/ec2/Makefile usr/share/doc/byobu/Makefile usr/lib/byobu/Makefile usr/share/man/man1/Makefile usr/bin/Makefile) +AC_OUTPUT(Makefile usr/share/applications/Makefile usr/share/byobu/ec2/Makefile usr/share/byobu/profiles/Makefile usr/share/doc/byobu/Makefile usr/lib/byobu/Makefile usr/share/man/man1/Makefile usr/bin/Makefile) diff --git a/usr/share/byobu/profiles/Makefile.am b/usr/share/byobu/profiles/Makefile.am new file mode 100644 index 00000000..e35cd83a --- /dev/null +++ b/usr/share/byobu/profiles/Makefile.am @@ -0,0 +1,2 @@ +profilesdir = $(datadir)/@PACKAGE@/profiles +profiles_DATA = byoburc common Makefile.am NONE From d9decbe66ed14b19ff56ef2c1740fe7fd5d344a9 Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 01:14:45 +0000 Subject: [PATCH 05/12] beautify configure.ac --- configure.ac | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 68f3e27a..0a6b3fe7 100644 --- a/configure.ac +++ b/configure.ac @@ -15,4 +15,10 @@ AM_INIT_AUTOMAKE(byobu, 2.83) # Checks for library functions. -AC_OUTPUT(Makefile usr/share/applications/Makefile usr/share/byobu/ec2/Makefile usr/share/byobu/profiles/Makefile usr/share/doc/byobu/Makefile usr/lib/byobu/Makefile usr/share/man/man1/Makefile usr/bin/Makefile) +AC_OUTPUT(Makefile \ + usr/share/applications/Makefile \ + usr/share/byobu/ec2/Makefile \ + usr/share/byobu/profiles/Makefile \ + usr/share/doc/byobu/Makefile \ + usr/lib/byobu/Makefile \ + usr/share/man/man1/Makefile usr/bin/Makefile) From 650cb05c449019ebc74c04c7f157cf08197b6757 Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 01:17:14 +0000 Subject: [PATCH 06/12] added pixmaps makefile --- Makefile.am | 1 + configure.ac | 1 + usr/share/byobu/pixmaps/Makefile.am | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 usr/share/byobu/pixmaps/Makefile.am diff --git a/Makefile.am b/Makefile.am index 288b4949..e1b2c237 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = usr/share/applications \ usr/share/byobu/ec2 \ + usr/share/byobu/pixmaps \ usr/share/byobu/profiles \ usr/share/doc/byobu \ usr/lib/byobu \ diff --git a/configure.ac b/configure.ac index 0a6b3fe7..aadabf29 100644 --- a/configure.ac +++ b/configure.ac @@ -18,6 +18,7 @@ AM_INIT_AUTOMAKE(byobu, 2.83) AC_OUTPUT(Makefile \ usr/share/applications/Makefile \ usr/share/byobu/ec2/Makefile \ + usr/share/byobu/pixmaps/Makefile \ usr/share/byobu/profiles/Makefile \ usr/share/doc/byobu/Makefile \ usr/lib/byobu/Makefile \ diff --git a/usr/share/byobu/pixmaps/Makefile.am b/usr/share/byobu/pixmaps/Makefile.am new file mode 100644 index 00000000..8d5e60b4 --- /dev/null +++ b/usr/share/byobu/pixmaps/Makefile.am @@ -0,0 +1,2 @@ +pixmapsdir = $(datadir)/@PACKAGE@/pixmaps +pixmaps_DATA = byobu.svg From 9fae232a46dd6111eb3b4e0c351c07afe529669e Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 01:19:50 +0000 Subject: [PATCH 07/12] added tests makefile --- Makefile.am | 1 + configure.ac | 1 + usr/share/byobu/tests/Makefile.am | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 usr/share/byobu/tests/Makefile.am diff --git a/Makefile.am b/Makefile.am index e1b2c237..1fbd74b3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS = usr/share/applications \ usr/share/byobu/ec2 \ usr/share/byobu/pixmaps \ usr/share/byobu/profiles \ + usr/share/byobu/tests \ usr/share/doc/byobu \ usr/lib/byobu \ usr/share/man/man1 \ diff --git a/configure.ac b/configure.ac index aadabf29..0e156be5 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,7 @@ AC_OUTPUT(Makefile \ usr/share/byobu/ec2/Makefile \ usr/share/byobu/pixmaps/Makefile \ usr/share/byobu/profiles/Makefile \ + usr/share/byobu/tests/Makefile \ usr/share/doc/byobu/Makefile \ usr/lib/byobu/Makefile \ usr/share/man/man1/Makefile usr/bin/Makefile) diff --git a/usr/share/byobu/tests/Makefile.am b/usr/share/byobu/tests/Makefile.am new file mode 100644 index 00000000..11e60cf8 --- /dev/null +++ b/usr/share/byobu/tests/Makefile.am @@ -0,0 +1,2 @@ +testsdir = $(datadir)/@PACKAGE@/tests +tests_SCRIPTS = byobu-time-notifications From 3bc657902e9aa721376c314bff261db152dcc5f9 Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 01:21:38 +0000 Subject: [PATCH 08/12] added windows makefile --- Makefile.am | 1 + configure.ac | 1 + usr/share/byobu/windows/Makefile.am | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 usr/share/byobu/windows/Makefile.am diff --git a/Makefile.am b/Makefile.am index 1fbd74b3..9d3020af 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = usr/share/applications \ usr/share/byobu/pixmaps \ usr/share/byobu/profiles \ usr/share/byobu/tests \ + usr/share/byobu/windows \ usr/share/doc/byobu \ usr/lib/byobu \ usr/share/man/man1 \ diff --git a/configure.ac b/configure.ac index 0e156be5..228e42fa 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,7 @@ AC_OUTPUT(Makefile \ usr/share/byobu/pixmaps/Makefile \ usr/share/byobu/profiles/Makefile \ usr/share/byobu/tests/Makefile \ + usr/share/byobu/windows/Makefile \ usr/share/doc/byobu/Makefile \ usr/lib/byobu/Makefile \ usr/share/man/man1/Makefile usr/bin/Makefile) diff --git a/usr/share/byobu/windows/Makefile.am b/usr/share/byobu/windows/Makefile.am new file mode 100644 index 00000000..b0900766 --- /dev/null +++ b/usr/share/byobu/windows/Makefile.am @@ -0,0 +1,2 @@ +windowsdir = $(datadir)/@PACKAGE@/windows +windows_SCRIPTS = common From f2c871cbb8cafb700082745975a202ef78ac425d Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 01:30:00 +0000 Subject: [PATCH 09/12] minor fixes in locations --- usr/lib/byobu/Makefile.am | 2 +- usr/share/byobu/profiles/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/lib/byobu/Makefile.am b/usr/lib/byobu/Makefile.am index cf17970e..6c4eb6be 100644 --- a/usr/lib/byobu/Makefile.am +++ b/usr/lib/byobu/Makefile.am @@ -1,3 +1,3 @@ -libdirdir = $(datadir)/lib/@PACKAGE@ +libdirdir = $(prefix)/lib/@PACKAGE@ libdir_SCRIPTS = apport arch battery cpu_count cpu_freq cpu_temp custom date disk disk_io ec2_cost fan_speed hostname ip_address load_average logo mail mem_available mem_used menu network processes rcs_cost reboot_required release services time time_utc updates_available uptime users whoami wifi_quality diff --git a/usr/share/byobu/profiles/Makefile.am b/usr/share/byobu/profiles/Makefile.am index e35cd83a..c9062cae 100644 --- a/usr/share/byobu/profiles/Makefile.am +++ b/usr/share/byobu/profiles/Makefile.am @@ -1,2 +1,2 @@ profilesdir = $(datadir)/@PACKAGE@/profiles -profiles_DATA = byoburc common Makefile.am NONE +profiles_DATA = byoburc common NONE From e6171401ac6fec0c671b3b419506424b8dd198a1 Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 02:00:18 +0000 Subject: [PATCH 10/12] support a BYOBU_PREFIX environment variable for relocation; default to /usr --- usr/bin/byobu | 5 +++-- usr/bin/byobu-config | 10 +++++++--- usr/bin/byobu-janitor | 7 ++++--- usr/bin/byobu-launcher | 10 ++++++---- usr/bin/byobu-select-profile | 3 ++- usr/bin/byobu-select-session | 10 +++++++--- usr/bin/byobu-status | 7 ++++--- usr/lib/byobu/ec2_cost | 3 ++- 8 files changed, 35 insertions(+), 20 deletions(-) diff --git a/usr/bin/byobu b/usr/bin/byobu index b0f282dd..362c10e6 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -19,6 +19,7 @@ PKG="byobu" VERSION=2.83 +[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" # Add a version argument for debugging purposes if [ "$#" = "1" ] && [ "$1" = "-v" ]; then @@ -56,7 +57,7 @@ export BYOBU_WINDOWS grep -qs "^[^#]" "$BYOBU_WINDOWS" && DEFAULT_WINDOW= || DEFAULT_WINDOW="shell" # Check if our terminfo supports 256 colors -[ -x /usr/bin/tput ] && [ $(/usr/bin/tput colors 2>/dev/null || echo 0) -eq 256 ] && SCREEN_TERM="-T screen-256color" +$(which tput >/dev/null) && [ $(tput colors 2>/dev/null || echo 0) -eq 256 ] && SCREEN_TERM="-T screen-256color" # Create or update ssh-agent socket if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then @@ -64,7 +65,7 @@ if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then ln -sf "$SSH_AUTH_SOCK" "$RUN/$PKG.ssh-agent" fi -PROFILE="-c /usr/share/$PKG/profiles/byoburc" +PROFILE="-c $BYOBU_PREFIX/share/$PKG/profiles/byoburc" NAME="-S $PKG" # Zero out $NAME if user has specified a -S for i in $@; do diff --git a/usr/bin/byobu-config b/usr/bin/byobu-config index 1d9b5c5e..fb9d9a5b 100755 --- a/usr/bin/byobu-config +++ b/usr/bin/byobu-config @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#!/usr/bin/python # # byobu-config # Copyright (C) 2008 Canonical Ltd. @@ -28,11 +28,15 @@ from snack import * HOME=os.getenv("HOME") USER=os.getenv("USER") +if os.getenv("BYOBU_PREFIX"): + PREFIX = os.getenv("BYOBU_PREFIX") +else: + PREFIX = "/usr" PKG="byobu" -SHARE='/usr/share/'+PKG +SHARE=PREFIX+'/share/'+PKG if not os.path.exists(SHARE): SHARE = "%s/.%s/%s" % (HOME, PKG, SHARE) -DOC='/usr/share/doc/'+PKG +DOC=PREFIX+'/share/doc/'+PKG if not os.path.exists(DOC): DOC = "%s/.%s/%s" % (HOME, PKG, DOC) DEF_ESC="A" diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 5ad018fe..447d108d 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -20,6 +20,7 @@ # along with this program. If not, see . PKG="byobu" +[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" [ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen" RUN="$SOCKETDIR/S-$USER" FLAG="$RUN/$PKG.reload-required" @@ -55,12 +56,12 @@ fi # Seed the configuration [ -d "$HOME/.$PKG" ] || mkdir -p "$HOME/.$PKG" [ -r "$HOME/.$PKG/color" ] || printf "BACKGROUND=k\nFOREGROUND=w\nMONOCHROME=0" > "$HOME/.$PKG/color" -[ -r "$PROFILE" ] || ln -sf /usr/share/$PKG/profiles/common "$PROFILE" +[ -r "$PROFILE" ] || ln -sf $BYOBU_PREFIX/share/$PKG/profiles/common "$PROFILE" # Affects: Symlinks pointing to color profiles if [ -h "$PROFILE" ]; then case "$(stat $PROFILE)" in - *File:*-\>*/usr/share/byobu/profiles/*) + *File:*-\>*$BYOBU_PREFIX/share/byobu/profiles/*) # Set default colors BG=W FG=k @@ -92,7 +93,7 @@ if [ -h "$PROFILE" ]; then esac fi -[ -s "$HOME/.$PKG/keybindings" ] || echo "source /usr/share/$PKG/keybindings/common" > "$HOME/.$PKG/keybindings" +[ -s "$HOME/.$PKG/keybindings" ] || echo "source $BYOBU_PREFIX/share/$PKG/keybindings/common" > "$HOME/.$PKG/keybindings" [ -r "$HOME/.$PKG/status" ] || $(grep -A 999999 BEGIN_CUT_HERE /etc/$PKG/statusrc | grep -B 999999 END_CUT_HERE | grep -v CUT > "$HOME/.$PKG/status") [ -r "$HOME/.$PKG/windows" ] || touch "$HOME/.$PKG/windows" [ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" diff --git a/usr/bin/byobu-launcher b/usr/bin/byobu-launcher index f43a4263..130f2054 100755 --- a/usr/bin/byobu-launcher +++ b/usr/bin/byobu-launcher @@ -17,6 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" + if [ ! -e "$HOME/.byobu/disable-autolaunch" ]; then case "$TERM" in *screen*) @@ -38,14 +40,14 @@ if [ ! -e "$HOME/.byobu/disable-autolaunch" ]; then false ;; *) - exec /usr/bin/byobu "$@" + exec $BYOBU_PREFIX/bin/byobu "$@" ;; esac else - exec /usr/bin/byobu "$@" + exec $BYOBU_PREFIX/bin/byobu "$@" fi else - exec /usr/bin/byobu "$@" + exec $BYOBU_PREFIX/bin/byobu "$@" fi ;; *) @@ -54,7 +56,7 @@ if [ ! -e "$HOME/.byobu/disable-autolaunch" ]; then esac ;; *) - exec /usr/bin/byobu "$@" + exec $BYOBU_PREFIX/bin/byobu "$@" ;; esac fi diff --git a/usr/bin/byobu-select-profile b/usr/bin/byobu-select-profile index 7daf3dd6..2966075f 100755 --- a/usr/bin/byobu-select-profile +++ b/usr/bin/byobu-select-profile @@ -23,6 +23,7 @@ # ./debian/rules get-po PKG="byobu" +[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" [ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen" TEXTDOMAIN="$PKG" @@ -62,7 +63,7 @@ EOT # Initialize variables FILE="$HOME"/."$PKG"/color PROFILE="$HOME/.$PKG/profile" -[ -r "$PROFILE" ] || ln -sf /usr/share/$PKG/profiles/common "$PROFILE" +[ -r "$PROFILE" ] || ln -sf $BYOBU_PREFIX/share/$PKG/profiles/common "$PROFILE" selected=-1 color= diff --git a/usr/bin/byobu-select-session b/usr/bin/byobu-select-session index 6c1de8eb..cac994fa 100755 --- a/usr/bin/byobu-select-session +++ b/usr/bin/byobu-select-session @@ -22,6 +22,10 @@ import commands, os, re, sys PKG = "byobu" SHELL = os.getenv("SHELL", "/bin/bash") +if os.getenv("BYOBU_PREFIX"): + PREFIX = os.getenv("BYOBU_PREFIX") +else: + PREFIX = "/usr" choice = "" sessions = [] text = [] @@ -68,10 +72,10 @@ if i > 1: if choice: if choice == i-1: # Create a new session - os.execv("/usr/bin/byobu", ["", SHELL]) + os.execv(PREFIX+"/bin/byobu", ["", SHELL]) else: # Attach to the chosen session; must use the 'screen' binary - os.execv("/usr/bin/screen", ["", "-AOxRR", sessions[choice-1]]) + os.execv(PREFIX+"/bin/screen", ["", "-AOxRR", sessions[choice-1]]) # No valid selection, default to the youngest session, create if necessary -os.execv("/usr/bin/byobu", ["", "-AOxRR"]) +os.execv(PREFIX+"/bin/byobu", ["", "-AOxRR"]) diff --git a/usr/bin/byobu-status b/usr/bin/byobu-status index 8d3ce92b..36b7c0fc 100755 --- a/usr/bin/byobu-status +++ b/usr/bin/byobu-status @@ -18,13 +18,14 @@ # along with this program. If not, see . PKG="byobu" +[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" find_script () { # Allow for local status scripts if [ -x "$HOME/.$PKG/bin/$1" ]; then echo "$HOME/.$PKG/bin/$1" - elif [ -x "/usr/lib/$PKG/$1" ]; then - echo "/usr/lib/$PKG/$1" + elif [ -x "$BYOBU_PREFIX/lib/$PKG/$1" ]; then + echo "$BYOBU_PREFIX/lib/$PKG/$1" else echo "/dev/null" fi @@ -65,7 +66,7 @@ case "$P" in VER=$(set -- $(dpkg-query --show $PKG); echo "$2") fi printf "$PKG-$VER Detailed Status Navigation\n Expand all - zr\t\tCollapse all - zm\n Expand one - zo\t\tCollapse one - zc\n\n" - for i in "/usr/lib/$PKG"/* "$HOME/.$PKG/bin"/*; do + for i in "$BYOBU_PREFIX/lib/$PKG"/* "$HOME/.$PKG/bin"/*; do i=${i##*/} [ "$i" = "menu" ] && continue script=`find_script $i` diff --git a/usr/lib/byobu/ec2_cost b/usr/lib/byobu/ec2_cost index 9b6ec6f8..e4098c84 100755 --- a/usr/lib/byobu/ec2_cost +++ b/usr/lib/byobu/ec2_cost @@ -19,6 +19,7 @@ DETAIL=0 PKG="byobu" +[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" color 2>/dev/null || color() { true; } for arg in $@; do @@ -30,7 +31,7 @@ for arg in $@; do done # Get the going rates -[ -r "$HOME/.$PKG/ec2_rates" ] || ln -s /usr/share/$PKG/ec2/rates.us_ca "$HOME/.$PKG/ec2_rates" +[ -r "$HOME/.$PKG/ec2_rates" ] || ln -s $BYOBU_PREFIX/share/$PKG/ec2/rates.us_ca "$HOME/.$PKG/ec2_rates" . "$HOME/.$PKG/ec2_rates" || exit 1 # Count CPUs, Memory, Architecture From be50c29d9e371c0595c5fb838a2903c36fced66e Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 13:19:18 +0000 Subject: [PATCH 11/12] massive changeset to use BYOBU_PREFIX and allow for relocation (or installation as non-root) --- usr/bin/byobu | 9 ++++++++- usr/bin/byobu-janitor | 2 +- usr/bin/byobu-launcher | 3 ++- usr/bin/byobu-select-profile | 3 ++- usr/bin/byobu-status | 3 ++- usr/share/byobu/keybindings/f-keys | 2 +- usr/share/byobu/keybindings/screen-escape-keys | 2 +- usr/share/byobu/tests/byobu-time-notifications | 2 ++ 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/usr/bin/byobu b/usr/bin/byobu index 362c10e6..14dfd648 100755 --- a/usr/bin/byobu +++ b/usr/bin/byobu @@ -19,7 +19,14 @@ PKG="byobu" VERSION=2.83 -[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" +[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr" +export BYOBU_PREFIX + +if [ ! -x "$BYOBU_PREFIX/bin/$PKG" ]; then + echo "ERROR: Cannot find $BYOBU_PREFIX/bin/$PKG" 2>&1 + echo "ERROR: If you have installed it elsewhere, export BYOBU_PREFIX in your shell" 2>&1 + exit 1 +fi # Add a version argument for debugging purposes if [ "$#" = "1" ] && [ "$1" = "-v" ]; then diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 447d108d..3423a8ef 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -20,7 +20,7 @@ # along with this program. If not, see . PKG="byobu" -[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" +[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr" [ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen" RUN="$SOCKETDIR/S-$USER" FLAG="$RUN/$PKG.reload-required" diff --git a/usr/bin/byobu-launcher b/usr/bin/byobu-launcher index 130f2054..ce15f490 100755 --- a/usr/bin/byobu-launcher +++ b/usr/bin/byobu-launcher @@ -17,7 +17,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" +[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr" +export BYOBU_PREFIX if [ ! -e "$HOME/.byobu/disable-autolaunch" ]; then case "$TERM" in diff --git a/usr/bin/byobu-select-profile b/usr/bin/byobu-select-profile index 2966075f..9327d01b 100755 --- a/usr/bin/byobu-select-profile +++ b/usr/bin/byobu-select-profile @@ -23,7 +23,8 @@ # ./debian/rules get-po PKG="byobu" -[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" +[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr" +export BYOBU_PREFIX [ -r "/etc/$PKG/socketdir" ] && . "/etc/$PKG/socketdir" || SOCKETDIR="/var/run/screen" TEXTDOMAIN="$PKG" diff --git a/usr/bin/byobu-status b/usr/bin/byobu-status index 36b7c0fc..3fe4b835 100755 --- a/usr/bin/byobu-status +++ b/usr/bin/byobu-status @@ -18,7 +18,8 @@ # along with this program. If not, see . PKG="byobu" -[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" +[ -z "$BYOBU_PREFIX" ] && export BYOBU_PREFIX="/usr" +export BYOBU_PREFIX find_script () { # Allow for local status scripts diff --git a/usr/share/byobu/keybindings/f-keys b/usr/share/byobu/keybindings/f-keys index 4aac9f00..d3f75f49 100644 --- a/usr/share/byobu/keybindings/f-keys +++ b/usr/share/byobu/keybindings/f-keys @@ -41,5 +41,5 @@ register s "^a[g G$>^h" # Goes with ^a~ definition bind ~ eval 'process s' 'exec sed -i "/./,/^$/!d" /var/run/screen/S-$USER/byobu-exchange' 'echo "See: /var/run/screen/S-$USER/byobu-exchange"' # ctrl-a ~ | write the buffer to file # toggle f-key keybindings off -register d "^a:source /usr/share/byobu/keybindings/screen-escape-keys^M" +register d "^a:source $BYOBU_PREFIX/share/byobu/keybindings/screen-escape-keys^M" bind ! eval 'process d' 'backtick 111 9999999 9999999 byobu-status menu --disable-f-keys' diff --git a/usr/share/byobu/keybindings/screen-escape-keys b/usr/share/byobu/keybindings/screen-escape-keys index 076b5ae9..75103c3b 100644 --- a/usr/share/byobu/keybindings/screen-escape-keys +++ b/usr/share/byobu/keybindings/screen-escape-keys @@ -48,5 +48,5 @@ bind @ screen -t config 0 byobu-config # ctrl-a-$ Show detailed status bind $ screen -t status 0 byobu-status-detail # ctrl-a-! Toggle f-key keybindings on -register e "^a:source /usr/share/byobu/keybindings/f-keys^M" +register e "^a:source $BYOBU_PREFIX/share/byobu/keybindings/f-keys^M" bind ! eval 'process e' 'backtick 111 9999999 9999999 byobu-status menu' diff --git a/usr/share/byobu/tests/byobu-time-notifications b/usr/share/byobu/tests/byobu-time-notifications index a7d0c462..f1edf0f3 100755 --- a/usr/share/byobu/tests/byobu-time-notifications +++ b/usr/share/byobu/tests/byobu-time-notifications @@ -21,6 +21,8 @@ PKG=byobu RUNS=100 +[ -z "$BYOBU_PREFIX" ] && BYOBU_PREFIX="/usr" +export BYOBU_PREFIX loop() { for j in $(seq 1 $RUNS); do From e06b402d900b2c778212f1818d47dcfda1d2948b Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 28 Jul 2010 15:47:03 +0000 Subject: [PATCH 12/12] rest of fixes to get non-distro install working! --- Makefile.am | 4 +++- configure.ac | 2 ++ etc/byobu/Makefile.am | 2 ++ usr/bin/byobu-janitor | 11 ++++++++++- usr/share/byobu/keybindings/Makefile.am | 2 ++ 5 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 etc/byobu/Makefile.am create mode 100644 usr/share/byobu/keybindings/Makefile.am diff --git a/Makefile.am b/Makefile.am index 9d3020af..684bc285 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,7 @@ -SUBDIRS = usr/share/applications \ +SUBDIRS = etc/byobu \ + usr/share/applications \ usr/share/byobu/ec2 \ + usr/share/byobu/keybindings \ usr/share/byobu/pixmaps \ usr/share/byobu/profiles \ usr/share/byobu/tests \ diff --git a/configure.ac b/configure.ac index 228e42fa..0a5f9baa 100644 --- a/configure.ac +++ b/configure.ac @@ -16,8 +16,10 @@ AM_INIT_AUTOMAKE(byobu, 2.83) # Checks for library functions. AC_OUTPUT(Makefile \ + etc/byobu/Makefile \ usr/share/applications/Makefile \ usr/share/byobu/ec2/Makefile \ + usr/share/byobu/keybindings/Makefile \ usr/share/byobu/pixmaps/Makefile \ usr/share/byobu/profiles/Makefile \ usr/share/byobu/tests/Makefile \ diff --git a/etc/byobu/Makefile.am b/etc/byobu/Makefile.am new file mode 100644 index 00000000..5cf87afb --- /dev/null +++ b/etc/byobu/Makefile.am @@ -0,0 +1,2 @@ +etcdir = $(datadir)/@PACKAGE@/profiles +etc_DATA = statusrc socketdir diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 3423a8ef..636e747c 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -94,7 +94,16 @@ if [ -h "$PROFILE" ]; then fi [ -s "$HOME/.$PKG/keybindings" ] || echo "source $BYOBU_PREFIX/share/$PKG/keybindings/common" > "$HOME/.$PKG/keybindings" -[ -r "$HOME/.$PKG/status" ] || $(grep -A 999999 BEGIN_CUT_HERE /etc/$PKG/statusrc | grep -B 999999 END_CUT_HERE | grep -v CUT > "$HOME/.$PKG/status") +if [ ! -r "$HOME/.$PKG/status" ]; then + if [ -r /etc/$PKG/statusrc ]; then + skel=/etc/$PKG/statusrc + elif [ -r "$BYOBU_PREFIX/share/$PKG/profiles/statusrc" ]; then + skel="$BYOBU_PREFIX/share/$PKG/profiles/statusrc" + else + skel=/dev/null + fi + grep -A 999999 BEGIN_CUT_HERE $skel | grep -B 999999 END_CUT_HERE | grep -v CUT > "$HOME/.$PKG/status" +fi [ -r "$HOME/.$PKG/windows" ] || touch "$HOME/.$PKG/windows" [ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" diff --git a/usr/share/byobu/keybindings/Makefile.am b/usr/share/byobu/keybindings/Makefile.am new file mode 100644 index 00000000..26f9c992 --- /dev/null +++ b/usr/share/byobu/keybindings/Makefile.am @@ -0,0 +1,2 @@ +keybindingsdir = $(datadir)/@PACKAGE@/keybindings +keybindings_DATA = common f-keys none screen-escape-keys