antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright configure ACE-desktop/ACE ACE-desktop...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright configure ACE-desktop/ACE ACE-desktop...
Date: Tue, 31 Jul 2007 13:55:26 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/07/31 13:55:26

Modified files:
        .              : configure 
        ACE-desktop    : ACE Makefile system.antiright.5 
        ACE-desktop/hacks: open_file.sh 
        gtkshell       : about_dialog.c image_button.c 

Log message:
        Fixed paths to use XDG dirs. 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/configure?cvsroot=antiright&r1=1.106&r2=1.107
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/ACE?cvsroot=antiright&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/Makefile?cvsroot=antiright&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/system.antiright.5?cvsroot=antiright&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/hacks/open_file.sh?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/about_dialog.c?cvsroot=antiright&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/image_button.c?cvsroot=antiright&r1=1.21&r2=1.22

Patches:
Index: configure
===================================================================
RCS file: /sources/antiright/antiright/configure,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -b -r1.106 -r1.107
--- configure   21 Jul 2007 16:16:38 -0000      1.106
+++ configure   31 Jul 2007 13:55:25 -0000      1.107
@@ -28,6 +28,7 @@
 
 USE_DISTCC=NO
 USE_CCACHE=NO
+USE_BOEHMGC=NO
 # Must be enabled.  
 USE_GTK=YES
 
@@ -47,6 +48,8 @@
                USE_CCACHE=YES
        elif [ "$ARG" = "--enable-distcc" ]; then
                USE_DISTCC=YES
+       elif [ "$ARG" = "--enable-boehmgc" ]; then
+               USE_BOEHMGC=YES
        fi
 done
 
@@ -114,22 +117,25 @@
        LDFLAGS="$LDFLAGS -L/usr/pkg/lib -L/usr/X11R6/lib -lX11"
 fi # USE_GTK
 
-echo -n 'Checking for Boehm-GC... '
-if ([ -f /usr/pkg/lib/libgc.a ]\
+
+if [ "$USE_BOEHMGC" = "YES" ]; then
+       echo -n 'Checking for Boehm-GC... '
+       if ( [ -f /usr/pkg/lib/libgc.a ]\
        || [ -f /usr/lib/libgc.a ]\
        || [ -f /usr/local/lib/libgc.a ]); then
        echo found
        echo 'LIBGC=1' >> config.mk
        DEFS="$DEFS -DLIBGC"
        LDFLAGS="$LDFLAGS -lgc"
-else
+       else
        echo not found
+       fi
 fi
 
 INCLUDE="$INCLUDE -I/usr/pkg/include -I/usr/local/include -I/usr/X11R6/include"
 LIBDIR="$LIBDIR -L/usr/pkg/lib -L/usr/local/lib -L/usr/X11R6/lib"
-
-DEFS="$DEFS -D_GNU_SOURCE"
+ARDATADIR=$PREFIX/share/antiright
+DEFS="$DEFS -D_GNU_SOURCE -DARDATADIR='\"$PREFIX/share/antiright\"'"
 
 INSTALL=/usr/bin/install
 

Index: ACE-desktop/ACE
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/ACE,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- ACE-desktop/ACE     27 Jul 2007 01:13:35 -0000      1.47
+++ ACE-desktop/ACE     31 Jul 2007 13:55:25 -0000      1.48
@@ -19,11 +19,68 @@
 ARSHELL=gtkshell
 AWK=awk
 
-ACE_Init()
+Setup_XDG()
+{
+       if [ "$XDG_DATA_HOME" = "" ]; then
+               export XDG_DATA_HOME="$HOME/.local/share"
+               if [ ! -d "$XDG_DATA_HOME/antiright" ]; then
+                       mkdir -p $XDG_DATA_HOME/antiright
+                       chmod 0700 $XDG_DATA_HOME/antiright
+               fi
+       fi
+       if [ "$XDG_CONFIG_HOME" = "" ]; then
+               export XDG_CONFIG_HOME="$HOME/.config"
+               if [ ! -d "$XDG_CONFIG_HOME/antiright" ]; then
+                       mkdir -p $XDG_CONFIG_HOME/antiright
+                       chmod 0700 $XDG_DATA_HOME/antiright
+               fi
+       fi
+       if [ "$XDG_DATA_DIRS" = "" ]; then
+               export XDG_DATA_DIRS="/usr/local/share:/usr/share"
+               # Be nice to pkgsrc users.  
+               export XDG_DATA_DIRS="$XDG_DATA_DIRS:/usr/pkg/share"
+       fi
+       if [ "$XDG_CONFIG_DIRS" = "" ]; then
+               export XDG_CONFIG_DIRS="/etc/xdg:/usr/pkg/etc/xdg"
+       fi
+}
+
+Search_XDG()
 {
-       datadir=$PREFIX/share/ACE-desktop
+       Setup_XDG
+       IFS=':'
+       # Find system program data location.  
+       for DIR in $XDG_DATA_DIRS; do
+               if [ -d "$DIR/antiright" ]; then
+                       datadir="$DIR/antiright"
+                       break
+               fi
+       done
+       # Find system configuration file location.
+       for DIR in $XDG_CONFIG_DIRS; do
+               if [ -d "$DIR/antiright" ]; then
+                       sysconfigdir="$DIR/antiright"
+                       break
+               fi
+       done
+       IFS=' '
+}
+
+Setup_Dirs()
+{
+       Search_XDG
+       export SYSARCONF=$sysconfigdir/system.antiright
        icon=$datadir/icons
-       rm -f /tmp/ARO.*
+       ARCONF=$XDG_CONFIG_HOME/antiright/antiright.conf
+       if [ "$TMPDIR" = "" ]; then
+               TMPDIR=/tmp
+       fi
+       rm -f $TMPDIR/ARO.*
+}
+
+ACE_Init()
+{
+       Setup_Dirs
        # Allow DEBUG from environment.  
        if [ "$DEBUG" = "" ]; then
                DEBUG=0
@@ -106,37 +163,43 @@
 }
 ACE_Check_Configuration_File()
 {
-       local ARRC="~/.antiright"
-
-       if [ ! -f $ARRC ]; then
-               cp $PREFIX/share/ACE-desktop/system.antiright $ARRC
+       if [ ! -f $ARCONF ]; then
+               local OLD_ARCONF="$HOME/.antiright"
+               if [ -f $OLD_ARCONF ]; then
+                       # Preserve previous configuration.  
+                       mv $OLD_ARCONF $ARCONF
+               else
+                       # New installation.  
+                       cp $SYSARCONF $ARCONF
+               fi
        fi
        # Fix missing Terminal app definition for old config files.  
-       if [ "$(grep Terminal: $ARRC)" = "" ]; then
-               echo 'Terminal: gshterm' >> $ARRC
+       if [ "$(grep Terminal: $ARCONF)" = "" ]; then
+               echo 'Terminal: gshterm' >> $ARCONF
        fi
 }
 
 Clean_Config()
 {
-       local KEYDIR=/tmp/keys.$$
+       local KEYDIR=$TMPDIR/keys.$$
        rm -rf $KEYDIR
        mkdir $KEYDIR
-       chmod og-rwx $KEYDIR
+       chmod 0700 $KEYDIR
        cd $KEYDIR
-       for key in $(grep : ~/.antiright | grep -v '#' | cut -d: -f1); do
-               grep $key: ~/.antiright >> $key
+       for key in $(grep : $ARCONF | grep -v '#' | cut -d: -f1); do
+               grep $key: $ARCONF >> $key
        done
+       NEW_ARCONF="$TMPDIR/.new.antiright.conf.$$"
        for file in *; do
-               tail -n 1 $file >> new.antiright
+               tail -n 1 $file >> $NEW_ARCONF
        done
-       mv new.antiright ~/.antiright
+       mv $NEW_ARCONF $ARCONF
        rm -rf $KEYDIR
 }
 
 ACE_record_titles()
 {
-       $AWK -F : 'NF > 0 {if ($0 !~ /#/){print $1}}' ~/.antiright\
+       $AWK -F : 'NF > 0 {if ($0 !~ /#/){print $1}}' $ARCONF\
                | sort | uniq | tr '\n' ' '
 }
 ACE_read_configuration_value()
@@ -145,16 +208,26 @@
        $AWK -v config_item=$1 '\
                BEGIN {FS=":"}\
                $1 ~ config_item {if ($0 !~ /#/) value=$2}\
-               END {print value}' ~/.antiright
+               END {print value}' $ARCONF
 # The value is printed in the end to ensure that it is the most recent value
 }
 AR_Prepare_Environment()
 {
-       xrdb ~/.Xdefaults
+       local OLD_ARRC="$HOME/.antirightrc"
+       local ARRC="$XDG_CONFIG_HOME/antiright/antirightrc"
+
        ACE_Check_Configuration_File
-       touch ~/.antirightrc
-       chmod +x ~/.antirightrc
-       ~/.antirightrc
+       if [ -f $OLD_ARRC ]; then
+               mv $OLD_ARRC $ARRC
+               rm $OLD_ARRC
+       else
+               if [ ! -f $ARRC ]; then
+                       touch $ARRC
+                       chmod +x $ARRC
+               else
+                       $ARRC
+               fi
+       fi
 }
 AR()
 {
@@ -162,12 +235,13 @@
        ACE -A Deskbar
        if [ "$WINDOWMANAGER" != "" ]; then
                exec $WINDOWMANAGER
-       elif [ "`which evilwm`" != "" ]; then
+       elif [ "$(which evilwm)" != "" ]; then
                exec evilwm
-       elif [ "`which twm`" != "" ]; then
+       elif [ "$(which twm)" != "" ]; then
                exec twm
        else
-               echo AR:  error:  WINDOWMANAGER not set
+               echo AR:  error:  WINDOWMANAGER not set, starting terminal
+               exec gshterm
        fi
 }
 Prompt_User()
@@ -338,7 +412,7 @@
 
 set_value()
 {
-    echo "$1":"$2" >> ~/.antiright
+    echo "$1":"$2" >> $ARCONF
 }
 
 Settings_Node()
@@ -531,6 +605,8 @@
 # Main()
 
 ACE_Init
+ACE_Check_Configuration_File
+
 while getopts :ctp:r:L:V:A:g: OPT; do
     case $OPT in
        c|+c)
@@ -577,7 +653,7 @@
 shift `expr $OPTIND - 1`
 
 if [ $# -gt 0 ]; then 
-       # This runs a command configured in ~/.antiright
+       # This runs a command configured in $ARCONF
        command="$(ACE_read_configuration_value $1)"
        # Set the remaining arguments to not include COMMAND.  
        shift

Index: ACE-desktop/Makefile
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/Makefile,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- ACE-desktop/Makefile        22 Jul 2007 06:58:36 -0000      1.19
+++ ACE-desktop/Makefile        31 Jul 2007 13:55:25 -0000      1.20
@@ -48,9 +48,10 @@
 mandir=$(PREFIX)/man
 man1dir=$(mandir)/man1
 man5dir=$(mandir)/man5
-datadir=$(PREFIX)/share/ACE-desktop
+datadir=$(PREFIX)/share/antiright
 hackdir=$(datadir)/hacks
 icondir=$(datadir)/icons
+confdir=$(PREFIX)/etc/xdg/antiright
 
 install: all
        $(INSTALL_DIR) $(bindir)
@@ -59,8 +60,9 @@
        ${INSTALL_DIR} $(datadir)
        ${INSTALL_DIR} $(icondir)
        $(INSTALL_DIR) $(hackdir)
+       $(INSTALL_DIR) $(confdir)
        $(INSTALL_SCRIPT) hacks/*.sh $(hackdir)
-       $(INSTALL_DATA) system.antiright $(datadir)
+       $(INSTALL_DATA) system.antiright $(confdir)
        $(INSTALL_DATA) guidl/*.gdl $(datadir)
        $(INSTALL_SCRIPT) ACE.install $(bindir)/ACE
        $(INSTALL_DATA) ACE.1 $(man1dir)

Index: ACE-desktop/system.antiright.5
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/system.antiright.5,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- ACE-desktop/system.antiright.5      22 Mar 2007 06:41:03 -0000      1.2
+++ ACE-desktop/system.antiright.5      31 Jul 2007 13:55:25 -0000      1.3
@@ -16,10 +16,10 @@
 Background: echo darkslategrey
 .SH FILES
 .TP
-.B [PREFIX]/share/antiright/system.antiright
+.B $PREFIX/share/antiright/system.antiright
 Default configuration file.
 .TP
-.B ~/.antiright
+.B $XDG_CONFIG_HOME/antiright/antiright.conf
 Local user configuration file.
 .SH AUTHORS
 Written by Jeffrey Bedard <address@hidden>.  

Index: ACE-desktop/hacks/open_file.sh
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/hacks/open_file.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ACE-desktop/hacks/open_file.sh      27 Jul 2007 01:13:36 -0000      1.1
+++ ACE-desktop/hacks/open_file.sh      31 Jul 2007 13:55:25 -0000      1.2
@@ -19,7 +19,10 @@
 Main()
 {
        if [ $# -gt 0 ]; then
-               TMP=/tmp/ARO.$$
+               if [ "$TMPDIR" = "" ]; then
+                       TMPDIR='/tmp'
+               fi
+               TMP=$TMPDIR/ARO.$$
                file $1 > $TMP
                if grep HTML $TMP; then
                        ACE Browser $1 & 

Index: gtkshell/about_dialog.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/about_dialog.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- gtkshell/about_dialog.c     11 Jun 2007 21:32:37 -0000      1.10
+++ gtkshell/about_dialog.c     31 Jul 2007 13:55:26 -0000      1.11
@@ -59,8 +59,7 @@
 {
        GtkWidget * image;
        
-#define ARICONDIR "/share/ACE-desktop/icons/"
-       image=gtk_image_new_from_file(PREFIX ARICONDIR "ACE.png");
+       image=gtk_image_new_from_file(ARDATADIR "icons/ACE.png");
        gtk_widget_show(image);
        gtk_about_dialog_set_logo(dialog, 
                gtk_image_get_pixbuf(GTK_IMAGE(image)));

Index: gtkshell/image_button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/image_button.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- gtkshell/image_button.c     11 Jun 2007 21:32:42 -0000      1.21
+++ gtkshell/image_button.c     31 Jul 2007 13:55:26 -0000      1.22
@@ -71,8 +71,7 @@
        gchar * prefixed_name;
        GtkWidget * image;
 
-       ar_asprintf(&prefixed_name, PREFIX "/share/ACE-desktop/icons/%s", 
-                       name);
+       ar_asprintf(&prefixed_name, ARDATADIR "/icons/%s", name);
        /* Determine whether to use the file name constructed in prefixed_name
         * or to use a stock icon (tried if the file does not exit).  */
        image = g_file_test(prefixed_name, G_FILE_TEST_EXISTS)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]