Add NodeJS dependency generators

This commit is contained in:
Denis Silakov 2014-05-05 13:50:45 +04:00
parent 0ec049dcf2
commit 0bb402fd3e
2 changed files with 73 additions and 1 deletions

View file

@ -0,0 +1,66 @@
diff -Naur rpm-5.4.10.orig/lib/rpmfc.h rpm-5.4.10/lib/rpmfc.h
--- rpm-5.4.10.orig/lib/rpmfc.h 2014-04-30 17:14:01.158698669 +0400
+++ rpm-5.4.10/lib/rpmfc.h 2014-04-30 17:15:21.236691127 +0400
@@ -62,7 +62,9 @@
RPMFC_WHITE = (1 << 29),
RPMFC_INCLUDE = (1 << 30),
- RPMFC_ERROR = (1 << 31)
+ RPMFC_ERROR = (1 << 31),
+
+ RPMFC_NODEJS = (1 << 11)
} FCOLOR_t;
#if defined(_RPMFC_INTERNAL)
diff -Naur rpm-5.4.10.orig/lib/rpmfc.c rpm-5.4.10/lib/rpmfc.c
--- rpm-5.4.10.orig/lib/rpmfc.c 2014-04-30 17:14:01.158698669 +0400
+++ rpm-5.4.10/lib/rpmfc.c 2014-04-30 17:16:46.669683082 +0400
@@ -635,6 +635,7 @@
{ "perl script text", RPMFC_PERL|RPMFC_INCLUDE },
{ "Perl5 module source text", RPMFC_PERL|RPMFC_MODULE|RPMFC_INCLUDE },
+ { "NodeJS script text", RPMFC_NODEJS|RPMFC_INCLUDE },
{ "PHP script text", RPMFC_PHP|RPMFC_INCLUDE },
{ "G-IR binary database", RPMFC_TYPELIB|RPMFC_INCLUDE },
@@ -912,6 +913,8 @@
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, "json", sizeof("json")-1))
+ fc->fcolor->vals[fc->ix] |= RPMFC_NODEJS;
else if (!strncmp(bn, "ruby", sizeof("ruby")-1))
fc->fcolor->vals[fc->ix] |= RPMFC_RUBY;
@@ -932,6 +935,10 @@
if (is_executable || (fc->fcolor->vals[fc->ix] & RPMFC_MODULE))
xx = rpmfcHelper(fc, 'R', "python");
} else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_NODEJS) {
+ xx = rpmfcHelper(fc, 'P', "nodejs");
+ xx = rpmfcHelper(fc, 'R', "nodejs");
+ } else
if (fc->fcolor->vals[fc->ix] & RPMFC_LIBTOOL) {
xx = rpmfcHelper(fc, 'P', "libtool");
#ifdef NOTYET
@@ -1140,7 +1147,7 @@
/*@unchecked@*/
static struct rpmfcApplyTbl_s rpmfcApplyTable[] = {
{ rpmfcELF, RPMFC_ELF },
- { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_RUBY|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB) },
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_FONT|RPMFC_HASKELL|RPMFC_RUBY|RPMFC_PERL|RPMFC_PYTHON|RPMFC_LIBTOOL|RPMFC_PKGCONFIG|RPMFC_BOURNE|RPMFC_JAVA|RPMFC_PHP|RPMFC_MONO|RPMFC_TYPELIB|RPMFC_NODEJS) },
#if defined(RPM_VENDOR_MANDRIVA)
{ rpmfcSYMLINK, RPMFC_SYMLINK },
#endif
@@ -1452,6 +1459,10 @@
else if (_suffix(s, ".php"))
ftype = "PHP script text";
+ /* XXX all files with extension ".json" are NodeJS for now. */
+ else if (_suffix(s, ".json"))
+ ftype = "NodeJS script text";
+
/* XXX files with extension ".typelib" are GNOME typelib for now. */
else if (_suffix(s, ".typelib"))
ftype = "G-IR binary database";

View file

@ -59,7 +59,7 @@ Summary: The RPM package management system
Name: rpm Name: rpm
Epoch: 1 Epoch: 1
Version: %{libver}.%{minorver} Version: %{libver}.%{minorver}
Release: %{?prereldate:0.%{prereldate}.}27 Release: %{?prereldate:0.%{prereldate}.}28
License: LGPLv2.1+ License: LGPLv2.1+
Group: System/Configuration/Packaging Group: System/Configuration/Packaging
URL: http://rpm5.org/ URL: http://rpm5.org/
@ -471,6 +471,11 @@ Patch504: rpm-5.4.10-postpone_subpackage_build_failures.patch
# the new one doesn't work in ROSA atm # the new one doesn't work in ROSA atm
Patch505: rpm-5.4.10-turn-back-urlgetfile.patch Patch505: rpm-5.4.10-turn-back-urlgetfile.patch
# This is a durty hack since we use the same flag for NodeJS and Mono,
# but there is no other easy way to add more dependency generators for now
# (see jbj mails in mailing lists)
Patch506: rpm-5.4.10-nodejs-dependency-generator.patch
BuildRequires: autoconf >= 2.57 BuildRequires: autoconf >= 2.57
BuildRequires: bzip2-devel BuildRequires: bzip2-devel
BuildRequires: automake >= 1.8 BuildRequires: automake >= 1.8
@ -877,6 +882,7 @@ This package contains the RPM API documentation generated in HTML format.
%patch503 -p1 -b .specspo~ %patch503 -p1 -b .specspo~
%patch504 -p1 -b .postpone_errors~ %patch504 -p1 -b .postpone_errors~
%patch505 -p1 -b .urlgetfile~ %patch505 -p1 -b .urlgetfile~
%patch506 -p1 -b .nodejs~
#required by P55, P80, P81, P94.. #required by P55, P80, P81, P94..
./autogen.sh ./autogen.sh