Beispiel #1
0
def chown(global_config, package_config):
    
    """Special chown for python path"""
    source_dir = package_config["working_dir"]
    uploaded_dir = os.path.join(source_dir, "uploaded")
    run_fakeroot("chgrp -R www-data %s" % uploaded_dir)
    run_fakeroot("chmod g+sw %s" % uploaded_dir)
Beispiel #2
0
def create_directory(global_config, package_config):
    """
    Creates Directory and any subdirectories
    
    Set 'dir_to_create' in your package config
    """
    directory_to_create = package_config["directory_to_create"]
    run_fakeroot("mkdir -p %s" % directory_to_create)
Beispiel #3
0
def chown_directory(global_config, package_config):
    """
    Chown Directories
    
    Set 'chown_user' in your package config
    Set 'chown_directory' in your package config
    """
    chown_user = package_config["chown_user"]
    chown_directory = package_config["chown_directory"]
    
    run_fakeroot("chown %s %s" % (chown_user, chown_directory))
Beispiel #4
0
    def build_package(self):
        """Builds a debian package

        Actually does the call outs to dpkg so that we can actually build
        a package
        
        """
        source_dir = "%s" % self.package_config["working_dir"]

        # makes sure root owns the files
        run_fakeroot("chown -R root.root %s" % source_dir)
        # remove all sticky bits - a deb requirement.
        run_fakeroot("chmod -R a-s %s" % source_dir)

        self.run_hook("post_permissions")

        if not self.global_config["quiet"]:
            print "Building package %s" % self.package_config["package"]
            print "From %s" % self.package_config["path"]

        run_fakeroot(
            "dpkg -b %s %s/temp/%s"
            % (source_dir, self.global_config["build_directory"], self.package_config["package_filename"])
        )

        clean_fakeroot()

        # Cleans up assuming the no-clean flag isn't set
        if not self.global_config["no_clean"]:
            run_command("rm -rf %s" % source_dir)