From: Marcin Krol Date: Fri, 23 Feb 2018 20:46:32 +0000 (+0000) Subject: - really backported rubyprov stuff X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=5220c38990dbb6385095a593e8b625ca804cf1ae;p=packages%2Frpm.git - really backported rubyprov stuff --- diff --git a/rpm-rubyprov.patch b/rpm-rubyprov.patch index 15a867e..9c036ad 100644 --- a/rpm-rubyprov.patch +++ b/rpm-rubyprov.patch @@ -1,6 +1,6 @@ diff -urpa rpm-4.5.orig/configure.ac rpm-4.5/configure.ac --- rpm-4.5.orig/configure.ac 2011-10-03 01:50:17.000000000 +0000 -+++ rpm-4.5/configure.ac 2018-02-22 12:42:35.749384821 +0000 ++++ rpm-4.5/configure.ac 2018-02-23 13:52:54.438364538 +0000 @@ -291,6 +291,7 @@ AC_PATH_PROG(__PHP, php, %{_bindir}/php, AC_PATH_PROG(__PYTHON, python, %{_bindir}/python, $MYPATH) AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH) @@ -9,9 +9,114 @@ diff -urpa rpm-4.5.orig/configure.ac rpm-4.5/configure.ac AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH) AC_PATH_PROG(__SH, sh, /bin/sh, $MYPATH) AC_PATH_PROG(__SSH, ssh, %{_bindir}/ssh, $MYPATH) +diff -urpa rpm-4.5.orig/lib/rpmfc.c rpm-4.5/lib/rpmfc.c +--- rpm-4.5.orig/lib/rpmfc.c 2008-06-10 22:13:27.000000000 +0000 ++++ rpm-4.5/lib/rpmfc.c 2018-02-23 14:04:42.056356571 +0000 +@@ -478,6 +478,9 @@ static struct rpmfcTokens_s rpmfcTokens[ + + { "Java ", RPMFC_JAVA|RPMFC_INCLUDE }, + ++ { "ruby script text", RPMFC_RUBY|RPMFC_INCLUDE }, ++ { "Ruby script text", RPMFC_RUBY|RPMFC_INCLUDE }, ++ + /* .NET executables and libraries. file(1) cannot differ it from native win32 executables unfortunatelly */ + { "PE executable", RPMFC_MONO|RPMFC_INCLUDE }, + { "executable PE", RPMFC_MONO|RPMFC_INCLUDE }, +@@ -740,6 +743,8 @@ static int rpmfcSCRIPT(rpmfc fc) + fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; + else if (!strncmp(bn, "php", sizeof("php")-1)) + fc->fcolor->vals[fc->ix] |= RPMFC_PHP; ++ else if (!strncmp(bn, "ruby", sizeof("ruby")-1)) ++ fc->fcolor->vals[fc->ix] |= RPMFC_RUBY; + + break; + } +@@ -788,6 +793,13 @@ static int rpmfcSCRIPT(rpmfc fc) + if (is_executable) + xx = rpmfcHelper(fc, 'R', "php"); + } else ++ if (fc->fcolor->vals[fc->ix] & RPMFC_RUBY) { ++ xx = rpmfcHelper(fc, 'P', "ruby"); ++#ifdef NOTYET ++ if (is_executable) ++#endif ++ xx = rpmfcHelper(fc, 'R', "ruby"); ++ } else + if (fc->fcolor->vals[fc->ix] & RPMFC_JAVA) { + xx = rpmfcHelper(fc, 'P', "java"); + xx = rpmfcHelper(fc, 'R', "java"); +@@ -898,7 +910,7 @@ typedef struct rpmfcApplyTbl_s { + /*@unchecked@*/ + static struct rpmfcApplyTbl_s rpmfcApplyTable[] = { + { rpmfcELF, RPMFC_ELF }, +- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_DESKTOP_FILE) }, ++ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_RUBY|RPMFC_DESKTOP_FILE) }, + { rpmfcMONO, RPMFC_MONO }, + { NULL, 0 } + }; +@@ -925,7 +937,7 @@ int rpmfcApply(rpmfc fc) + /* Generate package and per-file dependencies. */ + for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) { + +- /* XXX Insure that /usr/lib{,64}/python files are marked RPMFC_PYTHON */ ++ /* XXX Insure that /usr/{share,lib{,64}}/python files are marked RPMFC_PYTHON */ + /* XXX HACK: classification by path is intrinsically stupid. */ + { const char *fn = strstr(fc->fn[fc->ix], "/usr/lib"); + if (fn) { +@@ -934,6 +946,36 @@ int rpmfcApply(rpmfc fc) + fn += 2; + if (!strncmp(fn, "/python", sizeof("/python")-1)) + fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; ++ else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1)) { ++ fc->fcolor->vals[fc->ix] |= RPMFC_RUBY; ++ if ((strstr(fn, ".gemspec") || strstr(fn, "rbconfig.rb"))) { ++ miRE mire = mireNew(RPMMIRE_REGEX, RPMTAG_FILEPATHS); ++ if (!mireRegcomp(mire, ".*/(specifications/.*\\.gemspec|rbconfig\\.rb)$")) ++ if (mireRegexec(mire, fc->fn[fc->ix])) ++ fc->fcolor->vals[fc->ix] |= RPMFC_MODULE; ++ mire = mireFree(mire); ++ } ++ } ++ /* XXX: lacking better, more generic classifier... */ ++ else if (!strncmp(fn, "/gstreamer", sizeof("/gstreamer")-1) && ++ fc->fcolor->vals[fc->ix] & RPMFC_LIBRARY) ++ fc->fcolor->vals[fc->ix] |= (RPMFC_MODULE|RPMFC_SCRIPT); ++ } ++ fn = strstr(fc->fn[fc->ix], "/usr/share"); ++ if (fn) { ++ fn += sizeof("/usr/share")-1; ++ if (!strncmp(fn, "/python", sizeof("/python")-1)) ++ fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON; ++ else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1) || !strncmp(fn, "/gems/specifications", sizeof("/gems/specifications")-1)) { ++ fc->fcolor->vals[fc->ix] |= RPMFC_RUBY; ++ if ((strstr(fn, ".gemspec") || strstr(fn, "rbconfig.rb"))) { ++ miRE mire = mireNew(RPMMIRE_REGEX, RPMTAG_FILEPATHS); ++ if (!mireRegcomp(mire, ".*/(specifications/.*\\.gemspec|rbconfig\\.rb)$")) ++ if (mireRegexec(mire, fc->fn[fc->ix])) ++ fc->fcolor->vals[fc->ix] |= RPMFC_MODULE; ++ mire = mireFree(mire); ++ } ++ } + } + } + +diff -urpa rpm-4.5.orig/lib/rpmfc.h rpm-4.5/lib/rpmfc.h +--- rpm-4.5.orig/lib/rpmfc.h 2008-06-10 21:21:57.000000000 +0000 ++++ rpm-4.5/lib/rpmfc.h 2018-02-23 13:52:54.438364538 +0000 +@@ -31,8 +31,9 @@ enum FCOLOR_e { + #define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32) + + /* bits 4-7 unused */ +- RPMFC_DESKTOP_FILE = (1 << 7), /* XXX */ ++ RPMFC_DESKTOP_FILE = (1 << 6), /* XXX */ + ++ RPMFC_RUBY = (1 << 7), + RPMFC_PKGCONFIG = (1 << 8), + RPMFC_LIBTOOL = (1 << 9), + RPMFC_BOURNE = (1 << 10), diff -urpa rpm-4.5.orig/macros.in rpm-4.5/macros.in --- rpm-4.5.orig/macros.in 2008-06-10 22:00:43.000000000 +0000 -+++ rpm-4.5/macros.in 2018-02-22 13:53:01.843337239 +0000 ++++ rpm-4.5/macros.in 2018-02-23 13:52:54.439364538 +0000 @@ -78,6 +78,7 @@ %__python @__PYTHON@ %__rm @__RM@ @@ -67,7 +172,7 @@ diff -urpa rpm-4.5.orig/macros.in rpm-4.5/macros.in # Path to scripts to autogenerate libtool package dependencies, diff -urpa rpm-4.5.orig/scripts/Makefile.am rpm-4.5/scripts/Makefile.am --- rpm-4.5.orig/scripts/Makefile.am 2008-05-21 20:48:02.000000000 +0000 -+++ rpm-4.5/scripts/Makefile.am 2018-02-22 13:55:18.773335698 +0000 ++++ rpm-4.5/scripts/Makefile.am 2018-02-23 13:52:54.439364538 +0000 @@ -19,7 +19,8 @@ EXTRA_DIST = \ sql.prov sql.req symclash.py symclash.sh tcl.req tgpg trpm u_pkg.sh \ vpkg-provides.sh vpkg-provides2.sh \ diff --git a/rpm.spec b/rpm.spec index c2f5b38..f67bfd2 100644 --- a/rpm.spec +++ b/rpm.spec @@ -42,7 +42,7 @@ Summary(ru.UTF-8): Менеджер пакетов от RPM Summary(uk.UTF-8): Менеджер пакетів від RPM Name: rpm Version: 4.5 -Release: 82 +Release: 83 License: LGPL Group: Base Source0: %{name}-%{version}.tar.gz