예제 #1
0
def filelists_from_spec(spec, specpath):
    res = Tree()
    for pkg in spec.packages:
        name = "%s.install.in" % mappkgname.map_package_name(pkg.header)
        res.append("debian/%s" % name,
                   files_from_pkg(spec.sourceHeader['name'], pkg, specpath))
    return res
예제 #2
0
def binary_deb_from_spec(spec, tree):
    res = ""
    res += "Package: %s\n" % mappkgname.map_package_name(spec.header)
    if spec.header['arch'] in ["x86_64", "i686", "armhf", "armv7l"]:
        res += "Architecture: any\n"
    else:
        res += "Architecture: all\n"

    res += "Depends:\n"
    depends = ["${ocaml:Depends}", "${shlibs:Depends}", "${misc:Depends}"]
    for pkg, version in zip(spec.header['requires'],
                            spec.header['requireVersion']):
        deps = mappkgname.map_package(pkg)
        for dep in deps:
            if version:
                dep += " (>= %s)" % version
            depends.append(dep)
    res += ",\n".join([" %s" % d for d in depends])
    res += "\n"

    # XXX These lines should only be added for ocaml packages
    res += "Provides: ${ocaml:Provides}\n"
    res += "Recommends: ocaml-findlib\n"

    res += "Description: %s\n" % spec.header['summary']
    res += format_description(spec.header['description'])
    res += "\n\n"

    tree.append('debian/control', res)
예제 #3
0
def conffiles_from_spec(spec, specpath):
    # Configuration files, not to be overwritten on upgrade.
    # Files in /etc are automatically marked as config files,
    # so we only need to list files here if they are in a
    # different place.
    res = Tree()
    pkgname = mappkgname.map_package_name(spec.sourceHeader)
    files = rpmextra.files_from_spec(pkgname, specpath)
    if pkgname + "-%config" in files:
        for filename in files[pkgname + "-%config"]:
            res.append('debian/conffiles', "%s\n" % filename)
    return res
예제 #4
0
def rules_dh_install_from_spec(spec, tree, specpath):
    rule = ".PHONY: override_dh_install\n"
    rule += "override_dh_install:\n"
    rule += "\tdh_install\n"

    pkgname = mappkgname.map_package_name(spec.sourceHeader)
    files = rpmextra.files_from_spec(pkgname, specpath)
    if pkgname + "-%exclude" in files:
        for pat in files[pkgname + "-%exclude"]:
            path = "\trm -f debian/%s/%s\n" % (pkgname, rpm.expandMacro(pat))
            rule += os.path.normpath(path)
    rule += "\n"

    tree.append('debian/rules', rule)