From: Jan Rękorajski Date: Thu, 2 Jan 2020 14:33:27 +0000 (+0900) Subject: - drop java, ruby and php scripts and macros moved to rpm-build-macros X-Git-Tag: auto/th/rpm-4.16.0-0.1~13 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm.git;a=commitdiff_plain;h=49c5d2e - drop java, ruby and php scripts and macros moved to rpm-build-macros --- diff --git a/eclipse-feature.xslt b/eclipse-feature.xslt deleted file mode 100644 index d48df03..0000000 --- a/eclipse-feature.xslt +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - eclipse( - - ) = - - - - - - - eclipse( - - ) = - - - - - - eclipse( - - ) = - - - - - - - - - eclipse( - - - - - - - - ) - - - - = - - - - - >= - - - - - - >= - - - - - - >= - - - - - - - - - - diff --git a/gem_helper.rb b/gem_helper.rb deleted file mode 100755 index 11de3be..0000000 --- a/gem_helper.rb +++ /dev/null @@ -1,197 +0,0 @@ -#!/usr/bin/env ruby -#-- -# Copyright 2010 Per Øyvind Karlsen -# This program is free software. It may be redistributed and/or modified under -# the terms of the LGPL version 2.1 (or later). -#++ - -require 'optparse' -require 'rubygems' - -# Write the .gemspec specification (in Ruby) -def writespec(spec) - file_name = spec.full_name.untaint + '.gemspec' - File.open(file_name, "w") do |file| - file.puts spec.to_ruby_for_cache - end - print "Wrote: %s\n" % file_name -end - -# make gemspec self-contained -if ARGV[0] == "spec-dump" - spec = eval(File.read(ARGV[1])) - writespec(spec) - exit(0) -end - -if ARGV[0] == "build" or ARGV[0] == "install" or ARGV[0] == "spec" - require 'yaml' - require 'zlib' - - filter = nil - opts = nil - keepcache = false - fixperms = false - gemdir = nil - dry_run = false - files = [] - argv = ARGV[1..-1] - # Push this into some environment variables as the modified classes doesn't - # seem to be able to access our global variables.. - ENV['GEM_MODE'] = ARGV[0] - if ARGV[0] == "build" - opts = OptionParser.new("#{$0} <--filter PATTERN>") - opts.on("-f", "--filter PATTERN", "Filter pattern to use for gem files") do |val| - filter = val - end - opts.on("-j", "--jobs JOBS", "Number of jobs to run simultaneously.") do |val| - ENV['jobs'] = "-j"+val - end - opts.on("--dry-run", "Only show the files the gem will include") do - ARGV.delete("--dry-run") - dry_run = true - end - elsif ARGV[0] == "install" - opts = OptionParser.new("#{$0} <--keep-cache>") - opts.on("--keep-cache", "Don't delete gem copy from cache") do - ARGV.delete("--keep-cache") - keepcache = true - end - opts.on("--fix-permissions", "Force standard permissions for files installed") do - ARGV.delete("--fix-permissions") - fixperms = true - end - opts.on("-i", "--install-dir GEMDIR", "Gem repository directory") do |val| - gemdir = val - end - end - while argv.length > 0 - begin - opts.parse!(argv) - rescue OptionParser::InvalidOption => e - e.recover(argv) - end - argv.delete_at(0) - end - - file_data = Zlib::GzipReader.open("metadata.gz") {|io| io.read} - header = YAML::load(file_data) - body = {} - # I don't know any better.. :/ - header.instance_variables.each do |iv| - body[iv.to_s.sub(/^@/,'')] = header.instance_variable_get(iv) - end - - spec = Gem::Specification.from_yaml(YAML.dump(header)) - - if ARGV[0] == "spec" - writespec(spec) - exit(0) - end - - if ARGV[0] == "install" - system("gem %s %s.gem" % [ARGV.join(' '), spec.full_name]) - if !keepcache - require 'fileutils' - FileUtils.rm_rf("%s/cache" % gemdir) - end - if fixperms - chmod = "chmod u+r,u+w,g-w,g+r,o+r -R %s" % gemdir - print "\nFixing permissions:\n\n%s\n" % chmod - system("%s" % chmod) - print "\n" - end - end - - if body['extensions'].size > 0 - require 'rubygems/ext' - module Gem::Ext - class Builder - def self.make(dest_path, results) - make_program = ENV['make'] - unless make_program then - make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make' - end - cmd = make_program - if ENV['GEM_MODE'] == "build" - cmd += " %s" % ENV['jobs'] - elsif ENV['GEM_MODE'] == "install" - cmd += " DESTDIR='%s' install" % ENV['DESTDIR'] - end - results << cmd - results << `#{cmd} #{redirector}` - - raise Gem::ExtensionBuildError, "make failed:\n\n#{results}" unless - $?.success? - end - end - end - - require 'rubygems/installer' - module Gem - class Installer - def initialize(spec, options={}) - @gem_dir = Dir.pwd - @spec = spec - end - end - class ConfigFile - def really_verbose - true - end - end - end - - unless dry_run - Gem::Installer.new(spec).build_extensions - else - for ext in body['extensions'] - files.push(ext[0..ext.rindex("/")-1]+".so") - end - end - - body['extensions'].clear() - end - if ARGV[0] == "build" - body['test_files'].clear() - - # We don't want ext/ in require_paths, it will only contain content for - # building extensions which needs to be installed in sitearchdir anyways.. - idx = 0 - for i in 0..body['require_paths'].size()-1 - if body['require_paths'][idx].match("^ext(/|$)") - body['require_paths'].delete_at(idx) - else - idx += 1 - end - end - - # We'll get rid of all the files we don't really need to install - idx = 0 - for i in 0..body['files'].size()-1 - if filter and body['files'][idx].match(filter) - match = true - else - match = false - for path in body['require_paths'] - if body['files'][idx].match("^%s/" % path) - match = true - end - end - end - if !match - body['files'].delete_at(idx) - else - idx += 1 - end - end - - spec = Gem::Specification.from_yaml(YAML.dump(header)) - unless dry_run - Gem::Builder.new(spec).build - else - files.concat(spec.files) - print "%s\n" % files.join("\n") - end - end -end diff --git a/rpm-java-requires b/rpm-java-requires deleted file mode 100755 index 8bbac6f..0000000 --- a/rpm-java-requires +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/sh -# This script reads filenames from STDIN and outputs any relevant requires -# information that needs to be included in the package. -# -# Based on rpm-4.4.2/scripts/find-req.pl -# Authors: Elan Ruusamäe - -export PATH="/sbin:/usr/sbin:/bin:/usr/bin" - -# Set the prefix, unless it is overriden -: ${RPM_LIBDIR=/usr/lib/rpm} - -# Enable debug: JAVADEPS_DEBUG=true -: ${JAVADEPS_DEBUG=false} - -# xsltproc for eclipse feature.xml -: ${xsltproc=/usr/bin/xsltproc} - -# "%define java_min_classdataversion 51.0" in spec to minimum version to be 51.0 -: ${MIN_CLASSDATAVERSION=} - -# save $- state, to enable in functions -debug=$- - -javaclassversionfilter() { - if [ "$MIN_CLASSDATAVERSION" ]; then - set -- $* "$MIN_CLASSDATAVERSION" - fi - - local v - for v in $*; do - echo "java(ClassDataVersion) >= $v" - done | sort -V | tail -n 1 -} - -javaclassversion() { - set -$debug - local mode=$1; shift - [ $# -gt 0 ] || return 1 - $JAVADEPS_DEBUG && echo >&2 ">> javaclassversion($mode): $*" - - # process only requires - [ "$mode" = requires ] || return $ret - - local classver=$(echo "$@" | xargs -r file | grep -o 'compiled Java class data, version [0-9.]*' | awk '{print $NF}' | sort -u) - if [ -z "$classver" ]; then - return 1 - fi - - javaclassversionfilter $classver - return 0 -} - -javajarversion() { - set -$debug - local mode=$1; shift - local jar=$1 - local tmp ret=0 - $JAVADEPS_DEBUG && echo >&2 ">> javajarversion($mode): $jar" - - # check only files, symlinks could point outside buildroot - [ -f "$jar" -a ! -L "$jar" ] || return $ret - - tmp=$(mktemp -d) - unzip -q -d $tmp $jar >&2 - # workaround for .jar files with stupid permissions - chmod -R u+rwX $tmp - - # find .jar and .class files - find_javadeps $mode $(find $tmp -type f -regextype posix-extended -regex '^.+\.(class|jar)$') || ret=1 - rm -rf $tmp - return $ret -} - -eclipse_feature() { - set -$debug - local mode=$1; shift - local file=$1 - local ret=0 - - $JAVADEPS_DEBUG && echo >&2 ">> eclipse_feature($mode): $file" - - if [ ! -x $xsltproc ]; then - return 0 - fi - - $xsltproc --stringparam mode $mode ${RPM_LIBDIR}/eclipse-feature.xslt $file -} - -find_javadeps() { - set -$debug - local mode=$1; shift - local ret=0 - - $JAVADEPS_DEBUG && echo >&2 ">> find_javadeps($mode): $*" - for file in $@; do - case $file in - *.jar) - javajarversion $mode "$file" || ret=1 - ;; - *.class) - javaclassversion $mode "$file" || { - echo >&2 "ERROR: Class version could not be extracted from $file" - ret=1 - } - ;; - */feature.xml) - eclipse_feature $mode "$file" || ret=1 - ;; - *) - $JAVADEPS_DEBUG && echo >&2 ">> find_javadeps($mode): no handle: $file" - ;; - esac - done - return $ret -} - -ret=0 -# default mode to requires for backward compat -mode=requires -case $1 in --P|--provides) - mode=provides - shift - ;; --R|--requires) - mode=requires - shift - ;; -esac - -t=$(mktemp) -find_javadeps $mode $(cat -) > $t || ret=1 -sort -u $t -rm -f $t - -exit $ret diff --git a/rpm-javadeps.patch b/rpm-javadeps.patch deleted file mode 100644 index 8d87e4a..0000000 --- a/rpm-javadeps.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- rpm-4.15.1/fileattrs/Makefile.am~ 2019-06-26 23:17:31.000000000 +0900 -+++ rpm-4.15.1/fileattrs/Makefile.am 2019-12-29 00:23:02.120085588 +0900 -@@ -8,6 +8,6 @@ - fattrs_DATA = \ - debuginfo.attr desktop.attr elf.attr font.attr libtool.attr metainfo.attr \ - perl.attr perllib.attr pkgconfig.attr python.attr pythondist.attr ocaml.attr \ -- script.attr php.attr -+ script.attr php.attr java.attr - - EXTRA_DIST = $(fattrs_DATA) ---- /dev/null 2019-12-23 19:28:16.334291624 +0900 -+++ rpm-4.15.1/fileattrs/java.attr 2019-12-29 00:22:52.989864428 +0900 -@@ -0,0 +1,3 @@ -+%__java_requires env RPM_BUILD_ROOT=%{buildroot} MIN_CLASSDATAVERSION=%{?java_min_classdataversion} %{_rpmconfigdir}/java-find-requires -+%__java_magic ^Java .* -+%__java_path \\.(jar|class)$ diff --git a/rpm-php-macros.patch b/rpm-php-macros.patch deleted file mode 100644 index ff3c349..0000000 --- a/rpm-php-macros.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- rpm-5.3.1/configure.ac.wiget 2010-05-30 16:43:06.000000000 +0200 -+++ rpm-5.3.1/configure.ac 2010-05-30 16:43:38.482725491 +0200 -@@ -2199,6 +2199,7 @@ AC_CONFIG_FILES([ po/Makefile.in - AC_CONFIG_FILES([Makefile - rpmio/Makefile lib/Makefile build/Makefile sign/Makefile - po/Makefile.in scripts/Makefile scripts/perl.req scripts/perl.prov fileattrs/Makefile -+ scripts/php.req scripts/php.prov - misc/Makefile - doc/Makefile - python/Makefile ---- rpm-4.15.1/fileattrs/Makefile.am~ 2019-06-26 23:17:31.000000000 +0900 -+++ rpm-4.15.1/fileattrs/Makefile.am 2019-12-29 00:23:02.120085588 +0900 -@@ -8,6 +8,6 @@ - fattrs_DATA = \ - debuginfo.attr desktop.attr elf.attr font.attr libtool.attr metainfo.attr \ - perl.attr perllib.attr pkgconfig.attr python.attr pythondist.attr ocaml.attr \ -- script.attr -+ script.attr php.attr - - EXTRA_DIST = $(fattrs_DATA) ---- /dev/null 2019-12-23 19:28:16.334291624 +0900 -+++ rpm-4.15.1/fileattrs/php.attr 2019-12-29 00:22:52.989864428 +0900 -@@ -0,0 +1,6 @@ -+%__php_provides %{_rpmconfigdir}/php.prov -+# define 'php_req_new' in ~/.rpmmacros to use php version of req finder -+%__php_requires env PHP_MIN_VERSION=%{?php_min_version} %{_rpmconfigdir}/php.req%{?php_req_new:.php} -+%__php_magic ^PHP script.* -+%__php_path \\.php$ -+%__php_flags magic_and_path diff --git a/rpm-php-provides b/rpm-php-provides deleted file mode 100644 index a094cba..0000000 --- a/rpm-php-provides +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/perl -##################################################################### -# # -# Check system dependences between php-pear modules # -# # -# Pawe³ Go³aszewski # -# Micha³ Moskal # -# ------------------------------------------------------------------# -# TODO: # -##################################################################### - -$pear = "/usr/share/pear"; - -foreach (@ARGV ? @ARGV : <>) { - chomp; - $f = $_; - next unless ($f =~ /$pear.*\.php$/); - $f =~ s/.*$pear\///; - print "pear($f)\n"; -} diff --git a/rpm-php-requires b/rpm-php-requires deleted file mode 100644 index 2a3fb60..0000000 --- a/rpm-php-requires +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/perl -##################################################################### -# # -# Check system dependences between php-pear modules # -# # -# Pawe³ Go³aszewski # -# Micha³ Moskal # -# ------------------------------------------------------------------# -# TODO: # -# - extension_loaded - dependencies. # -# - some clean-up... # -##################################################################### - -$pear = "/usr/share/pear"; - -@files = (); -%req = (); - -foreach (@ARGV ? $ARGV : <> ) { - chomp; - $f = $_; - push @files, $f; - # skip non-php files - next unless ($f =~ /\.php$/); - open(F, "< $f") or die; - - if ($f =~ /$pear/) { - $file_dir = $f; - $file_dir =~ s|.*$pear/||; - $file_dir =~ s|/[^/]*$||; - } else { - $file_dir = undef; - } - - while () { - # skip comments - next if (/^\s*(#|\/\/|\*|\/\*)/); - - while (/(\W|^)(require|include)(_once)? - \s* \(? \s* ("([^"]*)"|'([^']*)') - \s* \)? \s* ;/xg) { - if ($5 ne "") { - $x = $5; - } elsif ($6 ne "") { - $x = $6; - } else { - next; - } - - next if ($x =~ m|^\./| or $x =~ /\$/); - next unless ($x =~ /\.php$/); - $req{$x} = 1; - } - - next unless (defined $file_dir); - - while (/(\W|^)(require|include)(_once)? - \s* \(? \s* dirname \s* \( \s* __FILE__ \s* \) \s* \. \s* - ("([^"]*)"|'([^']*)') - \s* \)? \s* ;/xg) { - if ($5 ne "") { - $x = $5; - } elsif ($6 ne "") { - $x = $6; - } else { - next; - } - - next if ($x =~ /\$/); - next unless ($x =~ /\.php$/); - - $x = "$file_dir/$x"; - $x =~ s|/+|/|g; - $req{$x} = 1; - } - } -} - -f: for $f (keys %req) { - for $g (@files) { next f if ($g =~ /\Q$f\E$/); } - print "pear($f)\n"; -} diff --git a/rpm-php-requires.php b/rpm-php-requires.php deleted file mode 100644 index b398029..0000000 --- a/rpm-php-requires.php +++ /dev/null @@ -1,174 +0,0 @@ -#!/usr/bin/php - (Perl version) - * Michał Moskal (Perl version) - * Elan Ruusamäe - * - * URL: - * - * Requires: php-pear-PHP_CompatInfo - * Requires: php-pcre - */ - -/** - * Produce pear(Path/To/File.php) deps - * Ported to PHP from Perl version of rpm-php-requires. - * - * @TODO: use tokenizer to parse php files. - */ -function peardeps($files) { - // files inside php_pear_dir have this prefix - $prefix = RPM_BUILD_ROOT. PHP_PEAR_DIR . DIRECTORY_SEPARATOR; - $length = strlen($prefix); - - $req = array(); - foreach ($files as $f) { - // skip non-php files - if (substr($f, -4) != '.php') { - continue; - } - - // subdir inside php_pear_dir - if (substr($f, 0, $length) == $prefix) { - $file_dir = dirname(substr($f, $length)); - } else { - $file_dir = null; - } - - foreach (file($f) as $line) { - // skip comments -- not perfect, matches "*" at start of line (very rare altho) - if (preg_match('/^\s*(#|\/\/|\*|\/\*)/', $line)) { - continue; - } - - if (preg_match("/(\W|^)(require|include)(_once)? - \s* \(? \s* - (\"([^\"]*)\"|'([^']*)') - \s* \)? \s* ;/x", $line, $m)) { - - if ($m[5]) { - $x = $m[5]; - } else if ($m[6]) { - $x = $m[6]; - } else { - continue 2; - } - - if (substr($x, 0, 2) == './' || substr($x, -1) == '$') { # XXX must be: CONTAINS DOLLAR - continue 2; - } - - if (substr($x, -4) != '.php') { - continue 2; - } - $req[$x] = 1; - continue 2; - } - - if (is_null($file_dir)) { - continue; - } - - if (preg_match("/(\W|^)(require|include)(_once)? - \s* \(? \s* dirname \s* \( \s* __FILE__ \s* \) \s* \. \s* - (\"([^\"]*)\"|'([^']*)') - \s* \)? \s* ;/x", $line, $m)) { - - if ($m[5]) { - $x = $m[5]; - } else if ($m[6]) { - $x = $m[6]; - } else { - continue 2; - } - - if (substr($x, -1) == '$') { # XXX must be: CONTAINS DOLLAR - continue 2; - } - if (substr($x, -4) != '.php') { - continue 2; - } - - $x = "$file_dir/$x"; - // remove double slashes - // TODO: resolve simpletest/test/../socket.php -> simpletest/socket.php - $x = str_replace("//", "/", $x); - $req[$x] = 1; - continue; - } - } - } - - foreach (array_keys($req) as $f) { - // skip self deps - if (array_key_exists($f, $files)) { - continue; - } - echo "pear($f)\n"; - } -} - -/** - * Produce dependencies for extensions using PEAR PHP_CompatInfo package. - */ -function extdeps($files) { - require_once 'PHP/CompatInfo.php'; - - $info = new PHP_CompatInfo('null'); - $res = $info->parseData($files); - - // minimum php version we accept - // "%define php_min_version 5.1.2" in spec to minimum version to be 5.1.2 - $version = max(PHP_MIN_VERSION, $res['version']); - - if (version_compare($version, '5.0.0', 'ge')) { - # force php- only deps when php5 - # XXX what about php-pecl- virtual provides? - $fmt = 'php-%s'; - $epoch = 4; - } else { - $fmt = 'php(%s)'; - $epoch = 3; - } - echo "php-common >= ", $epoch, ":", $version, "\n"; - - // process extensions - foreach ($res['extensions'] as $ext) { - // bz2 ext is in php-bzip2 package - if ($ext == 'bz2') { - $ext = 'bzip2'; - } - // libxml ext is in php-xml package - if ($ext == 'libxml') { - $ext = 'xml'; - } - - // these need to be lowercased - if (in_array($ext, array('SPL', 'PDO', 'SQLite', 'Reflection', 'SimpleXML'))) { - $ext = strtolower($ext); - } - - printf("$fmt\n", $ext); - } -} - -define('RPM_BUILD_ROOT', getenv('RPM_BUILD_ROOT')); -define('PHP_PEAR_DIR', '/usr/share/pear'); -define('PHP_MIN_VERSION', getenv('PHP_MIN_VERSION')); - -if ($argc > 1) { - $files = array_splice($argv, 1); -} else { - $files = explode(PHP_EOL, trim(file_get_contents('php://stdin'))); -} - -peardeps($files); -extdeps($files); diff --git a/rpm.spec b/rpm.spec index d20a55d..4781f0b 100644 --- a/rpm.spec +++ b/rpm.spec @@ -47,13 +47,10 @@ Source4: %{name}-find-spec-bcond Source5: %{name}-hrmib-cache Source6: %{name}-groups-po.awk Source7: %{name}-compress-doc -Source8: %{name}-php-provides -Source9: %{name}-php-requires Source10: %{name}.sysinfo Source11: perl.prov Source12: %{name}-user_group.sh Source13: %{name}.sysconfig -Source14: %{name}-java-requires # http://svn.pld-linux.org/banner.sh/ Source15: banner.sh Source16: ftp://ftp.pld-linux.org/dists/th/PLD-3.0-Th-GPG-key.asc @@ -65,24 +62,19 @@ Source20: %{name}.noautoprov Source21: %{name}.noautoprovfiles Source22: %{name}.noautoreq Source24: %{name}.noautoreqfiles -Source25: %{name}-php-requires.php Source26: %{name}db_checkversion.c Source27: macros.lang Source28: %{name}db_reset.c Source29: dbupgrade.sh -Source30: rubygems.rb -Source31: gem_helper.rb Source32: rpmrc.pld Patch0: %{name}-man_pl.patch Patch1: %{name}-popt-aliases.patch Patch2: %{name}-perl-macros.patch Patch3: %{name}-perl-req-perlfile.patch Patch4: %{name}-scripts-closefds.patch -Patch5: %{name}-php-macros.patch Patch6: %{name}-lua.patch Patch7: %{name}-perl_req-INC_dirs.patch Patch8: %{name}-debuginfo.patch -Patch9: %{name}-javadeps.patch Patch10: %{name}-libtool-deps.patch Patch11: %{name}-builddir-readlink.patch Patch12: %{name}-changelog_order_check_nonfatal.patch @@ -413,24 +405,6 @@ construir pacotes usando o RPM. Різноманітні допоміжні скрипти та утиліти, які використовуються для побудови RPM'ів. -%package javaprov -Summary: Additional utilities for checking Java provides/requires in RPM packages -Summary(pl.UTF-8): Dodatkowe narzędzia do sprawdzania zależności kodu w Javie w pakietach RPM -Group: Applications/File -Requires: %{name} = %{epoch}:%{version}-%{release} -Requires: file -Requires: findutils >= 1:4.2.26 -Requires: mktemp -Requires: unzip - -%description javaprov -Additional utilities for checking Java provides/requires in RPM -packages. - -%description javaprov -l pl.UTF-8 -Dodatkowe narzędzia do sprawdzania zależności kodu w Javie w pakietach -RPM. - %package perlprov Summary: Additional utilities for checking Perl provides/requires in RPM packages Summary(de.UTF-8): Zusatzwerkzeuge fürs Nachsehen Perl-Abhängigkeiten in RPM-Paketen @@ -469,39 +443,6 @@ software. Makra ułatwiające tworzenie pakietów RPM z programami napisanymi w Pythonie. -%package php-pearprov -Summary: Additional utilities for checking PHP PEAR provides/requires in RPM packages -Summary(pl.UTF-8): Dodatkowe narzędzia do sprawdzania zależności skryptów php w RPM -Group: Applications/File -Requires: %{name} = %{epoch}:%{version}-%{release} -Requires: sed >= 4.0 -Suggests: php-pear-PHP_CompatInfo - -%description php-pearprov -Additional utilities for checking PHP PEAR provides/requires in RPM -packages. - -%description php-pearprov -l pl.UTF-8 -Dodatkowe narzędzia do sprawdzenia zależności skryptów PHP PEAR w -pakietach RPM. - -%package rubyprov -Summary: Ruby tools, which simplify creation of RPM packages with Ruby software -Summary(pl.UTF-8): Makra ułatwiające tworzenie pakietów RPM z programami napisanymi w Ruby -Group: Applications/File -Requires: %{name} = %{epoch}:%{version}-%{release} -Requires: ruby -Requires: ruby-modules -Requires: ruby-rubygems - -%description rubyprov -Ruby tools, which simplifies creation of RPM packages with Ruby -software. - -%description rubyprov -l pl.UTF-8 -Makra ułatwiające tworzenie pakietów RPM z programami napisanymi w -Ruby. - %package -n python-rpm Summary: Python interface to RPM library Summary(pl.UTF-8): Pythonowy interfejs do biblioteki RPM-a @@ -647,11 +588,9 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 %patch6 -p1 %patch7 -p0 %patch8 -p1 -%patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 @@ -664,11 +603,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze %patch20 -p1 %patch21 -p1 -install %{SOURCE8} scripts/php.prov.in -install %{SOURCE9} scripts/php.req.in install %{SOURCE11} scripts/perl.prov.in -cp -p %{SOURCE30} scripts/rubygems.rb -cp -p %{SOURCE31} scripts/gem_helper.rb %{__mv} -f scripts/perl.req{,.in} @@ -809,9 +744,6 @@ cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_rpmlibdir}/install-build-tree cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_rpmlibdir}/find-spec-bcond cp -p %{SOURCE7} $RPM_BUILD_ROOT%{_rpmlibdir}/compress-doc cp -p %{SOURCE12} $RPM_BUILD_ROOT%{_rpmlibdir}/user_group.sh -cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_rpmlibdir}/java-find-requires -cp -p scripts/php.{prov,req} $RPM_BUILD_ROOT%{_rpmlibdir} -cp -p %{SOURCE25} $RPM_BUILD_ROOT%{_rpmlibdir}/php.req.php cp -p %{SOURCE17} $RPM_BUILD_ROOT%{_rpmlibdir}/mimetypedeps.sh cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_rpmlibdir}/hrmib-cache cp -p %{SOURCE13} $RPM_BUILD_ROOT/etc/sysconfig/rpm @@ -1069,14 +1001,11 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f # must be here for "Requires: rpm-*prov" to work #%{_rpmlibdir}/macros.d/cmake #%{_rpmlibdir}/macros.d/gstreamer -#%{_rpmlibdir}/macros.d/java #%{_rpmlibdir}/macros.d/libtool #%{_rpmlibdir}/macros.d/mono #%{_rpmlibdir}/macros.d/perl -#%{_rpmlibdir}/macros.d/php #%{_rpmlibdir}/macros.d/pkgconfig #%{_rpmlibdir}/macros.d/python -#%{_rpmlibdir}/macros.d/ruby #%{_rpmlibdir}/macros.d/selinux #%{_rpmlibdir}/macros.d/tcl #%{_rpmlibdir}/macros.rpmbuild @@ -1103,13 +1032,11 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f %{_rpmlibdir}/fileattrs/desktop.attr %{_rpmlibdir}/fileattrs/elf.attr %{_rpmlibdir}/fileattrs/font.attr -%{_rpmlibdir}/fileattrs/java.attr %{_rpmlibdir}/fileattrs/libtool.attr %{_rpmlibdir}/fileattrs/metainfo.attr %{_rpmlibdir}/fileattrs/ocaml.attr %{_rpmlibdir}/fileattrs/perl.attr %{_rpmlibdir}/fileattrs/perllib.attr -%{_rpmlibdir}/fileattrs/php.attr %{_rpmlibdir}/fileattrs/pkgconfig.attr %{_rpmlibdir}/fileattrs/python.attr %{_rpmlibdir}/fileattrs/pythondist.attr @@ -1126,17 +1053,6 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f %lang(pl) %{_mandir}/pl/man8/rpmbuild.8* %{_mandir}/man8/rpmspec.8* -%files javaprov -%defattr(644,root,root,755) -%attr(755,root,root) %{_rpmlibdir}/java-find-requires -# needs jar (any jdk), jcf-dump (gcc-java) to work -#%attr(755,root,root) %{_rpmlibdir}/javadeps.sh - -%files rubyprov -%defattr(644,root,root,755) -#%attr(755,root,root) %{_rpmlibdir}/gem_helper.rb -#%attr(755,root,root) %{_rpmlibdir}/rubygems.rb - %files perlprov %defattr(644,root,root,755) %attr(755,root,root) %{_rpmlibdir}/perl.* @@ -1146,12 +1062,6 @@ find %{_rpmlibdir} -name '*-linux' -type l | xargs rm -f %attr(755,root,root) %{_rpmlibdir}/pythondeps.sh %attr(755,root,root) %{_rpmlibdir}/pythondistdeps.py -%files php-pearprov -%defattr(644,root,root,755) -%attr(755,root,root) %{_rpmlibdir}/php.prov -%attr(755,root,root) %{_rpmlibdir}/php.req -%attr(755,root,root) %{_rpmlibdir}/php.req.php - %if %{with python2} %files -n python-rpm %defattr(644,root,root,755) diff --git a/rubygems.rb b/rubygems.rb deleted file mode 100755 index a3f63aa..0000000 --- a/rubygems.rb +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env ruby -#-- -# Copyright 2010 Per Øyvind Karlsen -# This program is free software. It may be redistributed and/or modified under -# the terms of the LGPL version 2.1 (or later). -# -# FIXME: Someone with actual ruby skills should really clean up and sanitize -# this! fugliness obvious... -#++ - -require 'optparse' -require 'rbconfig' - -provides = false -requires = false - -opts = OptionParser.new("#{$0} <--provides|--requires>") -opts.on("-P", "--provides", "Print provides") do |val| - provides = true -end -opts.on("-R", "--requires", "Print requires") do |val| - requires= true -end - -rest = opts.permute(ARGV) - -if rest.size != 0 or (!provides and !requires) or (provides and requires) - $stderr.puts "Use either --provides OR --requires" - $stderr.puts opts - exit(1) -end - -require 'rubygems' -gem_dir = Gem.respond_to?(:default_dirs) ? Gem.default_dirs[:system][:gem_dir] : Gem.path.first -specpatt = "#{gem_dir}/specifications/.*\.gemspec$" -gems = [] -ruby_versioned = false -abi_provide = false -# as ruby_version may be empty, take version from basename of archdir -ruby_version = RbConfig::CONFIG["ruby_version"].empty? ? File.basename(RbConfig::CONFIG["archdir"]) : RbConfig::CONFIG["ruby_version"] - -for path in $stdin.readlines - # way fugly, but we make the assumption that if the package has - # this file, the package is the current ruby version, and should - # therefore provide ruby(abi) = version - if provides and path.match(RbConfig::CONFIG["archdir"] + "/rbconfig.rb") - abi_provide = true - ruby_versioned = true - elsif path.match(specpatt) - gems.push(path.chomp) - # this is quite ugly and lame, but the assumption made is that if any files - # found in any of these directories specific to this ruby version, the - # package is dependent on this specific version. - # FIXME: only supports current ruby version - elsif not ruby_versioned - if path.match(RbConfig::CONFIG["rubylibdir"]) - ruby_versioned = true - elsif path.match(RbConfig::CONFIG["archdir"]) - ruby_versioned = true - elsif path.match(RbConfig::CONFIG["sitelibdir"]) - ruby_versioned = !RbConfig::CONFIG["ruby_version"].empty? - elsif path.match(RbConfig::CONFIG["sitearchdir"]) - ruby_versioned = true - elsif path.match(RbConfig::CONFIG["vendorlibdir"]) - ruby_versioned = !RbConfig::CONFIG["ruby_version"].empty? - elsif path.match(RbConfig::CONFIG["vendorarchdir"]) - ruby_versioned = true - end - end -end - -if requires or abi_provide - abidep = "ruby(abi)" - if ruby_versioned - abidep += " = %s" % ruby_version - end - print abidep + "\n" -end - -if gems.length > 0 - require 'rubygems' - - if requires - - module Gem - class Requirement - def rpm_dependency_transform(name, version) - pessimistic = "" - if version == "> 0.0.0" or version == ">= 0" - version = "" - else - if version[0..1] == "~>" - pessimistic = "rubygem(%s) < %s\n" % [name, Gem::Version.create(version[3..-1]).bump] - version = version.gsub(/\~>/, '=>') - end - if version[0..1] == "!=" - version = version.gsub(/\!=/, '>') - end - version = version.sub(/^/, ' ') - end - version = "rubygem(%s)%s\n%s" % [name, version, pessimistic] - end - - def to_rpm(name) - result = as_list - return result.map { |version| rpm_dependency_transform(name, version) } - end - - end - end - end - - for gem in gems - data = File.read(gem) - spec = eval(data) - if provides - print "rubygem(%s) = %s\n" % [spec.name, spec.version] - end - if requires - for d in spec.dependencies - print d.requirement.to_rpm(d.name)[0] unless d.type != :runtime - end - for d in spec.required_rubygems_version.to_rpm("rubygems") - print d.gsub(/(rubygem\()|(\))/, "") - end - end - end -end