Ejemplo n.º 1
0
def write_cpan_pattern(file):
    global subdir
    write_prep(file)
    file.write_strip("%build")
    file.write_strip("if test -f Makefile.PL; then")
    file.write_strip("%{__perl} Makefile.PL")
    file.write_strip("make V=1 " + config.parallel_build + extra_make)
    file.write_strip("else")
    file.write_strip("%{__perl} Build.PL")
    file.write_strip("./Build")
    file.write_strip("fi")
    file.write_strip("\n")
    write_check(file)
    file.write_strip("%install")
    file.write_strip("rm -rf %{buildroot}")
    file.write_strip("if test -f Makefile.PL; then")
    file.write_strip("make pure_install PERL_INSTALL_ROOT=%{buildroot}")
    file.write_strip("else")
    file.write_strip("./Build install --installdirs=site --destdir=%{buildroot}")
    file.write_strip("fi")
    file.write_strip("find %{buildroot} -type f -name .packlist -exec rm -f {} ';'")
    file.write_strip("find %{buildroot} -depth -type d -exec rmdir {} 2>/dev/null ';'")
    file.write_strip("find %{buildroot} -type f -name '*.bs' -empty -exec rm -f {} ';'")
    file.write_strip("%{_fixperms} %{buildroot}/*")
    lang.write_find_lang(file)
Ejemplo n.º 2
0
def write_ruby_pattern(file):
    write_prep(file, ruby_pattern=True)
    file.write_strip("%build")
    file.write_strip("gem build " + tarball.name + ".gemspec")
    file.write_strip("\n")

    file.write_strip("%install")
    file.write_strip("%global gem_dir $(ruby -e'puts Gem.default_dir')")
    file.write_strip("gem install -V \\")
    file.write_strip("  --local \\")
    file.write_strip("  --force \\")
    file.write_strip("  --install-dir .%{gem_dir} \\")
    file.write_strip("  --bindir .%{_bindir} \\")
    file.write_strip(" " + tarball.tarball_prefix + ".gem")
    file.write_strip("\n")

    file.write_strip("mkdir -p %{buildroot}%{gem_dir}")
    file.write_strip("cp -pa .%{gem_dir}/* \\")
    file.write_strip("        %{buildroot}%{gem_dir}")
    file.write_strip("\n")

    file.write_strip("if [ -d .%{_bindir} ]; then")
    file.write_strip("    mkdir -p %{buildroot}%{_bindir}")
    file.write_strip("    cp -pa .%{_bindir}/* \\")
    file.write_strip("        %{buildroot}%{_bindir}/")
    file.write_strip("fi")
    file.write_strip("\n")
    lang.write_find_lang(file)
    write_check(file)
Ejemplo n.º 3
0
def write_make_install(file):
    global need_avx2_flags
    file.write_strip("%install")
    file.write_strip("rm -rf %{buildroot}")
        
    if config.config_opts['32bit']:
        file.write_strip("pushd ../build32/"+subdir)
        file.write_strip("%make_install32 " + extra_make_install)
        file.write_strip("if [ -d  %{buildroot}/usr/lib32/pkgconfig ]")
        file.write_strip("then")
        file.write_strip("    pushd %{buildroot}/usr/lib32/pkgconfig")
        file.write_strip("    for i in *.pc ; do ln -s $i 32$i ; done")
        file.write_strip("    popd");
        file.write_strip("fi")
        file.write_strip("popd")

    if subdir:
        file.write_strip("pushd %s" % subdir)
        
    file.write_strip("%s %s\n" % (install_macro, extra_make_install))

    if config.config_opts['use_avx2']:
        need_avx2_flags = True
        write_variables(file)
        need_avx2_flags = False
        file.write_strip("make clean")
        file.write_strip("%configure " + disable_static + " " + config.extra_configure + " --libdir=/usr/lib64/avx2")
        file.write_strip("make V=1 " + config.parallel_build + extra_make)
        file.write_strip("make DESTDIR=%{buildroot} install-libLTLIBRARIES")
        file.write_strip("rm -f %{buildroot}/usr/lib64/avx2/*.la")
        file.write_strip("rm -f %{buildroot}/usr/lib64/avx2/*.lo")

    if subdir:
        file.write_strip("popd")
    lang.write_find_lang(file)
Ejemplo n.º 4
0
def write_make_install(file):
    file.write_strip("%install")
    file.write_strip("rm -rf %{buildroot}")
    if subdir:
        file.write_strip("pushd %s" % subdir)
    file.write_strip("%s %s\n" % (install_macro, extra_make_install))
    if subdir:
        file.write_strip("popd")
    lang.write_find_lang(file)
Ejemplo n.º 5
0
def write_distutils_pattern(file):
    write_prep(file)
    file.write_strip("%build")
    write_variables(file)
    file.write_strip("python2 setup.py build -b py2 " + config.extra_configure)
    file.write_strip("\n")
    if test.tests_config:
        file.write_strip("%check")
        # Prevent setuptools from hitting the internet
        file.write_strip("export http_proxy=http://127.0.0.1:9/")
        file.write_strip("export https_proxy=http://127.0.0.1:9/")
        file.write_strip("export no_proxy=localhost,127.0.0.1,0.0.0.0")
        file.write_strip(test.tests_config)
    file.write_strip("%install")
    file.write_strip("rm -rf %{buildroot}")
    file.write_strip("python2 -tt setup.py build -b py2 install --root=%{buildroot}")
    lang.write_find_lang(file)
Ejemplo n.º 6
0
def write_R_pattern(file):
    write_prep(file)
    file.write_strip("%build")
    file.write_strip("\n")

    file.write_strip("%install")
    file.write_strip("rm -rf %{buildroot}")
    file.write_strip("export LANG=C")
    file.write_strip("export CFLAGS=\"$CFLAGS -O3 -flto -ffunction-sections -fno-semantic-interposition \"\n")
    file.write_strip("export CXXFLAGS=\"$CXXFLAGS -O3 -flto -ffunction-sections -fno-semantic-interposition \"\n")
    file.write_strip("export AR=gcc-ar\n")
    file.write_strip("export RANLIB=gcc-ranlib\n")
    file.write_strip("export LDFLAGS=\"$LDFLAGS  -Wl,-z -Wl,relro\"\n")

    file.write_strip("mkdir -p %{buildroot}/usr/lib64/R/library")
    file.write_strip("R CMD INSTALL --install-tests --build  -l %{buildroot}/usr/lib64/R/library " + tarball.rawname)
    file.write_strip("%{__rm} -rf %{buildroot}%{_datadir}/R/library/R.css")
    lang.write_find_lang(file)
    write_check(file)
Ejemplo n.º 7
0
def write_distutils3_pattern(file):
    write_prep(file)
    file.write_strip("%build")
    file.write_strip("export LANG=C")
    if config.config_opts['asneeded']:
        file.write_strip("unset LD_AS_NEEDED\n")
    write_variables(file)
    file.write_strip("python3 setup.py build -b py3 " + config.extra_configure)
    file.write_strip("\n")
    if test.tests_config and not config.config_opts['skip_tests']:
        file.write_strip("%check")
        # Prevent setuptools from hitting the internet
        file.write_strip("export http_proxy=http://127.0.0.1:9/")
        file.write_strip("export https_proxy=http://127.0.0.1:9/")
        file.write_strip("export no_proxy=localhost,127.0.0.1,0.0.0.0")
        file.write_strip(test.tests_config)
    file.write_strip("%install")
    file.write_strip("rm -rf %{buildroot}")
    file.write_strip("python3 -tt setup.py build -b py3 install --root=%{buildroot}")
    lang.write_find_lang(file)