Index: setup.py
===================================================================
--- setup.py	(revision 3428)
+++ setup.py	(working copy)
@@ -31,12 +31,14 @@
          self.siteconfig()
 
      def siteconfig(self):
-         conf_dir = os.path.join(self.prefix, 'share', 'trac', 'conf')
-         templates_dir = os.path.join(self.prefix, 'share', 'trac', 'templates')
-         htdocs_dir = os.path.join(self.prefix, 'share', 'trac', 'htdocs')
-         wiki_dir = os.path.join(self.prefix, 'share', 'trac', 'wiki-default')
-         macros_dir = os.path.join(self.prefix, 'share', 'trac', 'wiki-macros')
-         plugins_dir = os.path.join(self.prefix, 'share', 'trac', 'plugins')
+         path = self.prefix or self.home
+         path = os.path.expanduser(path)
+         conf_dir = os.path.join(path, 'share', 'trac', 'conf')
+         templates_dir = os.path.join(path, 'share', 'trac', 'templates')
+         htdocs_dir = os.path.join(path, 'share', 'trac', 'htdocs')
+         wiki_dir = os.path.join(path, 'share', 'trac', 'wiki-default')
+         macros_dir = os.path.join(path, 'share', 'trac', 'wiki-macros')
+         plugins_dir = os.path.join(path, 'share', 'trac', 'plugins')
          f = open(_p('trac/siteconfig.py'), 'w')
          f.write("""
 # PLEASE DO NOT EDIT THIS FILE!
Index: trac/perm.py
===================================================================
--- trac/perm.py	(revision 3428)
+++ trac/perm.py	(working copy)
@@ -81,7 +81,16 @@
         """Return a list of names of the groups that the user with the specified
         name is a member of."""
 
+class IPermissionChangeListener(Interface):
+    """Extension point interface you listen for permission changes"""
+    
+    def permission_granted(self, subject, action):
+        """blah"""
 
+    def permission_revoked(self, subject, action):
+        """blok"""
+
+
 class DefaultPermissionStore(Component):
     """Default implementation of permission storage and simple group management.
     
@@ -91,6 +100,7 @@
     implements(IPermissionStore)
 
     group_providers = ExtensionPoint(IPermissionGroupProvider)
+    change_listeners = ExtensionPoint(IPermissionChangeListener)
 
     def get_user_permissions(self, username):
         """Retrieve the permissions for the given user and return them in a
@@ -144,6 +154,9 @@
         self.log.info('Granted permission for %s to %s' % (action, username))
         db.commit()
 
+        for cl in self.change_listeners:
+            cl.permission_granted(username, action)
+
     def revoke_permission(self, username, action):
         """Revokes a users' permission to perform the specified action."""
         db = self.env.get_db_cnx()
@@ -152,6 +165,9 @@
                        (username, action))
         self.log.info('Revoked permission for %s to %s' % (action, username))
         db.commit()
+        
+        for cl in self.change_listeners:
+            cl.permission_revoked(username, action)
 
 
 class DefaultPermissionGroupProvider(Component):
