[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r207 - GNUnet/contrib/OSX
From: |
grothoff |
Subject: |
[GNUnet-SVN] r207 - GNUnet/contrib/OSX |
Date: |
Mon, 7 Feb 2005 13:36:41 -0800 (PST) |
Author: grothoff
Date: 2005-02-07 13:36:40 -0800 (Mon, 07 Feb 2005)
New Revision: 207
Modified:
GNUnet/contrib/OSX/GNUnet
GNUnet/contrib/OSX/Info.plist
GNUnet/contrib/OSX/README
GNUnet/contrib/OSX/build_app
GNUnet/contrib/OSX/gnunet-peer-info
GNUnet/contrib/OSX/gnunetd
Log:
OSX updates from Jussi Eloranta
Modified: GNUnet/contrib/OSX/GNUnet
===================================================================
--- GNUnet/contrib/OSX/GNUnet 2005-02-07 20:32:26 UTC (rev 206)
+++ GNUnet/contrib/OSX/GNUnet 2005-02-07 21:36:40 UTC (rev 207)
@@ -1,86 +1,118 @@
#!/bin/bash
+#
+# Main task dialog.
+#
+# 0) Start / stop gnunetd
+# 1) Start graphical UI (with starting gnunetd if required)
+# 2) Start a shell with gnunet commands in path
+# 3) Run configuration utility
+# 4) Run help
+# 5) Download Apple's X11 package
+# 6) Check for updates
+# 7) View recent log entries
-HOMEPAGE=http://www.chem.jyu.fi/~eloranta/gnunetmac.html
-NOX=http://www.chem.jyu.fi/~eloranta/gnunetmac-nox.html
+# Locate install directory
-# Check for X11 - if not installed then help
+ROOTDIR=`dirname $0`
-if [ ! -d /usr/X11R6 ]; then
- exec /usr/bin/open /Applications/Safari.app $NOX
-fi
-
-rootdir=`dirname $0`
-
-if [ ! -d $rootdir ]; then
- cd ..
- rootdir=`pwd`
+if [ `echo $ROOTDIR | cut -c1` = . ]; then
+ ROOTDIR=`pwd`
fi
-if [ ! -d $rootdir ]; then
+if [ ! -d $ROOTDIR ]; then
echo "Can't locate GNUnet rootdir."
exit 0
fi
-if [ ! -d ~/.gnunet ]; then
- mkdir -p ~/.gnunet
- mkdir -p ~/.gnunet/data
- mkdir -p ~/.gnunet/data/hosts
- cp $rootdir/hosts/* ~/.gnunet/data/hosts
- /usr/bin/open /Applications/Safari.app $HOMEPAGE
-fi
+export ROOTDIR
-# Relocate PANGO - everytime since the app may have been moved...
-mkdir -p ~/.gnunet/pango
-PANGO_RC_FILE=~/.gnunet/pango/pango.rc
-export PANGO_RC_FILE
-cat << E_O_F > $PANGO_RC_FILE
-[Pango]
-ModuleFiles=$HOME/.gnunet/pango/pango.modules
-E_O_F
+. $ROOTDIR/GNUnet-funcs
-cp $rootdir/etc/pangox.aliases ~/.gnunet/pango
-pth=`fgrep ModulesPath $rootdir/etc/pango.modules | cut -d\ -f4`
-sed -e "s-$pth-$rootdir/pango-g" < $rootdir/etc/pango.modules >
~/.gnunet/pango/pango.modules
+gnetconf
-# Generate gnunet.root ? TODO: other than ethernet devices?
-if [ ! -f ~/.gnunet/gnunet.root ]; then
-# Locate active network interface (e.g. en0 or en1)
- act1=`ifconfig en0 2> /dev/null | grep inet | wc -l`
- act2=`ifconfig en1 2> /dev/null | grep inet | wc -l`
+checkversion
- cd $rootdir/etc
- if [ $act1 -gt 0 ]; then
- ip=`ifconfig en0 | grep inet\ | cut -f2 | cut -d\ -f2`
- sed -e "s/ACTIVE_IFACE/en0/g;s/ACTIVE_IP/$ip/g" < gnunet.root >
~/.gnunet/gnunet.root
- elif [ $act2 -gt 0 ]; then
- ip=`ifconfig en1 | grep inet\ | cut -f2 | cut -d\ -f2`
- sed -e "s/ACTIVE_IFACE/en1/g;s/ACTIVE_IP/$ip/g" < gnunet.root >
~/.gnunet/gnunet.root
+pango
+
+while true; do
+ cgnunetd
+ if [ $pid != 0 ]; then
+ gnet="Stop gnunetd"
else
- echo "Warning: Can\'t find active network interface - assuming en0."
- ip=`ifconfig en0 | grep inet\ | cut -f2 | cut -d\ -f2`
- sed -e "s/ACTIVE_IFACE/en0/g;s/ACTIVE_IP/$ip/g" < gnunet.root >
~/.gnunet/gnunet.root
+ gnet="Start gnunetd"
fi
- cd ..
-fi
-if [ ! -f ~/.gnunet/gnunet.conf ]; then
- cp $rootdir/etc/gnunet.user ~/.gnunet/gnunet.conf
-fi
+ sel=`$CD dropdown --text "Select function" --items "$gnet" "Start graphical
UI" "Start a shell for gnunet commands" "Configure" "Help" "Download X11 from
Apple" "Check for updates" "View gnunetd log file" --button1 "Run" --button2
"Quit"`
+ button=`echo $sel | cut -d\ -f1`
+ select=`echo $sel | cut -d\ -f2`
-# Do we need the server?
+ if [ $button = 2 ]; then
+ exit 0
+ fi
-if [ -e ~/.gnunet/gnunetd.pid ]; then
- pid=`cat ~/.gnunet/gnunetd.pid`
- if [ `ps -p $pid | wc -l` != 2 ]; then
- $rootdir/bin/gnunetd &
+ if [ $select = 0 ]; then
+ cgnunetd
+ if [ $pid = 0 ]; then
+ $ROOTDIR/bin/gnunetd &
+ else
+ kill $pid
+ fi
+ sleep 5
fi
-else
- $rootdir/bin/gnunetd &
-fi
-if [ "$SSH_CLIENT" != "" ]; then
- $rootdir/bin/gnunet-gtk &
-else
- /usr/bin/open-x11 $rootdir/bin/gnunet-gtk
-fi
-exit 0
+ if [ $select = 1 ]; then
+ cgnunetd
+ if [ $pid = 0 ]; then
+ $ROOTDIR/bin/gnunetd &
+ fi
+ if [ ! -d /usr/X11R6 ]; then
+ $CD textbox --title "X11 not installed" --text-from-file
$ROOTDIR/doc/gnunetmac-nox.txt --button1 Cancel
+ else
+ /usr/bin/open-x11 $ROOTDIR/bin/gnunet-gtk
+ fi
+ fi
+
+ if [ $select = 2 ]; then
+ rm -f /tmp/tmp.$$
+ cat > /tmp/tmp.$$ <<EOF
+#!/bin/bash
+PATH=\$PATH:$ROOTDIR/bin; export PATH
+exec \`nidump passwd . | egrep ^\$USER: | cut -d: -f10\`
+EOF
+ chmod +x /tmp/tmp.$$
+ /usr/bin/open -a /Applications/Utilities/Terminal.app /tmp/tmp.$$
+ fi
+
+ if [ $select = 3 ]; then
+ wasrun=0
+ cgnunetd
+ if [ $pid != 0 ]; then
+ kill $pid
+ sleep 5
+ wasrun=1
+ fi
+ $ROOTDIR/GNUnet-config
+ if [ $wasrun = 1 ]; then
+ $ROOTDIR/bin/gnunetd &
+ fi
+ fi
+
+ if [ $select = 4 ]; then
+ $CD textbox --title "Welcome" --text-from-file $ROOTDIR/doc/gnunetmac.txt
--button1 OK
+ fi
+
+ if [ $select = 5 ]; then
+ open /Applications/Safari.app
http://www.apple.com/macosx/features/x11/download/
+ fi
+
+ if [ $select = 6 ]; then
+ open /Applications/Safari.app http://www.chem.jyu.fi/~eloranta/GNUnet.html
+ fi
+
+ if [ $select = 7 ]; then
+ open -e ~/gnunet/logs
+ fi
+done
+
+# not reached
+
Modified: GNUnet/contrib/OSX/Info.plist
===================================================================
--- GNUnet/contrib/OSX/Info.plist 2005-02-07 20:32:26 UTC (rev 206)
+++ GNUnet/contrib/OSX/Info.plist 2005-02-07 21:36:40 UTC (rev 207)
@@ -2,7 +2,25 @@
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
- <key>CFBundleIconFile</key>
- <string>GNUnet.icns</string>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>GNUnet</string>
+ <key>CFBundleIconFile</key>
+ <string>GNUnet</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple._it.app</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>jme</string>
+ <key>CFBundleVersion</key>
+ <string>0.6.6.3 </string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
</dict>
</plist>
Modified: GNUnet/contrib/OSX/README
===================================================================
--- GNUnet/contrib/OSX/README 2005-02-07 20:32:26 UTC (rev 206)
+++ GNUnet/contrib/OSX/README 2005-02-07 21:36:40 UTC (rev 207)
@@ -18,6 +18,7 @@
the gnunetd hostlist mechanism does not get you anywhere. Hack:
I am including a static list with the App :-(
+6. Added some dialogs etc. which rely on http://cocoadialog.sourceforge.net
+ (assumed to be in ~/Applications directory)
-
Jussi Eloranta (address@hidden)
Modified: GNUnet/contrib/OSX/build_app
===================================================================
--- GNUnet/contrib/OSX/build_app 2005-02-07 20:32:26 UTC (rev 206)
+++ GNUnet/contrib/OSX/build_app 2005-02-07 21:36:40 UTC (rev 207)
@@ -5,9 +5,11 @@
# structure and make all the executables relocatable.
# Fink root
-SW=/sw
-export SW
+SW=/sw; export SW
+# Location of Cocoadialog
+CD=~/Applications; export CD
+
# Fix a given executable or library to be relocatable
fixlib () {
@@ -43,13 +45,11 @@
mkdir /tmp/GNUnet
cd ../..
-if [ ! -f config.status ]; then
# TODO: issues with gcrypt vs. openssl. The latter causes gnunetd to core dump
# in some cases. Do we still need to disable gettext?
-# ./configure --with-gdbm --without-mysql --without-bdb --with-sqlite=$SW
--with-crypto=$SW --disable-nls
- ./configure --with-gdbm --without-mysql --without-bdb --with-sqlite=$SW
--disable-nls
- make
-fi
+# ./configure --with-gdbm --without-mysql --without-bdb --with-sqlite=$SW
--with-crypto=$SW --disable-nls
+./configure --with-gdbm --without-mysql --without-bdb --with-sqlite=$SW
--disable-nls
+make
make install prefix=/tmp/GNUnet
cd contrib/OSX
@@ -60,10 +60,10 @@
mkdir GNUnet.app
mkdir GNUnet.app/Contents
mkdir GNUnet.app/Contents/{MacOS,Resources}
-mkdir GNUnet.app/Contents/MacOS/{bin,doc,etc,html,lib,man,hosts}
-cp GNUnet.png GNUnet.app/Contents/Resources/GNUnet.icns
+mkdir GNUnet.app/Contents/MacOS/{bin,doc,etc,lib,man,hosts}
+cp GNUnet.icns GNUnet.app/Contents/Resources
cp Info.plist GNUnet.app/Contents
-cp GNUnet GNUnet.app/Contents/MacOS/GNUnet
+cp GNUnet GNUnet-* GNUnet.app/Contents/MacOS
cp -r /tmp/GNUnet/man GNUnet.app/Contents/MacOS
cp /tmp/GNUnet/bin/* GNUnet.app/Contents/MacOS/bin
mv GNUnet.app/Contents/MacOS/bin/gnunet-gtk
GNUnet.app/Contents/MacOS/bin/gnunet-gtk.wrap
@@ -71,23 +71,36 @@
mv GNUnet.app/Contents/MacOS/bin/gnunet-peer-info
GNUnet.app/Contents/MacOS/bin/gnunet-peer-info.wrap
cp {gnunet-gtk,gnunetd,gnunet-peer-info} GNUnet.app/Contents/MacOS/bin
cp /tmp/GNUnet/lib/* GNUnet.app/Contents/MacOS/lib
-sed -e 's-/var/lib/GNUnet-~/.gnunet-g;s-eth0-ACTIVE_IFACE-g' <
../../contrib/gnunet.root > GNUnet.app/Contents/MacOS/etc/gnunet.root
-sed -e 'sX/tmp/gnunet-downloads/X~/gnunet-downloads/Xg' <
../../contrib/gnunet.user > GNUnet.app/Contents/MacOS/etc/gnunet.user
+cp ../gnunet.root GNUnet.app/Contents/MacOS/etc/gnunet.root
+cp ../gnunet.user GNUnet.app/Contents/MacOS/etc/gnunet.user
cp $SW/etc/pango/* GNUnet.app/Contents/MacOS/etc
pth=`fgrep ModulesPath $SW/etc/pango/pango.modules | cut -d\ -f4`
cp -r $pth GNUnet.app/Contents/MacOS/pango
cp ../../COPYING GNUnet.app/Contents/MacOS/doc
-cp *.html GNUnet.app/Contents/MacOS/html
-cp hosts/* GNUnet.app/Contents/MacOS/hosts
+cp *.txt GNUnet.app/Contents/MacOS/doc
+cp hosts/* GNUnet.app/Contents/MacOS/hosts > /dev/null 2>&1
-# Find out libs we need from fink (e.g. $SW)
-libs="`otool -L GNUnet.app/Contents/MacOS/{bin,lib}/* 2> /dev/null | fgrep
compatibility | cut -d\( -f1 | grep $SW | sort | uniq`"
-cp -f $libs GNUnet.app/Contents/MacOS/lib
-# Second round, esp. gtk introduced some new deps.. in principle should
-# loop until no changes...
-libs="`otool -L GNUnet.app/Contents/MacOS/{bin,lib}/* 2> /dev/null | fgrep
compatibility | cut -d\( -f1 | grep $SW | sort | uniq`"
-cp -f $libs GNUnet.app/Contents/MacOS/lib
+# Include Cocoadialog
+cp -r $CD/CocoaDialog.app GNUnet.app/Contents/MacOS
+cp GNUnet.icns
GNUnet.app/Contents/MacOS/CocoaDialog.app/Contents/Resources/cocoaDialog.icns
+# Find out libs we need from fink (e.g. $SW) - loop until no changes
+a=1
+nfiles=0
+endl=true
+while $endl; do
+ echo "Looking for dependencies. Round " $a
+ libs="`otool -L GNUnet.app/Contents/MacOS/{bin,lib}/* 2> /dev/null | fgrep
compatibility | cut -d\( -f1 | grep $SW | sort | uniq`"
+ cp -f $libs GNUnet.app/Contents/MacOS/lib
+ let "a+=1"
+ nnfiles=`ls GNUnet.app/Contents/MacOS/lib | wc -l`
+ if [ $nnfiles = $nfiles ]; then
+ endl=false
+ else
+ nfiles=$nnfiles
+ fi
+done
+
# Libcrypto comes with the system + fink version does not allow
install_name_tool
rm -f GNUnet.app/Contents/MacOS/lib/*.la
GNUnet.app/Contents/MacOS/lib/libcrypto*
Modified: GNUnet/contrib/OSX/gnunet-peer-info
===================================================================
--- GNUnet/contrib/OSX/gnunet-peer-info 2005-02-07 20:32:26 UTC (rev 206)
+++ GNUnet/contrib/OSX/gnunet-peer-info 2005-02-07 21:36:40 UTC (rev 207)
@@ -2,4 +2,4 @@
LD_LIBRARY_PATH=`dirname $0`/../lib
export LD_LIBRARY_PATH
-exec $LD_LIBRARY_PATH/../bin/gnunet-peer-info.wrap -c ~/.gnunet/gnunet.root $*
+exec $LD_LIBRARY_PATH/../bin/gnunet-peer-info.wrap -c ~/gnunet/gnunet.root $*
Modified: GNUnet/contrib/OSX/gnunetd
===================================================================
--- GNUnet/contrib/OSX/gnunetd 2005-02-07 20:32:26 UTC (rev 206)
+++ GNUnet/contrib/OSX/gnunetd 2005-02-07 21:36:40 UTC (rev 207)
@@ -2,4 +2,4 @@
LD_LIBRARY_PATH=`dirname $0`/../lib
export LD_LIBRARY_PATH
-exec $LD_LIBRARY_PATH/../bin/gnunetd.wrap -c ~/.gnunet/gnunet.root $*
+exec $LD_LIBRARY_PATH/../bin/gnunetd.wrap -c ~/gnunet/gnunet.root $*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r207 - GNUnet/contrib/OSX,
grothoff <=