Anonymous avatar Anonymous committed 47d3fae

.

Comments (0)

Files changed (7)

+# Contributor: pierce.jason [VL7]
+
+pkgname=vasm
+pkgver=3.0.98.0
+#pkgver=3.0.99.9
+pkgrel=1
+pkgdesc="Vectorlinux's Administration & System Menu (Alpha release). 
+System configuration tool for both TUI and GUI. Complete rewrite of 
+vasm with goals such as to provide greater modularity for 
+maintainability, better support for localization and 
+internationalization, and tighter integration with the distro 
+installer and with the system its self. The prior vasm has been 
+renamed and moved to vasm-legacy and will remain installed on the 
+system for your convenience."
+arch=('any')
+url="https://bitbucket.org/m0e_lnx/vasm/wiki"
+license=('GPL')
+depends=( 'python' 'urwid' 'pyparted' 'python-pexpect' 'psutil' 'vasm-legacy' )
+#ADDRB="urwid, pyparted, python-pexpect, psutil, vasm-legacy"
+ADDRB="urwid, pyparted, python-pexpect, psutil"
+optdepends=(	"gparted: Not yet in 64bit repo"
+		"vasm-legacy: The tried and true bash vasm") # Manually mirror to slack-suggests
+backup("etc/sudoers.d/vasm")
+changelog="slack-changes"
+#source=("https://bitbucket.org/m0e_lnx/vasm/get/$pkgver.tar.bz2")
+source=("https://bitbucket.org/pierce_jason/vasm/get/$pkgver.tar.bz2"
+	"sudoers.d-vasm"
+	"vasm.desktop"
+	"vasm-tui.desktop")
+#	"slack-suggests")
+
+package() {
+	cd "$srcdir/$pkgname-$pkgver";
+	
+	mkdir -p $pkgdir/usr/share/$pkgname-$pkgver;
+	python -m compileall .; # Pre-generate .pyc files.
+	cp *.{py,pyc} $pkgdir/usr/share/$pkgname-$pkgver/;
+	cp -a modules $pkgdir/usr/share/$pkgname-$pkgver/
+	
+	install -d -m700 $pkgdir/etc/sudoers.d
+	install -m400 sudoers.d-vasm $pkgdir/etc/sudoers.d/
+	
+	mkdir -p $pkgdir/usr/bin;
+	install -m755 vasm $pkgdir/usr/bin/;
+	
+	mkdir -p $pkgdir/usr/share/applications;
+	cp *.desktop $pkgdir/usr/share/applications/;
+	
+	mkdir -p $pkgdir/usr/doc/$pkgname-$pkgver;
+	cp *.txt $pkgdir/usr/doc/$pkgname-$pkgver;
+	cp -a AUTHORS COPYING ChangeLog Credits MANIFEST README TODO $pkgdir/usr/doc/$pkgname-$pkgver/;
+#	for doc in AUTHORS COPYING ChangeLog Credits MANIFEST README TODO; do
+#		if [ -f $doc ]; then
+#			cp $doc $pkgdir/usr/doc/$pkgname-$pkgver/;
+#		fi;
+#	done;
+}
+
+cat > /dev/null << 'EndofComment' 
+package() {
+	cd "$srcdir/$pkgname-$pkgver"
+	python setup.py install --root="$pkgdir/" --optimize=1;
+}
+EndofComment

build/PKGBUILD.devel

+# Contributor: pierce.jason [VL7]
+
+pkgname=pyVasm-devel
+pkgver=0.0.99
+pkgrel=1
+pkgdesc="Update helper for pyVasm development tree."
+arch=('any')
+url="https://bitbucket.org/m0e_lnx/vasm/"
+license=('GPL')
+depends=('mercurial' 'urwid' 'pyparted' 'python-pexpect' 'psutil' 'sh' )
+ADDRB='mercurial, urwid, pyparted, python-pexpect, psutil, sh'
+install=
+options=(emptydirs)
+source=("pyVasm-helper.sh")
+sha256sums=('64fbf66e34676a8a4365b48555a9b5773fad2b9f992ec30a2e3613e5b2b075d6')
+
+package() {
+	cd $srcdir
+	mkdir -p $pkgdir/opt/$pkgname;
+	mkdir -p $pkgdir/usr/bin
+	
+	chmod 755 pyVasm-helper.sh;
+	cp pyVasm-helper.sh $pkgdir/usr/bin/;
+	ln -s /usr/bin/pyVasm-helper.sh $pkgdir/usr/bin/pyVasm
+}

build/slack-suggests

+gparted
+vasm-legacy

build/sudoers.d-vasm

+# sudoers.d-vasm-0.2
+Cmnd_Alias VASM-LEGACY=/bin/vasm-legacy,/sbin/vasm-legacy,/sbin/vlapt
+Cmnd_Alias VASM=/usr/bin/vasm
+
+# Anyone in the group 'adm'(administrative special privs) can run some programs with a password.
+%adm ALL=VASM,VASM-LEGACY,HW2

build/vasm-devel.sh

+#!/bin/sh
+SELF=$(basename $0 | cut -d. -f1)
+helper_ver="0.1"
+
+usage() {
+cat <<HELP
+$SELF - Update helper for ${pkgname%-devel} development tree.
+Handles update checking and launches ${pkgname%-devel}. Any options after a double
+dash -- are passed unmodified to the ${pkgname%-devel} subprocess.
+ver. $helper_ver
+
+Usage: $SELF [-u] [-h]
+Usage: $SELF [-a] [-l] [VASM UI] -- [VASM OPTS]
+
+Options:
+	-a, --alternate_source <mercurial repo>
+		Use alternate source repo for updates.
+		Default: $hg_url
+		NOTE: Option not current implemented.
+	-h,  --help
+		Output this help message.
+	-l, --library
+		Start helper in shell library mode. Do not run any functions.
+		Allow functions and variables to be sourced into an
+		interactive POSIX environment.
+	-u, --update
+		Run update checks then exit.	
+		
+VASM UI selects the user interface. If not specified, auto-selection is
+based on presence of running Xorg(env DISPLAY). Usually resulting in GUI.
+
+Valid VASM UI choices:
+	tui
+		Text user interface, utilizing urwid display toolkit.
+	gui
+		Graphical user interface, utilizing gtk display toolkit.
+HELP
+}
+
+
+#####################  Configuration  #####################
+
+pkgname="vasm-devel"
+pkgdir="/opt/$pkgname" # Location of files on disk
+hg_url="https://bitbucket.org/m0e_lnx/vasm" # Where to clone/pullfrom
+change_file=".hg/last_pull" # File for checking last pull
+update_timeframe="4"; # 4 days between update checks
+	
+#####################  Functions  #####################
+
+# Ensures directory exists and repo has been cloned.
+startup_verification() {
+	if [ ! -d "$pkgdir" ]; then
+		echo "Directory $pkgdir does not exist.";
+		echo -e "This should have been created by package install.\nExiting.";	
+		exit;
+	fi;
+	
+	cd $pkgdir;
+	
+	if [ ! -d "$pkgdir/.hg" ]; then
+		echo "Directory $pkgdir/.hg does not exist.";
+		echo "Devel repo not initialized. Cloning now.";
+		
+		hg clone $hg_url $pkgdir/; local hg_ret=$?;
+		touch_change_file $hg_ret;
+	fi;
+}
+
+# List files changed since last update.
+# Run between pull and update commands.
+show_changed() {
+	hg status --rev . --rev tip;
+}
+
+# Update the timestamp on our change_file.
+# First check if any problems pulling (hg_ret).
+touch_change_file() {
+	local hg_ret=$1;
+
+	if [ "$hg_ret" -gt "0" ]; then
+		echo "Problem pulling updates. hg returned status $hg_ret";
+		exit 1;
+	else
+		# 'Touch' the change_file.
+		echo "Do not remove." > $pkgdir/$change_file; 
+	fi;
+}
+
+# See if our check_file dates indicate a need to update.
+# Turn dates 2011-10-18* into 20111018 for doing math.
+# Prompt before checking for updates.
+need_updates() {
+	local last_pull;
+	local today;
+	local difference;
+	
+	if [ -f $pkgdir/$change_file ]; then
+		last_pull=$( stat -c%y $pkgdir/$change_file | cut -d " " -f1 | sed "s/-//g" );
+	else
+		get_updates;
+		return;
+	fi;
+	
+	today=$( date +%F | sed "s/-//g" );
+	difference=$(( $today - $last_pull ));
+	if [ "$difference" -gt "$update_timeframe" ]; then
+		echo "Time to check for updates. Run \`hg pull\` now? [Y/n]";
+		read confirm;
+		if [ "$confirm" != "n" ]; then
+			get_updates;
+			return;
+		else
+			echo "Update check aborted. You can do this at any time by running \`hg pull && hg update\`.";
+			return;
+		fi;
+	else
+		echo "Less than $update_timeframe days since last check. Not doing automatic update.";
+		echo "You can force update at any time by running \`$SELF -u\`.";
+	fi;
+}
+
+# Pull and display updates. Update change_file timestamp.
+# Prompt before merging updates into filesystem.
+get_updates() {
+	hg pull; local hg_ret=$?;
+	touch_change_file $hg_ret;
+	show_changed;
+	echo "Merge these changes? [Y/n]";
+	read confirm;
+	if [ "$confirm" != "n" ]; then
+		hg update;
+	else
+		echo "Merge aborted. You can do this at any time by running \`hg update\`.";
+	fi;
+}
+
+choose_ui() {
+	local ui_choice;
+	local ui_command;
+	
+	if [ -z "$1" ]; then
+		if [ -z "$DISPLAY" ]; then
+			ui_choice="tui";
+		else
+			ui_choice="gui";
+		fi;
+	else
+		ui_choice="$1";
+	fi;
+	
+	case "$1" in
+		tui	) ;;
+		gui	) ;;
+		*	) echo "Unknown ui selected: $ui_choice. If this is really what you want, try passing it directly to ${pkgname%-devel}."
+	esac;
+	
+	echo "Running ${pkgname%-devel} with selected UI: $ui_choice." > /dev/stderr;
+	echo $ui_command;
+}
+
+main() {
+	local ui_cmd;
+	
+	# Make sure we have a directory and a repo in place.
+	startup_verification;
+	
+	# Check timestamps to see if we need to try to update.
+	need_updates;	
+	
+	ui_cmd=$( choose_ui $1 );
+	
+	echo "python2 $ui_cmd";
+	python2 $ui_cmd;
+	exit 0;
+}
+
+#####################  Dispatcher code	#####################
+
+if [ -z "$1" ]; then
+	main;
+fi;
+
+until [ -z "$1" ]; do
+	case "$1" in
+		-a | --alternate_source ) hg_url="$2"; shift;;
+		-l | --library ) DO='';;
+		-u | --update ) startup_verification; DO="get_updates";;
+		-h | --help | -* ) usage; exit;;
+		* ) DO="main $1";;
+	esac;
+	shift;
+done;
+
+eval "$DO";

build/vasm-tui.desktop

+[Desktop Entry]
+Comment[en_US]=VASM Text User Interface
+Comment=VASM Text User Interface
+Exec=/usr/bin/vasm -i tui
+GenericName[en_US]=VL Administration & System Menu
+GenericName=VL Administration & System Menu
+Icon=package-utilities
+MimeType=
+Name[en_US]=VASM (TUI)
+Name=VASM (TUI)
+Path=
+StartupNotify=true
+Terminal=true
+TerminalOptions=
+Type=Application
+Categories=Application;System;Utilities
+X-DBUS-ServiceName=
+X-DBUS-StartupType=
+X-KDE-SubstituteUID=false
+X-KDE-Username=

build/vasm.desktop

+[Desktop Entry]
+Comment[en_US]=VASM Graphical User Interface
+Comment=VASM Graphical User Interface
+Exec=/usr/bin/vasm
+GenericName[en_US]=VL Administration & System Menu
+GenericName=VL Administration & System Menu
+Icon=package-utilities
+MimeType=
+Name[en_US]=VASM (GUI)
+Name=VASM (GUI)
+Path=
+StartupNotify=true
+Terminal=false
+TerminalOptions=
+Type=Application
+Categories=Application;System;Utilities
+X-DBUS-ServiceName=
+X-DBUS-StartupType=
+X-KDE-SubstituteUID=false
+X-KDE-Username=
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.