Commits

Anonymous committed f7abca0

Update razorqt to 0.5.2

Signed-off-by: Lee Pak Hong <benreilly@vector.Linux.net>

Comments (0)

Files changed (6)

var/vabs/razorqt/src/doinst.sh

+config() {
+  NEW="$1"
+  OLD="$(dirname $NEW)/$(basename $NEW .new)"
+  # If there's no config file by that name, mv it over:
+  if [ ! -r $OLD ]; then
+    mv $NEW $OLD
+  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+    # toss the redundant copy
+    rm $NEW
+  fi
+  # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+for i in desktop razor session windowmanagers razor-panel/panel; do
+  config @RCONFDIR@/razor/$i.conf.new
+done
+
+if [ -x /usr/bin/update-desktop-database ]; then
+  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+  if [ -x /usr/bin/gtk-update-icon-cache ]; then
+    /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+  fi
+fi

var/vabs/razorqt/src/patches/dont_hardcode_xdg_path.patch

+diff -Naur razor-qt-0.5.2.orig/razorqt-config/src/CMakeLists.txt razor-qt-0.5.2/razorqt-config/src/CMakeLists.txt
+--- razor-qt-0.5.2.orig/razorqt-config/src/CMakeLists.txt	2013-01-12 17:40:48.000000000 +0100
++++ razor-qt-0.5.2/razorqt-config/src/CMakeLists.txt	2013-01-14 07:03:35.907315151 +0100
+@@ -52,4 +52,4 @@
+ 
+ INSTALL(TARGETS razor-config RUNTIME DESTINATION bin)
+ install(FILES ${DESKTOP_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
+-install(FILES razor-config.menu DESTINATION /etc/xdg/menus/)
++install(FILES razor-config.menu DESTINATION ${RAZOR_ETC_XDG_DIRECTORY}/menus/)
+diff -Naur razor-qt-0.5.2.orig/razorqt-resources/application-menu/CMakeLists.txt razor-qt-0.5.2/razorqt-resources/application-menu/CMakeLists.txt
+--- razor-qt-0.5.2.orig/razorqt-resources/application-menu/CMakeLists.txt	2013-01-12 17:40:48.000000000 +0100
++++ razor-qt-0.5.2/razorqt-resources/application-menu/CMakeLists.txt	2013-01-14 07:04:24.877315008 +0100
+@@ -28,4 +28,4 @@
+ 
+ add_subdirectory(desktop-directories)
+ 
+-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/razor-applications.menu DESTINATION /etc/xdg/menus/)
++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/razor-applications.menu DESTINATION ${RAZOR_ETC_XDG_DIRECTORY}/menus/)
+diff -Naur razor-qt-0.5.2.orig/razorqt-resources/autostart/CMakeLists.txt razor-qt-0.5.2/razorqt-resources/autostart/CMakeLists.txt
+--- razor-qt-0.5.2.orig/razorqt-resources/autostart/CMakeLists.txt	2013-01-12 17:40:48.000000000 +0100
++++ razor-qt-0.5.2/razorqt-resources/autostart/CMakeLists.txt	2013-01-14 07:03:35.908315132 +0100
+@@ -11,4 +11,4 @@
+ add_custom_target(autostart_desktop_files ALL DEPENDS ${DESKTOP_FILES})
+ #************************************************
+ 
+-install(FILES ${DESKTOP_FILES} DESTINATION /etc/xdg/autostart)
++install(FILES ${DESKTOP_FILES} DESTINATION ${RAZOR_ETC_XDG_DIRECTORY}/autostart)

var/vabs/razorqt/src/profile.d/razorqt.csh

 #!/bin/csh
 if ( $?XDG_CONFIG_DIRS ) then
-    setenv XDG_CONFIG_DIRS ${XDG_CONFIG_DIRS}:/etc/razorqt/xdg
+    setenv XDG_CONFIG_DIRS ${XDG_CONFIG_DIRS}:@RCONFDIR@
 else
-    setenv XDG_CONFIG_DIRS /etc/xdg:/etc/razorqt/xdg
+    setenv XDG_CONFIG_DIRS /etc/xdg:@RCONFDIR@
 endif

var/vabs/razorqt/src/profile.d/razorqt.sh

 #!/bin/sh
 if [ ! "$XDG_CONFIG_DIRS" = "" ]; then
-  XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/etc/razorqt/xdg
+  XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:@RCONFDIR@
 else
-  XDG_CONFIG_DIRS=/etc/xdg:/etc/razorqt/xdg
+  XDG_CONFIG_DIRS=/etc/xdg:@RCONFDIR@
 fi
 export XDG_CONFIG_DIRS

var/vabs/razorqt/src/razorqt.SlackBuild

 # AUTHORS = 
 
 NAME="razorqt"            #Enter package Name!
-VERSION=${VERSION:-"0.4.1"}      #Enter package Version!
+VERSION=${VERSION:-"0.5.2"}      #Enter package Version!
 VER=$(echo $VERSION|sed 's/-/_/') #this fixes - in version
 VL_PACKAGER=${VL_PACKAGER:-"hata_ph"}   #Enter your Name!
 LINK=${LINK:-"http://razor-qt.org/downloads/$NAME-$VERSION.tar.bz2"}  #Enter URL for package here!
 LDFLAG_OPTIONS=${LDFLAG_OPTIONS:-""}
 ADDRB=${ADDRB:-""} #Add deps that need to be added to the slack-required file here
 EXRB=${EXRB:-""} #Add deps that need to be excluded from the slack-required file here
-MAKEDEPENDS=${MAKEDEPENDS:-"polkit-qt-1"} #Add deps needed TO BUILD this package here.
+MAKEDEPENDS=${MAKEDEPENDS:-"polkit-qt-1 libstatgrab"} #Add deps needed TO BUILD this package here.
 #----------------------------------------------------------------------------
 
 # DO NOT EXECUTE if NORUN is set to 1
 PKG=$TMP/package-$NAME
 #--------------------------------------------
 
-
+# Where our system config (razor and xdg files) resides
+RCONFDIR=${RCONFDIR:-etc/razor/xdg}
 
 if [ $UID != 0 ]; then
    echo "You are not authorized to run this script. Please login as root"
 
 # Put any Patches into a patches folder in the src dir
 #-----------------------------------------------------
-#for i in $CWD/patches/*;do
-#	patch -p1 <$i
-#done
+for i in $CWD/patches/*;do
+#  patch -p1 <$i
+  mkdir -p $PKG/usr/doc/$NAME-$VERSION/patches/
+  cp $i $PKG/usr/doc/$NAME-$VERSION/patches/
+done
 #-----------------------------------------------------
 
 # Needed for gcc47; harmless for earlier gcc
-patch -p1 < $CWD/patches/include_unistd_h.diff
+#patch -p1 < $CWD/patches/include_unistd_h.diff
+
+# Fix hardcoded xdg path
+patch -p1 < $CWD/patches/dont_hardcode_xdg_path.patch
 
 #SET PERMISSIONS
 #-----------------------------------------
   -DCMAKE_BUILD_TYPE=Release \
   -DCMAKE_INSTALL_PREFIX:PATH="/usr" \
   -DLIB_SUFFIX:STRING="$LIBDIRSUFFIX" \
-  -DRAZOR_CONFIG_DIR:STRING=".config/razorqt"
+  -DENABLE_LIGHTDM_GREETER=OFF -DMODULE_LIGHTDM=OFF \
+  -DRAZOR_ETC_XDG_DIRECTORY:PATH="/$RCONFDIR"
+  
+#  -DRAZOR_CONFIG_DIR:STRING=".config/razorqt"
 
 make || exit 1
 
 #######################################################################
 
 # copy custom razor config
-mkdir -p $PKG/usr/share/razor/razor-panel
-cp -a $CWD/config/panel.conf $PKG/usr/share/razor/razor-panel
-cp -a $CWD/config/razor.conf $PKG/usr/share/razor
-
-mkdir -p $PKG/etc/razorqt
-mv $PKG/etc/xdg $PKG/etc/razorqt
+#mkdir -p $PKG/usr/share/razor/razor-panel
+#cp -a $CWD/config/panel.conf $PKG/usr/share/razor/razor-panel
+#cp -a $CWD/config/razor.conf $PKG/usr/share/razor
+#sed -i 's|apps/2/desktop=chromium-browser.desktop|apps/2/desktop=Terminal.desktop|g' \
+#	$PKG/$RCONFDIR/razor/razor-panel/panel.conf
+sed -i 's|icon_theme=|icon_theme=Faenza-Cupertino|g' \
+	$PKG/$RCONFDIR/razor/razor.conf
 
 mkdir -p $PKG/etc/X11/xinit
 cat $CWD/xinitrc.razorqt > $PKG/etc/X11/xinit/xinitrc.razorqt
 chmod 0755 $PKG/etc/X11/xinit/xinitrc.razorqt
 
 mkdir -p $PKG/etc/profile.d
-cat $CWD/profile.d/razorqt.sh > $PKG/etc/profile.d/razorqt.sh
-cat $CWD/profile.d/razorqt.csh > $PKG/etc/profile.d/razorqt.csh
+sed "s|@RCONFDIR@|/$RCONFDIR|" \
+  $CWD/profile.d/razorqt.sh > $PKG/etc/profile.d/razorqt.sh
+sed "s|@RCONFDIR@|/$RCONFDIR|" \
+  $CWD/profile.d/razorqt.csh > $PKG/etc/profile.d/razorqt.csh
 chmod 0755 $PKG/etc/profile.d/*
 
+# Don't clobber existing config files
+for i in desktop razor session windowmanagers razor-panel/panel; do
+  mv $PKG/$RCONFDIR/razor/$i.conf $PKG/$RCONFDIR/razor/$i.conf.new
+done
+# Add missing section entry in razor.conf, to avoid complains
+# from razor-confupdate python script...
+sed -i '/^theme/i [General]' $PKG/$RCONFDIR/razor/razor.conf.new || exit 1
+# ...beside the fact that it looks in the wrong path...
+sed -i "s|\.razor|.config/razor|" $PKG/usr/share/razor/razor-confupdate/* || exit 1
+
+# There's a small issue: seems like default configs are not created when
+# you launch razor the first time: copy them from their global dir if
+# ~/.config/razor doesn't exist
+sed -i "s|^$|if [ ! -d ~/.config/razor ]; then mkdir -p ~/.config ; cp -a /$RCONFDIR/razor ~/.config/razor ; fi|" $PKG/usr/bin/startrazor
+
+# configure to run startrazor from xsessions
+sed -i 's|Exec=razor-session|Exec=startrazor|g' $PKG/usr/share/xsessions/razor.desktop
+
 mkdir -p $PKG/usr/doc/$NAME-$VERSION
 cp -a README* $PKG/usr/doc/$NAME-$VERSION
 cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild
 fi 
 
 find $PKG/usr/info -type f -exec gzip -9 {} \;
+
 mkdir -p $PKG/install
+sed "s|@RCONFDIR@|$RCONFDIR|" $CWD/doinst.sh > $PKG/install/doinst.sh
+
 if [ -d $PKG/usr/info ] ; then
 cat >> $PKG/install/doinst.sh << EOF
 CWD=\$(pwd)

var/vabs/razorqt/src/xinitrc.razorqt

 [ -f $userresources ] && /usr/bin/xrdb -merge $userresources
 [ -f $usermodmap ] && /usr/bin/xmodmap $usermodmap
 
-if [ -z "$XDG_SESSION_COOKIE" -a -x /usr/bin/ck-launch-session ]; then
-  ck-launch-session razor-session
+if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
+  ck-launch-session dbus-launch --exit-with-session startrazor
 else
-  exec razor-session
+  exec startrazor
 fi