1 diff -urpa rpm-4.5.orig/configure.ac rpm-4.5/configure.ac
2 --- rpm-4.5.orig/configure.ac 2011-10-03 01:50:17.000000000 +0000
3 +++ rpm-4.5/configure.ac 2018-02-23 13:52:54.438364538 +0000
4 @@ -291,6 +291,7 @@ AC_PATH_PROG(__PHP, php, %{_bindir}/php,
5 AC_PATH_PROG(__PYTHON, python, %{_bindir}/python, $MYPATH)
6 AC_PATH_PROG(__RM, rm, /bin/rm, $MYPATH)
7 AC_PATH_PROG(__RSH, rsh, %{_bindir}/rsh, $MYPATH)
8 +AC_PATH_PROG(__RUBY, ruby, %{_bindir}/ruby, $MYPATH)
9 AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH)
10 AC_PATH_PROG(__SH, sh, /bin/sh, $MYPATH)
11 AC_PATH_PROG(__SSH, ssh, %{_bindir}/ssh, $MYPATH)
12 diff -urpa rpm-4.5.orig/lib/rpmfc.c rpm-4.5/lib/rpmfc.c
13 --- rpm-4.5.orig/lib/rpmfc.c 2008-06-10 22:13:27.000000000 +0000
14 +++ rpm-4.5/lib/rpmfc.c 2018-02-23 14:04:42.056356571 +0000
15 @@ -478,6 +478,9 @@ static struct rpmfcTokens_s rpmfcTokens[
17 { "Java ", RPMFC_JAVA|RPMFC_INCLUDE },
19 + { "ruby script text", RPMFC_RUBY|RPMFC_INCLUDE },
20 + { "Ruby script text", RPMFC_RUBY|RPMFC_INCLUDE },
22 /* .NET executables and libraries. file(1) cannot differ it from native win32 executables unfortunatelly */
23 { "PE executable", RPMFC_MONO|RPMFC_INCLUDE },
24 { "executable PE", RPMFC_MONO|RPMFC_INCLUDE },
25 @@ -740,6 +743,8 @@ static int rpmfcSCRIPT(rpmfc fc)
26 fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON;
27 else if (!strncmp(bn, "php", sizeof("php")-1))
28 fc->fcolor->vals[fc->ix] |= RPMFC_PHP;
29 + else if (!strncmp(bn, "ruby", sizeof("ruby")-1))
30 + fc->fcolor->vals[fc->ix] |= RPMFC_RUBY;
34 @@ -788,6 +793,13 @@ static int rpmfcSCRIPT(rpmfc fc)
36 xx = rpmfcHelper(fc, 'R', "php");
38 + if (fc->fcolor->vals[fc->ix] & RPMFC_RUBY) {
39 + xx = rpmfcHelper(fc, 'P', "ruby");
43 + xx = rpmfcHelper(fc, 'R', "ruby");
45 if (fc->fcolor->vals[fc->ix] & RPMFC_JAVA) {
46 xx = rpmfcHelper(fc, 'P', "java");
47 xx = rpmfcHelper(fc, 'R', "java");
48 @@ -898,7 +910,7 @@ typedef struct rpmfcApplyTbl_s {
50 static struct rpmfcApplyTbl_s rpmfcApplyTable[] = {
51 { rpmfcELF, RPMFC_ELF },
52 - { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_DESKTOP_FILE) },
53 + { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_RUBY|RPMFC_DESKTOP_FILE) },
54 { rpmfcMONO, RPMFC_MONO },
57 @@ -925,7 +937,7 @@ int rpmfcApply(rpmfc fc)
58 /* Generate package and per-file dependencies. */
59 for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
61 - /* XXX Insure that /usr/lib{,64}/python files are marked RPMFC_PYTHON */
62 + /* XXX Insure that /usr/{share,lib{,64}}/python files are marked RPMFC_PYTHON */
63 /* XXX HACK: classification by path is intrinsically stupid. */
64 { const char *fn = strstr(fc->fn[fc->ix], "/usr/lib");
66 @@ -934,6 +946,36 @@ int rpmfcApply(rpmfc fc)
68 if (!strncmp(fn, "/python", sizeof("/python")-1))
69 fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON;
70 + else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1)) {
71 + fc->fcolor->vals[fc->ix] |= RPMFC_RUBY;
72 + if ((strstr(fn, ".gemspec") || strstr(fn, "rbconfig.rb"))) {
73 + miRE mire = mireNew(RPMMIRE_REGEX, RPMTAG_FILEPATHS);
74 + if (!mireRegcomp(mire, ".*/(specifications/.*\\.gemspec|rbconfig\\.rb)$"))
75 + if (mireRegexec(mire, fc->fn[fc->ix]))
76 + fc->fcolor->vals[fc->ix] |= RPMFC_MODULE;
77 + mire = mireFree(mire);
80 + /* XXX: lacking better, more generic classifier... */
81 + else if (!strncmp(fn, "/gstreamer", sizeof("/gstreamer")-1) &&
82 + fc->fcolor->vals[fc->ix] & RPMFC_LIBRARY)
83 + fc->fcolor->vals[fc->ix] |= (RPMFC_MODULE|RPMFC_SCRIPT);
85 + fn = strstr(fc->fn[fc->ix], "/usr/share");
87 + fn += sizeof("/usr/share")-1;
88 + if (!strncmp(fn, "/python", sizeof("/python")-1))
89 + fc->fcolor->vals[fc->ix] |= RPMFC_PYTHON;
90 + else if (!strncmp(fn, "/ruby", sizeof("/ruby")-1) || !strncmp(fn, "/gems/specifications", sizeof("/gems/specifications")-1)) {
91 + fc->fcolor->vals[fc->ix] |= RPMFC_RUBY;
92 + if ((strstr(fn, ".gemspec") || strstr(fn, "rbconfig.rb"))) {
93 + miRE mire = mireNew(RPMMIRE_REGEX, RPMTAG_FILEPATHS);
94 + if (!mireRegcomp(mire, ".*/(specifications/.*\\.gemspec|rbconfig\\.rb)$"))
95 + if (mireRegexec(mire, fc->fn[fc->ix]))
96 + fc->fcolor->vals[fc->ix] |= RPMFC_MODULE;
97 + mire = mireFree(mire);
103 diff -urpa rpm-4.5.orig/lib/rpmfc.h rpm-4.5/lib/rpmfc.h
104 --- rpm-4.5.orig/lib/rpmfc.h 2008-06-10 21:21:57.000000000 +0000
105 +++ rpm-4.5/lib/rpmfc.h 2018-02-23 13:52:54.438364538 +0000
106 @@ -31,8 +31,9 @@ enum FCOLOR_e {
107 #define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
109 /* bits 4-7 unused */
110 - RPMFC_DESKTOP_FILE = (1 << 7), /* XXX */
111 + RPMFC_DESKTOP_FILE = (1 << 6), /* XXX */
113 + RPMFC_RUBY = (1 << 7),
114 RPMFC_PKGCONFIG = (1 << 8),
115 RPMFC_LIBTOOL = (1 << 9),
116 RPMFC_BOURNE = (1 << 10),
117 diff -urpa rpm-4.5.orig/macros.in rpm-4.5/macros.in
118 --- rpm-4.5.orig/macros.in 2008-06-10 22:00:43.000000000 +0000
119 +++ rpm-4.5/macros.in 2018-02-23 13:52:54.439364538 +0000
128 @@ -1421,6 +1422,44 @@ PreReq: python >= %{python_version}, pyt
129 #%__java_requires %{_rpmhome}/javadeps.sh --requires
131 #------------------------------------------------------------------------
132 +# ruby(...) configuration.
134 +# Path to scripts to autogenerate ruby package dependencies,
136 +# Note: Used if _use_internal_dependency_generator is non-zero. The
137 +# helpers are also used by %{_rpmhome}/rpmdeps {--provides|--requires}.
138 +%__ruby_provides %{_rpmhome}/rubygems.rb --provides
139 +%__ruby_requires %{_rpmhome}/rubygems.rb --requires
141 +%ruby_version %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["ruby_version"]')
143 +%ruby_archdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["archdir"]')
144 +%ruby_libdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["rubylibdir"]')
145 +%ruby_sitedir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitedir"]')
146 +%ruby_sitearchdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')
147 +%ruby_sitelibdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["sitelibdir"]')
148 +%ruby_vendordir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendordir"]')
149 +%ruby_vendorarchdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendorarchdir"]')
150 +%ruby_vendorlibdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["vendorlibdir"]')
151 +%ruby_gemdir %(%{__ruby} -rrbconfig -e 'print RbConfig::CONFIG["rubylibdir"].sub(RbConfig::CONFIG["ruby_version"], "gems/#{RbConfig::CONFIG["ruby_version"]}")')
152 +%ruby_ridir %(%{__ruby} -rrbconfig -e 'print File.join(RbConfig::CONFIG["datadir"], "ri", RbConfig::CONFIG["ruby_version"])')
154 +%__gem_helper %{_usrlibrpm}/gem_helper.rb
157 + %__gem_helper build \\\
159 + %{!-j:%{_smp_mflags}}%{-j:-j%{-j*}}
161 +%gem_install(i:n:C) \
162 + DESTDIR=${DESTDIR:-%{buildroot}} \\\
163 + %__gem_helper install \\\
164 + --env-shebang --rdoc --ri --force --ignore-dependencies \\\
165 + %{!-i:--install-dir %{buildroot}%{ruby_gemdir}}%{-i:--install-dir %{-i*}} \\\
166 + %{!-n:--bindir %{buildroot}%{_bindir}}%{-n:--bindir%{-n*}} \\\
167 + %{!-C:--fix-permissions}
169 +#------------------------------------------------------------------------
170 # libtool(...) configuration.
172 # Path to scripts to autogenerate libtool package dependencies,
173 diff -urpa rpm-4.5.orig/scripts/Makefile.am rpm-4.5/scripts/Makefile.am
174 --- rpm-4.5.orig/scripts/Makefile.am 2008-05-21 20:48:02.000000000 +0000
175 +++ rpm-4.5/scripts/Makefile.am 2018-02-23 13:52:54.439364538 +0000
176 @@ -19,7 +19,8 @@ EXTRA_DIST = \
177 sql.prov sql.req symclash.py symclash.sh tcl.req tgpg trpm u_pkg.sh \
178 vpkg-provides.sh vpkg-provides2.sh \
179 macros.perl* macros.python* \
180 - macros.php* find-*.php find-php-*
181 + macros.php* find-*.php find-php-* \
182 + gem_helper.rb rubygems.rb
184 installprefix = $(DESTDIR)
186 @@ -43,4 +44,5 @@ versionlib_SCRIPTS = \
188 rpm.daily rpm.log rpm.xinetd \
189 symclash.py symclash.sh tgpg u_pkg.sh \
190 - vpkg-provides.sh vpkg-provides2.sh
191 + vpkg-provides.sh vpkg-provides2.sh \
192 + gem_helper.rb rubygems.rb