Exemplo n.º 1
0
    def testIsLink(self):
        from pisi.actionsapi.shelltools import sym
        from pisi.actionsapi.shelltools import isLink

        sym('../database', 'tests/history')
        assert isLink('tests/history')
        assert not isLink('tests/runtests.py')
Exemplo n.º 2
0
    def testIsLink(self):
        from pisi.actionsapi.shelltools import sym
        from pisi.actionsapi.shelltools import isLink

        sym('tests/database','tests/history')
        assert isLink('tests/history')
        assert not isLink('tests/runtests.py')
Exemplo n.º 3
0
    def testShelltoolsIsLink(self):
        from pisi.actionsapi.shelltools import isLink

        self.assert_(isLink("tests/actionsapitests/linktoadirectory"))
        self.assert_(isLink("tests/actionsapitests/linktoafile"))
        self.assert_(isLink("tests/actionsapitests/brokenlink"))
        self.assert_(not isLink("tests/actionsapitests/file"))
        self.assert_(not isLink("tests/actionsapitests/adirectory"))
Exemplo n.º 4
0
def install():

    # Get plugins list
    plugins = shelltools.ls(".")

    # Install the firmware files
    for pl in plugins:
        files = shelltools.ls("%s/usr/share/iscan" % pl)
        if len(files) > 0:
            pisitools.insinto("/usr/share/iscan",
                              "%s/usr/share/iscan/%s" % (pl, files[0]))

    # Install the libraries
    libs = [
        f.rpartition(get.curDIR() + '/')[-1]
        for f in glob.glob("%s/*/usr/lib/iscan/*" % get.curDIR())
        if not shelltools.isLink(f)
    ]

    for l in libs:
        pisitools.dolib_so(l, "/usr/lib/iscan")
        pisitools.dosym(shelltools.baseName(l),
                        "/%s" % l.split("/", 1)[1].split(".")[0] + '.so')
        pisitools.dosym(shelltools.baseName(l),
                        "/%s" % l.split("/", 1)[1].split(".")[0] + '.so.2')

    # Dodoc one of the plugins doc files, it's all same.
    for d in shelltools.ls(
            "iscan-plugin-gt-f520/usr/share/doc/iscan-plugin-gt-f520-1.0.0"):
        pisitools.dodoc(
            "iscan-plugin-gt-f520/usr/share/doc/iscan-plugin-gt-f520-1.0.0/%s"
            % d)
Exemplo n.º 5
0
def install():
    shelltools.cd("%s/build" % get.workDIR())
    
    conf = "DESTDIR=%s \
            prefix=%s \
            bindir=%s \
            includedir=%s/include \
            datadir=%s \
            mandir=%s/man \
            infodir=%s/info \
            LIBPATH=%s \
            ${GCC_INSTALL_TARGET}" % (get.installDIR(), PREFIX, BINPATH, LIBPATH, DATAPATH, DATAPATH, DATAPATH, LIBPATH)

    autotools.make(conf)

    for file in shelltools.ls("%s/build/gcc/include/*" % get.workDIR()):
        if shelltools.isLink(file):
            shelltools.unlink(file)

    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    # This one comes with binutils
    pisitools.remove("/usr/lib/libiberty.a")

    for file in ("%s/libstdc++.la" % LIBPATH, "%s/libsupc++.la" % LIBPATH):
        pisitools.dosed("%s%s" % (get.installDIR(),file), "^libdir.*", "libdir=%s" % shelltools.baseName(file))

    # Move Java headers to compiler-specific dir
    pisitools.domove("/usr/lib/security", LIBPATH)
    pisitools.domove("/usr/lib/lib*", LIBPATH)

    # Move <cxxabi.h> to compiler-specific directories
    pisitools.move("%s/cxxabi.h" % STDCXX_INCDIR, "%s/include/" % LIBPATH)

    # These should be symlinks
    for binary in ("gcc", "g++", "c++"):
        pisitools.remove("%s/%s" % (BINPATH, binary))
        pisitools.dosym("%s-%s" % (get.HOST(), binary), "%s/%s" % (BINPATH, binary))
        # /usr/bin symlinks
        pisitools.dosym("%s/%s" % (BINPATH, binary), "/usr/bin/%s" % binary)

    # /usr/bin symlinks
    pisitools.dosym("%s/gcc" % BINPATH, "/usr/bin/cc")
    pisitools.dosym("%s/cpp" % BINPATH, "/usr/bin/cpp")
    
    # i686-... symlinks 
    pisitools.dosym("%s/gcc" % BINPATH, "/usr/bin/%s-gcc" % get.HOST())
    pisitools.dosym("%s/g++" % BINPATH, "/usr/bin/%s-g++" % get.HOST())
    pisitools.dosym("%s/c++" % BINPATH, "/usr/bin/%s-c++" % get.HOST())
    pisitools.dosym("%s/g77" % BINPATH, "/usr/bin/%s-g77" % get.HOST())

    # For some reason, g77 and gcjh gets made instead of ${CTARGET}-g77... this makes it safe
    pisitools.domove("%s/g77" % BINPATH, "%s/" % BINPATH ,"%s-g77" %  get.HOST())
    pisitools.dosym("%s-g77" % get.HOST(), "%s/g77" % BINPATH)

    # Fix libstdc++ path
    pisitools.dosed("%s/usr/lib/gcc/i686-pc-linux-gnu/3.4.5/libstdc++.la" % get.installDIR(), 
                    "libdir=libstdc\\+\\+.la", "libdir='/usr/lib/gcc/i686-pc-linux-gnu/3.4.5'")
Exemplo n.º 6
0
def install():
    #evil e2fsprogs makefile -- I'll get you!
    autotools.rawInstall("DESTDIR=%s libdir=/zapme" % get.installDIR())
    pisitools.removeDir("/zapme")

    autotools.rawInstall("DESTDIR=%s" % get.installDIR(), "install-libs")

    pisitools.dodoc("ChangeLog", "README", "RELEASE-NOTES", "SHLIBS",
                    "e2fsck/ChangeLog", "e2fsck/CHANGES")

    pisitools.domove("/usr/lib/", "/lib")
    pisitools.domove("/lib/*.a", "/usr/lib")

    for file in shelltools.ls("%s/usr/lib/*.a" % get.installDIR()):
        destination = file.replace(get.installDIR(), "")
        destination = destination.split("/")[3]
        # create new ldscript
        libtools.gen_usr_ldscript(destination.replace(".a", ".so"))

    # normalize evil symlinks
    for link in shelltools.ls("%s/lib/*" % get.installDIR()):
        if shelltools.isLink(link) and not shelltools.can_access_file(
                shelltools.realPath(link)):
            source = shelltools.baseName(shelltools.realPath(link))
            link = link.replace(get.installDIR(), "")
            # remove old link
            pisitools.remove(link)
            # create new link
            pisitools.dosym(source, link)

    pisitools.domove("/usr/sbin/", "/sbin")

    pisitools.domove("/usr/bin/lsattr", "/bin")
    pisitools.domove("/usr/bin/chattr", "/bin")
    pisitools.domove("/usr/bin/uuidgen", "/bin")

    pisitools.domove("/sbin/mklost+found", "/usr/sbin")

    # time to convert hard links/duplicates to symbolic links
    pisitools.remove("/sbin/fsck.ext2")
    pisitools.dosym("/sbin/e2fsck", "/sbin/fsck.ext2")
    pisitools.remove("/sbin/fsck.ext3")
    pisitools.dosym("/sbin/e2fsck", "/sbin/fsck.ext3")

    pisitools.remove("/sbin/mkfs.ext2")
    pisitools.dosym("/sbin/mke2fs", "/sbin/mkfs.ext2")
    pisitools.remove("/sbin/mkfs.ext3")
    pisitools.dosym("/sbin/mke2fs", "/sbin/mkfs.ext3")

    # copy compile_et & mk_cmds
    shelltools.copy("%s/lib/et/compile_et" % get.curDIR(),
                    "%s/bin/" % get.installDIR())
    shelltools.copy("%s/lib/ss/mk_cmds" % get.curDIR(),
                    "%s/bin/" % get.installDIR())

    # Symlink com_err.h
    pisitools.dosym("/usr/include/et/com_err.h", "/usr/include/com_err.h")
Exemplo n.º 7
0
def install():
    # evil e2fsprogs makefile -- I'll get you!
    autotools.rawInstall("DESTDIR=%s libdir=/zapme" % get.installDIR())
    pisitools.removeDir("/zapme")

    autotools.rawInstall("DESTDIR=%s" % get.installDIR(), "install-libs")

    pisitools.dodoc("ChangeLog", "README", "RELEASE-NOTES", "SHLIBS", "e2fsck/ChangeLog", "e2fsck/CHANGES")

    pisitools.domove("/usr/lib/", "/lib")
    pisitools.domove("/lib/*.a", "/usr/lib")

    for file in shelltools.ls("%s/usr/lib/*.a" % get.installDIR()):
        destination = file.replace(get.installDIR(), "")
        destination = destination.split("/")[3]
        # create new ldscript
        libtools.gen_usr_ldscript(destination.replace(".a", ".so"))

    # normalize evil symlinks
    for link in shelltools.ls("%s/lib/*" % get.installDIR()):
        if shelltools.isLink(link) and not shelltools.can_access_file(shelltools.realPath(link)):
            source = shelltools.baseName(shelltools.realPath(link))
            link = link.replace(get.installDIR(), "")
            # remove old link
            pisitools.remove(link)
            # create new link
            pisitools.dosym(source, link)

    pisitools.domove("/usr/sbin/", "/sbin")

    pisitools.domove("/usr/bin/lsattr", "/bin")
    pisitools.domove("/usr/bin/chattr", "/bin")
    pisitools.domove("/usr/bin/uuidgen", "/bin")

    pisitools.domove("/sbin/mklost+found", "/usr/sbin")

    # time to convert hard links/duplicates to symbolic links
    pisitools.remove("/sbin/fsck.ext2")
    pisitools.dosym("/sbin/e2fsck", "/sbin/fsck.ext2")
    pisitools.remove("/sbin/fsck.ext3")
    pisitools.dosym("/sbin/e2fsck", "/sbin/fsck.ext3")

    pisitools.remove("/sbin/mkfs.ext2")
    pisitools.dosym("/sbin/mke2fs", "/sbin/mkfs.ext2")
    pisitools.remove("/sbin/mkfs.ext3")
    pisitools.dosym("/sbin/mke2fs", "/sbin/mkfs.ext3")

    # copy compile_et & mk_cmds
    shelltools.copy("%s/lib/et/compile_et" % get.curDIR(), "%s/bin/" % get.installDIR())
    shelltools.copy("%s/lib/ss/mk_cmds" % get.curDIR(), "%s/bin/" % get.installDIR())

    # Symlink com_err.h
    pisitools.dosym("/usr/include/et/com_err.h", "/usr/include/com_err.h")
Exemplo n.º 8
0
def install():
    shelltools.cd("build")

    # Do not allow symlinks in include as this can break the build.
    for file in shelltools.ls("gcc/include/*"):
        if shelltools.isLink(file):
            shelltools.unlink(file)

    # Remove generated headers, as they can cause things to break
    for file in shelltools.ls("gcc/include/*"):
        if shelltools.isFile(file):
            if not shelltools.system("grep -q \"auto-edited\" %s" % file):
                shelltools.unlink(file)
        elif shelltools.isDirectory(file):
            shelltools.unlinkDir(file)

    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    # This one comes with gdb
    pisitools.remove("/usr/share/gcc-snapshot/lib/libiberty.a")

    # cc symlink
    pisitools.dosym("/usr/lib/gcc-snapshot/bin/gcc","/usr/lib/gcc-snapshot/bin/cc")
Exemplo n.º 9
0
def install():

    # Get plugins list
    plugins = shelltools.ls(".")

    # Install the firmware files
    for pl in plugins:
        files = shelltools.ls("%s/usr/share/iscan" % pl)
        if len(files) > 0:
            pisitools.insinto("/usr/share/iscan", "%s/usr/share/iscan/%s" % (pl, files[0]))

    # Install the libraries
    libs = [f.rpartition(get.curDIR()+'/')[-1] for f in glob.glob("%s/*/usr/lib/iscan/*" % get.curDIR())
                    if not shelltools.isLink(f)]

    for l in libs:
        pisitools.dolib_so(l, "/usr/lib/iscan")
        pisitools.dosym(shelltools.baseName(l), "/%s" % l.split("/", 1)[1].split(".")[0]+'.so')
        pisitools.dosym(shelltools.baseName(l), "/%s" % l.split("/", 1)[1].split(".")[0]+'.so.2')

    # Dodoc one of the plugins doc files, it's all same.
    for d in shelltools.ls("iscan-plugin-gt-f520/usr/share/doc/iscan-plugin-gt-f520-1.0.0"):
        pisitools.dodoc("iscan-plugin-gt-f520/usr/share/doc/iscan-plugin-gt-f520-1.0.0/%s" % d)
Exemplo n.º 10
0
def install():
    shelltools.cd(buildDir)
    autotools.rawInstall("prefix=/usr DESTDIR=%s" % get.installDIR())
    shelltools.system("pwd")
    #install biber
    pisitools.dobin("../../biber-2.14/bin/biber")

    #pisitools.dodir("/usr/share/tlpkg/TeXLive")
    #shelltools.move("%s/source/utils/biber/TeXLive/*.pm" % get.workDIR(), "%s/usr/share/tlpkg/TeXLive" % get.installDIR())

    # remove aleph from fmtutil.cnf
    pisitools.dosed(
        "%s/usr/share/texmf-dist/web2c/fmtutil.cnf" % get.installDIR(),
        "^.*aleph.*$")

    pisitools.insinto("/etc/texmf/texconfig",
                      "%s/usr/share/texmf-dist/texconfig/tcfmgr.map" %
                      get.installDIR(),
                      sym=True)

    # fix symlinks, some are incorrect
    # makefile patching is another way, but there ar/dvipdfmx.cfge lot of scripts
    # pathing each makefile makes it much harder, for now this is a "simpler" solution
    for binary in shelltools.ls(get.installDIR() + "/usr/bin"):
        real_path = shelltools.realPath(get.installDIR() + "/usr/bin/" +
                                        binary)
        if "texmf" in real_path and not os.path.exists(
                real_path):  # modify only if it is broken
            base_path = real_path.replace(get.installDIR() + "/usr", "")
            new_path = "/usr/share" + base_path
            shelltools.unlink(get.installDIR() + "/usr/bin/" + binary)
            pisitools.dosym(new_path, "/usr/bin/" + binary)

    bibtexextra_scripts = [
        "bbl2bib", "bib2gls", "bibdoiadd", "bibexport", "bibmradd",
        "biburl2doi", "bibzbladd", "convertgls2bib", "listbib",
        "ltx2crossrefxml", "multibibliography", "urlbst"
    ]

    core_scripts = [
        "a2ping", "a5toa4", "adhocfilelist", "afm2afm", "allcm", "allec",
        "allneeded", "arara", "arlatex", "autoinst", "bundledoc", "checkcites",
        "checklistings", "chklref", "chkweb", "cjk-gs-integrate", "cluttex",
        "cllualatex", "clxelatex", "context", "contextjit", "ctanbib",
        "ctanify", "ctanupload", "ctan-o-mat", "de-macro", "depythontex",
        "deweb", "dosepsbin", "dtxgen", "dvi2fax", "dviasm", "dviinfox",
        "dvired", "e2pall", "epstopdf", "findhyph", "fmtutil", "fmtutil-sys",
        "fmtutil-user", "fontinst", "fragmaster", "ht", "htcontext", "htlatex",
        "htmex", "httex", "httexi", "htxelatex", "htxetex", "installfont-tl",
        "jfmutil", "ketcindy", "kpsepath", "kpsetool", "kpsewhere",
        "kpsexpand", "latex-git-log", "latex-papersize", "latex2man",
        "latex2nemeth", "latexdef", "latexdiff", "latexdiff-vc",
        "latexfileversion", "latexindent", "latexmk", "latexpand",
        "latexrevise", "listings-ext.sh", "ltxfileinfo", "ltximg",
        "luaotfload-tool", "luatools", "lwarpmk", "make4ht", "match_parens",
        "mf2pt1", "mk4ht", "mkjobtexmf", "mkt1font", "mktexfmt", "mktexlsr",
        "mktexmf", "mktexpk", "mktextfm", "mptopdf", "mtxrun", "mtxrunjit",
        "ot2kpx", "pamphletangler", "pdfatfi", "pdfbook2", "pdfcrop", "pdfjam",
        "pdflatexpicscale", "pdftex-quiet", "pdfxup", "pfarrei", "pkfix",
        "pkfix-helper", "ps2eps", "ps2frag", "pslatex", "purifyeps",
        "pythontex", "repstopdf", "rpdfcrop", "rungs", "simpdftex",
        "srcredact", "sty2dtx", "tex4ebook", "texconfig", "texconfig-dialog",
        "texconfig-sys", "texcount", "texdef", "texdiff", "texdirflatten",
        "texdoc", "texdoctk", "texexec", "texfot", "texhash", "texindy",
        "texlinks", "texliveonfly", "texloganalyser", "texmfstart",
        "texosquery", "texosquery-jre5", "texosquery-jre8", "texplate",
        "thumbpdf", "tlcockpit", "tlshell", "typeoutfileinfo", "updmap",
        "updmap-sys", "updmap-user", "vpl2ovp", "vpl2vpl", "xhlatex", "xindex",
        "xindy"
    ]

    games_scripts = ["rubikrotation"]

    humanities_scripts = ["diadia"]

    langcyrillic_scripts = ["rubibtex", "rumakeindex"]
    langkorean_scripts = ["jamo-normalize komkindex ttf2kotexfont"]
    langcjk_scripts = [
        "convbkmk", "ptex2pdf", "kanji-fontmap-creator", "kanji-config-updmap",
        "kanji-config-updmap-sys", "kanji-config-updmap-user"
    ]

    langextra_scripts = ["ebong"]

    langgreek_scripts = ["mkgrkindex"]

    latexextra_scripts = [
        "authorindex", "exceltex", "l3build", "makedtx", "makeglossaries",
        "makeglossaries-lite", "pdfannotextractor", "perltex", "ps4pdf",
        "splitindex", "svn-multi", "vpe", "webquiz", "wordcount", "yplan"
    ]

    music_scripts = [
        "lily-glyph-commands", "lily-image-commands", "lily-rebuild-pdfs",
        "m-tx", "musixtex", "musixflx", "pmxchords"
    ]

    pictures_scripts = [
        "cachepic", "epspdf", "epspdftk", "fig4latex", "getmapdl", "mathspic",
        "mathspic", "mkpic", "pn2pdf"
    ]

    pstricks_scripts = ["pedigree", "pst2pdf"]

    science_scripts = ["pygmentex", "ulqda"]

    # remove unneeded files and symlinks
    dirs = []
    for g in [bibtexextra_scripts, core_scripts, games_scripts, humanities_scripts, \
              langcjk_scripts, langcyrillic_scripts, langextra_scripts, \
              langgreek_scripts, latexextra_scripts, music_scripts, \
              pictures_scripts, pstricks_scripts, science_scripts, \
              ["tlmgr"]]:
        for s in g:
            if shelltools.isLink("%s/usr/bin/%s" % (get.installDIR(), s)):
                realpath = shelltools.realPath("%s/usr/bin/%s" %
                                               (get.installDIR(), s))
                dirname = shelltools.dirName(realpath)
                if not dirname in dirs: dirs.append(dirname)
                if not dirname == "%s/usr/bin" % get.installDIR():
                    if shelltools.isFile(realpath): shelltools.unlink(realpath)
                pisitools.remove("/usr/bin/%s" % s)

    # remove empty dirs
    while dirs:
        tmpdirs = dirs[:]
        for d in tmpdirs:
            if not shelltools.ls(d):
                shelltools.unlinkDir(d)
                dirname = shelltools.dirName(d)
                if not dirname in dirs: dirs.append(dirname)
            dirs.remove(d)

    pdftexsymlinks = [
        "amstex", "cslatex", "csplain", "eplain", "etex", "jadetex", "latex",
        "mex", "mllatex", "mltex", "pdfetex", "pdfcslatex", "pdfcsplain",
        "pdfjadetex", "pdflatex", "pdfmex", "pdfxmltex", "texsis", "utf8mex",
        "xmltex"
    ]

    for symlink in pdftexsymlinks:
        pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)

    luatexsymlinks = ["dvilualatex", "dviluatex", "lualatex"]

    for symlink in luatexsymlinks:
        pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)

    pisitools.dosym("eptex", "/usr/bin/platex")
    pisitools.dosym("euptex", "/usr/bin/uplatex")
    pisitools.dosym("xetex", "/usr/bin/xelatex")

    pisitools.removeDir("/usr/share/texmf-dist")
Exemplo n.º 11
0
def install():
    shelltools.cd("%s/source/build/" % get.workDIR())
    autotools.rawInstall("prefix=/usr DESTDIR=%s" % get.installDIR())

    #install biber
    pisitools.dobin("../../biber")

    #pisitools.dodir("/usr/share/tlpkg/TeXLive")
    #shelltools.move("%s/source/utils/biber/TeXLive/*.pm" % get.workDIR(), "%s/usr/share/tlpkg/TeXLive" % get.installDIR())

    # remove aleph from fmtutil.cnf
    pisitools.dosed(
        "%s/usr/share/texmf-dist/web2c/fmtutil.cnf" % get.installDIR(),
        "^.*aleph.*$")

    pisitools.insinto("/etc/texmf/texconfig",
                      "%s/usr/share/texmf-dist/texconfig/tcfmgr.map" %
                      get.installDIR(),
                      sym=True)

    # fix symlinks, some are incorrect
    # makefile patching is another way, but there ar/dvipdfmx.cfge lot of scripts
    # pathing each makefile makes it much harder, for now this is a "simpler" solution
    for binary in shelltools.ls(get.installDIR() + "/usr/bin"):
        real_path = shelltools.realPath(get.installDIR() + "/usr/bin/" +
                                        binary)
        if "texmf" in real_path and not os.path.exists(
                real_path):  # modify only if it is broken
            base_path = real_path.replace(get.installDIR() + "/usr", "")
            new_path = "/usr/share" + base_path
            shelltools.unlink(get.installDIR() + "/usr/bin/" + binary)
            pisitools.dosym(new_path, "/usr/bin/" + binary)

    bibtexextra_scripts = [
        "bibexport", "listbib", "multibibliography", "urlbst"
    ]

    core_scripts = [
        "a2ping", "a5toa4", "adhocfilelist", "afm2afm", "allcm", "allec",
        "allneeded", "arara", "arlatex", "autoinst", "bundledoc", "checkcites",
        "chkweb", "context", "ctanify", "ctanupload", "ctxtools", "de-macro",
        "deweb", "dosepsbin", "dtxgen", "dvi2fax", "dviasm", "dvired",
        "e2pall", "epstopdf", "findhyph", "fmtutil", "fmtutil-sys", "fontinst",
        "fragmaster", "installfont-tl", "kpsepath", "kpsetool", "kpsewhere",
        "kpsexpand", "latex2man", "latexdiff", "latexdiff-vc",
        "latexfileversion", "latexmk", "latexpand", "latexrevise",
        "listings-ext.sh", "ltxfileinfo", "lua2dox_filter", "luaotfload-tool",
        "luatools", "match_parens", "mf2pt1", "mkjobtexmf", "mkluatexfontdb",
        "mkt1font", "mktexfmt", "mptopdf", "mtxrun", "ot2kpx", "pdf180",
        "pdf270", "pdf90", "pdfatfi", "pdfbook", "pdfcrop", "pdfflip",
        "pdfjam", "pdfjam-pocketmod", "pdfjam-slides3up", "pdfjam-slides6up",
        "pdfjoin", "pdfnup", "pdfpun", "pfarrei", "pkfix", "pkfix-helper",
        "ps2eps", "ps2frag", "pslatex", "pstopdf", "purifyeps", "repstopdf",
        "rpdfcrop", "rungs", "simpdftex", "sty2dtx", "texconfig",
        "texconfig-dialog", "texconfig-sys", "texcount", "texdef", "texdiff",
        "texdirflatten", "texdoc", "texdoctk", "texexec", "texindy",
        "texlinks", "texliveonfly", "texloganalyser", "texmfstart", "thumbpdf",
        "typeoutfileinfo", "updmap", "updmap-sys", "vpl2ovp", "vpl2vpl",
        "xindy"
    ]

    htmlxml_scripts = [
        "ht", "htcontext", "htlatex", "htmex", "httex", "httexi", "htxelatex",
        "htxetex", "mk4ht"
    ]

    langcyrillic_scripts = ["rubibtex", "rumakeindex"]

    langcjk_scripts = [
        "convbkmk", "ptex2pdf", "kanji-fontmap-creator", "kanji-config-updmap",
        "kanji-config-updmap-sys"
    ]

    langextra_scripts = ["ebong"]

    langgreek_scripts = ["mkgrkindex"]

    latexextra_scripts = [
        "authorindex", "exceltex", "makeglossaries", "pdfannotextractor",
        "perltex", "ps4pdf", "splitindex", "svn-multi", "vpe"
    ]

    music_scripts = ["m-tx", "musixtex", "musixflx", "pmx2pdf"]

    pictures_scripts = [
        "cachepic", "epspdf", "epspdftk", "fig4latex", "mathspic"
    ]

    pstricks_scripts = ["pedigree", "pst2pdf"]

    science_scripts = ["ulqda"]

    # remove unneeded files and symlinks
    dirs = []
    for g in [bibtexextra_scripts, core_scripts, htmlxml_scripts, \
              langcjk_scripts, langcyrillic_scripts, langextra_scripts, \
              langgreek_scripts, latexextra_scripts, music_scripts, \
              pictures_scripts, pstricks_scripts, science_scripts, \
              ["tlmgr"]]:
        for s in g:
            if shelltools.isLink("%s/usr/bin/%s" % (get.installDIR(), s)):
                realpath = shelltools.realPath("%s/usr/bin/%s" %
                                               (get.installDIR(), s))
                dirname = shelltools.dirName(realpath)
                if not dirname in dirs: dirs.append(dirname)
                if not dirname == "%s/usr/bin" % get.installDIR():
                    if shelltools.isFile(realpath): shelltools.unlink(realpath)
                pisitools.remove("/usr/bin/%s" % s)

    # remove empty dirs
    while dirs:
        tmpdirs = dirs[:]
        for d in tmpdirs:
            if not shelltools.ls(d):
                shelltools.unlinkDir(d)
                dirname = shelltools.dirName(d)
                if not dirname in dirs: dirs.append(dirname)
            dirs.remove(d)

    pdftexsymlinks = [
        "amstex", "cslatex", "csplain", "eplain", "etex", "jadetex", "latex",
        "mex", "mllatex", "mltex", "pdfetex", "pdfcslatex", "pdfcsplain",
        "pdfjadetex", "pdflatex", "pdfmex", "pdfxmltex", "texsis", "utf8mex",
        "xmltex"
    ]

    for symlink in pdftexsymlinks:
        pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)

    luatexsymlinks = ["dvilualatex", "dviluatex", "lualatex"]

    for symlink in luatexsymlinks:
        pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)

    pisitools.dosym("eptex", "/usr/bin/platex")
    pisitools.dosym("euptex", "/usr/bin/uplatex")
    pisitools.dosym("xetex", "/usr/bin/xelatex")

    pisitools.removeDir("/usr/share/texmf-dist")
Exemplo n.º 12
0
def install():
    shelltools.cd("%s/build" % get.workDIR())

    conf = "DESTDIR=%s \
            prefix=%s \
            bindir=%s \
            includedir=%s/include \
            datadir=%s \
            mandir=%s/man \
            infodir=%s/info \
            LIBPATH=%s \
            ${GCC_INSTALL_TARGET}" % (get.installDIR(), PREFIX, BINPATH,
                                      LIBPATH, DATAPATH, DATAPATH, DATAPATH,
                                      LIBPATH)

    autotools.make(conf)

    for file in shelltools.ls("%s/build/gcc/include/*" % get.workDIR()):
        if shelltools.isLink(file):
            shelltools.unlink(file)

    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    # This one comes with binutils
    pisitools.remove("/usr/lib/libiberty.a")

    for file in ("%s/libstdc++.la" % LIBPATH, "%s/libsupc++.la" % LIBPATH):
        pisitools.dosed("%s%s" % (get.installDIR(), file), "^libdir.*",
                        "libdir=%s" % shelltools.baseName(file))

    # Move Fortran libs to LIBPATH
    pisitools.domove("/usr/lib/gcc/%s/lib*" % get.HOST(), LIBPATH)

    # Move <cxxabi.h> to compiler-specific directories
    pisitools.move("%s/cxxabi.h" % STDCXX_INCDIR, "%s/include/" % LIBPATH)

    # These should be symlinks
    for binary in ("gcc", "g++", "c++"):
        pisitools.remove("%s/%s" % (BINPATH, binary))
        pisitools.dosym("%s-%s" % (get.HOST(), binary),
                        "%s/%s" % (BINPATH, binary))
        # /usr/bin symlinks
        pisitools.dosym("%s/%s" % (BINPATH, binary), "/usr/bin/%s" % binary)

    # /usr/bin symlinks
    pisitools.dosym("%s/gcc" % BINPATH, "/usr/bin/cc")
    pisitools.dosym("%s/cpp" % BINPATH, "/usr/bin/cpp")

    # i686-... symlinks
    pisitools.dosym("%s/gcc" % BINPATH, "/usr/bin/%s-gcc" % get.HOST())
    pisitools.dosym("%s/g++" % BINPATH, "/usr/bin/%s-g++" % get.HOST())
    pisitools.dosym("%s/c++" % BINPATH, "/usr/bin/%s-c++" % get.HOST())
    pisitools.dosym("%s/g77" % BINPATH, "/usr/bin/%s-g77" % get.HOST())

    # For some reason, g77 and gcjh gets made instead of ${CTARGET}-g77... this makes it safe
    pisitools.domove("%s/g77" % BINPATH, "%s/" % BINPATH,
                     "%s-g77" % get.HOST())
    pisitools.dosym("%s-g77" % get.HOST(), "%s/g77" % BINPATH)

    # Fix libstdc++ path
    pisitools.dosed(
        "%s/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/libstdc++.la" %
        get.installDIR(), "libdir=libstdc\\+\\+.la",
        "libdir='/usr/lib/gcc/i686-pc-linux-gnu/3.4.6'")
Exemplo n.º 13
0
def install():
    shelltools.cd("%s/source/build/" % get.workDIR())
    autotools.rawInstall("prefix=/usr DESTDIR=%s" % get.installDIR())
            
    # replace upstream texmf.cnf with ours
    pisitools.remove("/usr/share/texmf-dist/web2c/texmf.cnf")     
   
    # remove aleph from fmtutil.cnf
    pisitools.dosed("%s/usr/share/texmf-dist/web2c/fmtutil.cnf" % get.installDIR(), "^.*aleph.*$")
    
    pisitools.insinto("/etc/texmf/texconfig", "%s/usr/share/texmf-dist/texconfig/tcfmgr.map" % get.installDIR(), sym=True)

    # fix symlinks, some are incorrect
    # makefile patching is another way, but there ar/dvipdfmx.cfge lot of scripts
    # pathing each makefile makes it much harder, for now this is a "simpler" solution
    for binary in shelltools.ls(get.installDIR() + "/usr/bin"):
        real_path = shelltools.realPath(get.installDIR() + "/usr/bin/" + binary)
        if "texmf" in real_path and not os.path.exists(real_path): # modify only if it is broken
            base_path = real_path.replace(get.installDIR() + "/usr", "")
            new_path = "/usr/share" + base_path
            shelltools.unlink(get.installDIR() + "/usr/bin/" + binary)
            pisitools.dosym(new_path, "/usr/bin/" + binary)
    
    bibtexextra_scripts=["bibexport", "listbib" ,"multibibliography", "urlbst"]

    core_scripts=["a2ping","a5toa4", "adhocfilelist", "afm2afm", "allcm", "allec", "allneeded", "arara","arlatex"
    ,"autoinst", "bundledoc", "checkcites", "chkweb", "context", "ctanify", "ctanupload", "ctxtools", "de-macro", "deweb"
    ,"dosepsbin", "dtxgen", "dvi2fax", "dviasm", "dvired", "e2pall", "epstopdf", "findhyph", "fmtutil", "fmtutil-sys"
    ,"fontinst", "fragmaster", "installfont-tl", "kpsepath", "kpsetool", "kpsewhere", "kpsexpand", "latex2man", "latexdiff"
    ,"latexdiff-vc", "latexfileversion", "latexmk", "latexpand", "latexrevise", "listings-ext.sh", "ltxfileinfo", "lua2dox_filter"
    ,"luaotfload-tool", "luatools", "match_parens", "mf2pt1", "mkjobtexmf", "mkluatexfontdb", "mkt1font", "mktexfmt", "mptopdf"
    ,"mtxrun", "ot2kpx", "pdf180", "pdf270", "pdf90", "pdfatfi", "pdfbook", "pdfcrop", "pdfflip", "pdfjam", "pdfjam-pocketmod"
    ,"pdfjam-slides3up", "pdfjam-slides6up", "pdfjoin", "pdfnup", "pdfpun", "pfarrei", "pkfix", "pkfix-helper", "ps2eps", "ps2frag"
    ,"pslatex", "pstopdf", "purifyeps", "repstopdf", "rpdfcrop", "rungs", "simpdftex", "sty2dtx", "texconfig", "texconfig-dialog"
    ,"pythontex", "depythontex","ltximg","texfot", "latex-git-log", "latexindent"
    ,"texconfig-sys", "texcount", "texdef", "texdiff", "texdirflatten", "texdoc", "texdoctk", "texexec", "texindy", "texlinks"
    ,"texliveonfly", "texloganalyser", "texmfstart", "thumbpdf", "typeoutfileinfo", "updmap", "updmap-sys", "vpl2ovp", "vpl2vpl", "xindy"]

    htmlxml_scripts=["ht", "htcontext", "htlatex", "htmex", "httex", "httexi", "htxelatex", "htxetex", "mk4ht"]

    langcyrillic_scripts=["rubibtex", "rumakeindex"]

    langcjk_scripts=["convbkmk", "ptex2pdf", "kanji-fontmap-creator", "kanji-config-updmap", "kanji-config-updmap-sys"]

    langextra_scripts=["ebong"]

    langgreek_scripts=["mkgrkindex"]

    latexextra_scripts=["authorindex", "exceltex", "makeglossaries", "pdfannotextractor", "perltex", "ps4pdf", "splitindex" ,"svn-multi", "vpe"]

    music_scripts=["m-tx", "musixtex", "musixflx", "pmx2pdf"]

    pictures_scripts=["cachepic", "epspdf", "epspdftk", "fig4latex", "mathspic"]

    pstricks_scripts=["pedigree", "pst2pdf"]

    science_scripts=["ulqda"]

    # remove unneeded files and symlinks
    dirs = []
    for g in [bibtexextra_scripts, core_scripts, htmlxml_scripts, \
              langcjk_scripts, langcyrillic_scripts, langextra_scripts, \
              langgreek_scripts, latexextra_scripts, music_scripts, \
              pictures_scripts, pstricks_scripts, science_scripts, \
              ["tlmgr"]]:
        for s in g:
            if shelltools.isLink("%s/usr/bin/%s" % (get.installDIR(), s)):
                realpath = shelltools.realPath("%s/usr/bin/%s" % (get.installDIR(), s))
                dirname = shelltools.dirName(realpath)
                if not dirname in dirs: dirs.append(dirname)
                if not dirname == "%s/usr/bin" % get.installDIR():
                    if shelltools.isFile(realpath): shelltools.unlink(realpath)
                pisitools.remove("/usr/bin/%s" % s)
    
    # remove empty dirs
    while dirs:
        tmpdirs = dirs[:]
        for d in tmpdirs:
            if not shelltools.ls(d):
                shelltools.unlinkDir(d)
                dirname = shelltools.dirName(d)
                if not dirname in dirs: dirs.append(dirname)
            dirs.remove(d)

    pdftexsymlinks=["amstex", "cslatex", "csplain", "eplain", "etex", "jadetex", "latex", "mex", "mllatex", "mltex"
          ,"pdfetex", "pdfcslatex", "pdfcsplain", "pdfjadetex", "pdflatex", "pdfmex", "pdfxmltex", "texsis", "utf8mex", "xmltex"]

    for symlink in pdftexsymlinks:
        pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)

    luatexsymlinks=["dvilualatex", "dviluatex", "lualatex"]

    for symlink in luatexsymlinks:
        pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)
        
    pisitools.dosym("eptex", "/usr/bin/platex")
    pisitools.dosym("euptex", "/usr/bin/uplatex")
    pisitools.dosym("xetex", "/usr/bin/xelatex")
    
    #remove conflicts files with texlive-core
    pisitools.remove("/usr/share/texmf-dist/web2c/fmtutil.cnf")
    pisitools.remove("/usr/share/texmf-dist/texconfig/tcfmgr")
    pisitools.remove("/usr/share/texmf-dist/texconfig/tcfmgr.map")
    pisitools.removeDir("/usr/share/texmf-dist/xindy")

    #rm chktexrc in TEXMFCONFIG
    pisitools.remove("/usr/share/texmf-dist/chktex/chktexrc")
        
Exemplo n.º 14
0
def install():
    pisitools.dobin("biber", "/usr/bin")

    pisitools.dodir("/usr/share/tlpkg/TeXLive")
    shelltools.copy("source/utils/biber/TeXLive/*.pm", "%s/usr/share/tlpkg/TeXLive" % get.installDIR())

    shelltools.cd("source/build")
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    bibtexextra_scripts=["bibexport", "listbib" ,"multibibliography", "urlbst"]

    core_scripts=["a2ping","a5toa4", "adhocfilelist", "afm2afm", "allcm", "allec", "allneeded", "arara","arlatex"
    ,"autoinst", "bundledoc", "checkcites", "chkweb", "context", "ctanify", "ctanupload", "ctxtools", "de-macro", "deweb"
    ,"dosepsbin", "dtxgen", "dvi2fax", "dviasm", "dvired", "e2pall", "epstopdf", "findhyph", "fmtutil", "fmtutil-sys"
    ,"fontinst", "fragmaster", "installfont-tl", "kpsepath", "kpsetool", "kpsewhere", "kpsexpand", "latex2man", "latexdiff"
    ,"latexdiff-vc", "latexfileversion", "latexmk", "latexpand", "latexrevise", "listings-ext.sh", "ltxfileinfo", "lua2dox_filter"
    ,"luaotfload-tool", "luatools", "match_parens", "mf2pt1", "mkjobtexmf", "mkluatexfontdb", "mkt1font", "mktexfmt", "mptopdf"
    ,"mtxrun", "ot2kpx", "pdf180", "pdf270", "pdf90", "pdfatfi", "pdfbook", "pdfcrop", "pdfflip", "pdfjam", "pdfjam-pocketmod"
    ,"pdfjam-slides3up", "pdfjam-slides6up", "pdfjoin", "pdfnup", "pdfpun", "pfarrei", "pkfix", "pkfix-helper", "ps2eps", "ps2frag"
    ,"pslatex", "pstopdf", "purifyeps", "repstopdf", "rpdfcrop", "rungs", "simpdftex", "sty2dtx", "texconfig", "texconfig-dialog"
    ,"texconfig-sys", "texcount", "texdef", "texdiff", "texdirflatten", "texdoc", "texdoctk", "texexec", "texindy", "texlinks"
    ,"texliveonfly", "texloganalyser", "texmfstart", "thumbpdf", "typeoutfileinfo", "updmap", "updmap-sys", "vpl2ovp", "vpl2vpl", "xindy"]

    htmlxml_scripts=["ht", "htcontext", "htlatex", "htmex", "httex", "httexi", "htxelatex", "htxetex", "mk4ht"]

    langcyrillic_scripts=["rubibtex", "rumakeindex"]

    langcjk_scripts=["convbkmk", "ptex2pdf", "kanji-fontmap-creator", "kanji-config-updmap", "kanji-config-updmap-sys"]

    langextra_scripts=["ebong"]

    langgreek_scripts=["mkgrkindex"]

    latexextra_scripts=["authorindex", "exceltex", "makeglossaries", "pdfannotextractor", "perltex", "ps4pdf", "splitindex" ,"svn-multi", "vpe"]

    music_scripts=["m-tx", "musixtex", "musixflx", "pmx2pdf"]

    pictures_scripts=["cachepic", "epspdf", "epspdftk", "fig4latex", "mathspic"]

    pstricks_scripts=["pedigree", "pst2pdf"]

    science_scripts=["ulqda"]

    # remove unneeded files and symlinks
    dirs = []
    for g in [bibtexextra_scripts, core_scripts, htmlxml_scripts, \
              langcjk_scripts, langcyrillic_scripts, langextra_scripts, \
              langgreek_scripts, latexextra_scripts, music_scripts, \
              pictures_scripts, pstricks_scripts, science_scripts, \
              ["tlmgr"]]:
        for s in g:
            if shelltools.isLink("%s/usr/bin/%s" % (get.installDIR(), s)):
                realpath = shelltools.realPath("%s/usr/bin/%s" % (get.installDIR(), s))
                dirname = shelltools.dirName(realpath)
                if not dirname in dirs: dirs.append(dirname)
                if not dirname == "%s/usr/bin" % get.installDIR():
                    if shelltools.isFile(realpath): shelltools.unlink(realpath)
                pisitools.remove("/usr/bin/%s" % s)

    # remove empty dirs
    while dirs:
        tmpdirs = dirs[:]
        for d in tmpdirs:
            if not shelltools.ls(d):
                shelltools.unlinkDir(d)
                dirname = shelltools.dirName(d)
                if not dirname in dirs: dirs.append(dirname)
            dirs.remove(d)

    pdftexsymlinks=["amstex", "cslatex", "csplain", "eplain", "etex", "jadetex", "latex", "mex", "mllatex", "mltex"
          ,"pdfetex", "pdfcslatex", "pdfcsplain", "pdfjadetex", "pdflatex", "pdfmex", "pdfxmltex", "texsis", "utf8mex", "xmltex"]

    for symlink in pdftexsymlinks:
        pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)

    luatexsymlinks=["dvilualatex", "dviluatex", "lualatex"]

    for symlink in luatexsymlinks:
        pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)


    pisitools.dosym("eptex", "/usr/bin/platex")
    pisitools.dosym("euptex", "/usr/bin/uplatex")
    pisitools.dosym("xetex", "/usr/bin/xelatex")

    pisitools.removeDir("/usr/share/texmf-dist")