Author: glen                         Date: Thu Dec 21 09:28:11 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- install root fixes

---- Files affected:
SOURCES:
   wine-doors-rootdir.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/wine-doors-rootdir.patch
diff -u /dev/null SOURCES/wine-doors-rootdir.patch:1.1
--- /dev/null   Thu Dec 21 10:28:11 2006
+++ SOURCES/wine-doors-rootdir.patch    Thu Dec 21 10:28:06 2006
@@ -0,0 +1,136 @@
+--- wine-doors/setup.py        2006-12-21 11:19:19.633599187 +0200
++++ wine-doors/setup.py        2006-12-21 11:22:29.197851497 +0200
+@@ -46,7 +46,9 @@
+       print " uninstall - uninstalls wine-doors"
+       print " --help - display this usage message (default)\n"
+       print " Options:"
++      print "  -S - system install"
+       print "  --prefix - prefix path default /usr"
++      print "  --root - install root directory (for packaging), implies 
system install"
+       sys.exit(0)
+       pass
+       
+@@ -59,62 +61,64 @@
+ 
+ if __name__ == "__main__":
+       command = None
++      sysinstall = False
++      root = "/"
++      prefix = "/usr"
+       for argument in sys.argv:
+               if argument == "install" or argument == "uninstall":
+                       command = argument
+               if argument.startswith( "--prefix" ):
+                       prefix = argument.split( "=" )[1]
+-              else:
+-                      prefix = "/usr/"
++              if argument.startswith( "--root" ):
++                      root = argument.split( "=" )[1]
++                      sysinstall = True;
+               if argument.startswith( "--help" ):
+                       usage()
+               if argument.startswith( "-S" ):
+                       sysinstall = True;
+-              else:
+-                      sysinstall = False;
+ 
+       if command == "install":
+               if os.environ['USER'] == "root" or sysinstall:
+                       print "Performing system install"
+-                      share = prefix + "share/wine-doors/"
+-                      conf_file = "/etc/wine-doors/preferences.xml"
+-                      copyfile( "./dist/wine-doors.desktop",  prefix + 
"share/applications/wine-doors.desktop" )              
++                      share = root + prefix + "/share/wine-doors"
++                      conf_file = root + "/etc/wine-doors/preferences.xml"
++                      copyfile( "./dist/wine-doors.desktop",  root + prefix + 
"/share/applications/wine-doors.desktop" )              
+               else:
+                       print "Performing user install"
+-                      prefix = os.path.expanduser( "~/" )
++                      prefix = os.path.expanduser( "~" )
+                       local = os.path.expanduser( "~/.local/")
+-                      share = prefix + ".wine-doors/"
++                      share = prefix + "/.wine-doors"
+                       conf_file = os.path.expanduser( "~/.winedoors.xml" )
+-                      copyfile( "./dist/wine-doors.desktop", local + 
"share/applications/wine-doors.desktop" )                
++                      copyfile( "./dist/wine-doors.desktop", local + 
"/share/applications/wine-doors.desktop" )               
+         
+               print "Compressing and installing pack files"
+-              if not os.path.isdir( share + "base.repo" ):
+-                      os.makedirs( share + "base.repo/" )
+-              if not os.path.isdir( share + "global.repo" ):
+-                      os.makedirs( share + "global.repo" )
+-              copygzip( "./repos/base.repo/packlist.xml", share + 
"base.repo/packlist.xml.gz" )
+-              copypacks( "./repos/base.repo/", share + "global.repo/" )
++              if not os.path.isdir( share + "/base.repo" ):
++                      os.makedirs( share + "/base.repo/" )
++              if not os.path.isdir( share + "/global.repo" ):
++                      os.makedirs( share + "/global.repo" )
++              copygzip( "./repos/base.repo/packlist.xml", share + 
"/base.repo/packlist.xml.gz" )
++              copypacks( "./repos/base.repo", share + "/global.repo/" )
+               print "  ** Base Repo"
+-              copygzip( "./repos/global.repo/packlist.xml", share + 
"global.repo/packlist.xml.gz" )
++              copygzip( "./repos/global.repo/packlist.xml", share + 
"/global.repo/packlist.xml.gz" )
+               print "  ** Global Repo"
+-              copypacks( "./repos/global.repo/", share + "global.repo/" )
+-              copyfiles( "./src", share + "src" )
+-              copyfiles( "./pixmaps", share + "pixmaps" )
+-              copyfiles( "./dtd", share + "dtd" )
++              copypacks( "./repos/global.repo", share + "/global.repo/" )
++              copyfiles( "./src", share + "/src" )
++              copyfiles( "./pixmaps", share + "/pixmaps" )
++              copyfiles( "./dtd", share + "/dtd" )
+ 
+               print "Symlinking resources"
+-              if os.environ['USER'] == "root":
+-                      if not os.path.isdir( "/etc/wine-doors" ):
+-                              os.makedirs( "/etc/wine-doors" )
+-                      symlink( share + "pixmaps/wine-doors.png", prefix + 
"/share/pixmaps/wine-doors.png" )
+-                      symlink( share + "pixmaps/wine-doors.svg", prefix + 
"/share/pixmaps/wine-doors.svg" )
++              if os.environ['USER'] == "root" or sysinstall:
++                      if not os.path.isdir( root + "/etc/wine-doors" ):
++                              os.makedirs( root + "/etc/wine-doors" )
++                      symlink( share + "/pixmaps/wine-doors.png", root + 
prefix + "/share/pixmaps/wine-doors.png" )
++                      symlink( share + "/pixmaps/wine-doors.svg", root + 
prefix + "/share/pixmaps/wine-doors.svg" )
+               
+-              symlink( share + "src/winedoors.py", prefix + "/bin/wine-doors" 
)
++              symlink( share + "/src/winedoors.py", root + prefix + 
"/bin/wine-doors" )
+               print "Creating initial preferences"
+               preferences.preferences['prefix'] = prefix
+               preferences.Default()
+-              preferences.AddRepo( "System Global", share + "global.repo/" )
+-              preferences.AddRepo( "System Base", share +  "base.repo/" )
++              preferences.AddRepo( "System Global", share + "/global.repo/" )
++              preferences.AddRepo( "System Base", share +  "/base.repo/" )
+               preferences.Save( conf_file )
+       elif command == "uninstall":
+               if os.path.exists( prefix + "/bin/wine-doors" ):
+@@ -124,20 +128,20 @@
+                       if not prefix:
+                               preferences.Load( 
"/etc/wine-doors/preferences.xml" )
+                               prefix = preferences['prefix']
+-                      share = prefix + "share/wine-doors"
++                      share = prefix + "/share/wine-doors"
+                       if os.path.exists( "/etc/wine-doors" ):
+                               shutil.rmtree( "/etc/wine-doors" )
+                       print "Removing symlinks"
+-                      if os.path.exists( prefix + 
"share/pixmaps/wine-doors.png" ):
+-                              os.remove( prefix + 
"share/pixmaps/wine-doors.png" )
+-                      if os.path.exists( prefix + 
"share/pixmaps/wine-doors.png" ):
+-                              os.remove( prefix + 
"share/pixmaps/wine-doors.svg" )
++                      if os.path.exists( prefix + 
"/share/pixmaps/wine-doors.png" ):
++                              os.remove( prefix + 
"/share/pixmaps/wine-doors.png" )
++                      if os.path.exists( prefix + 
"/share/pixmaps/wine-doors.png" ):
++                              os.remove( prefix + 
"/share/pixmaps/wine-doors.svg" )
+                       print "Removing menu item"
+-                      if os.path.exists( prefix + 
"share/applications/wine-doors.desktop" ):
+-                              os.remove (prefix + 
"share/applications/wine-doors.desktop" )
++                      if os.path.exists( prefix + 
"/share/applications/wine-doors.desktop" ):
++                              os.remove (prefix + 
"/share/applications/wine-doors.desktop" )
+               else:
+-                      prefix = os.path.expanduser( "~/" )
+-                      share = prefix + ".wine-doors/"
++                      prefix = os.path.expanduser( "~" )
++                      share = prefix + "/.wine-doors/"
+                       local = os.path.expanduser( "~/.local/")
+                       print "Removing menu item"
+                       if os.path.exists( local + 
"share/applications/wine-doors.desktop" ):
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to