summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2007-07-31 12:06:34 +0300
committerPanu Matilainen <pmatilai@redhat.com>2007-07-31 12:06:34 +0300
commit6c4b0fc9e44ea3b9449e171404c1b2037d15d01e (patch)
treeaeeb8b3a1c85e428588107a48dc3ef23ed0a370d /build
parent345d1189aef724e893f8beb4f57db5111ddd6166 (diff)
downloadlibrpm-tizen-6c4b0fc9e44ea3b9449e171404c1b2037d15d01e.tar.gz
librpm-tizen-6c4b0fc9e44ea3b9449e171404c1b2037d15d01e.tar.bz2
librpm-tizen-6c4b0fc9e44ea3b9449e171404c1b2037d15d01e.zip
Extract pkgconfig and libtool dependencies automatically.
Ported from rpm5.org work of Jeff Johnson.
Diffstat (limited to 'build')
-rw-r--r--build/rpmfc.c36
-rw-r--r--build/rpmfc.h2
2 files changed, 35 insertions, 3 deletions
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 12669351c..0017af335 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -463,6 +463,9 @@ static struct rpmfcTokens_s rpmfcTokens[] = {
/* XXX "python 2.3 byte-compiled" */
{ "python ", RPMFC_PYTHON|RPMFC_INCLUDE },
+ { "libtool library ", RPMFC_LIBTOOL|RPMFC_INCLUDE },
+ { "pkgconfig ", RPMFC_PKGCONFIG|RPMFC_INCLUDE },
+
/* XXX .NET executables and libraries. file(1) cannot differ from win32
* executables unfortunately :( */
{ "PE executable", RPMFC_MONO|RPMFC_INCLUDE },
@@ -739,7 +742,21 @@ static int rpmfcSCRIPT(rpmfc fc)
if (is_executable)
#endif
xx = rpmfcHelper(fc, 'R', "python");
- }
+ } else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_LIBTOOL) {
+ xx = rpmfcHelper(fc, 'P', "libtool");
+#ifdef NOTYET
+ if (is_executable)
+#endif
+ xx = rpmfcHelper(fc, 'R', "libtool");
+ } else
+ if (fc->fcolor->vals[fc->ix] & RPMFC_PKGCONFIG) {
+ xx = rpmfcHelper(fc, 'P', "pkgconfig");
+#ifdef NOTYET
+ if (is_executable)
+#endif
+ xx = rpmfcHelper(fc, 'R', "pkgconfig");
+ } else
if (fc->fcolor->vals[fc->ix] & RPMFC_MONO) {
xx = rpmfcHelper(fc, 'P', "mono");
if (is_executable)
@@ -1093,6 +1110,8 @@ static struct rpmfcApplyTbl_s rpmfcApplyTable[] = {
{ rpmfcELF, RPMFC_ELF },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PERL) },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PYTHON) },
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PKGCONFIG) },
+ { rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_LIBTOOL) },
{ rpmfcSCRIPT, RPMFC_MONO },
{ NULL, 0 }
};
@@ -1258,10 +1277,21 @@ assert(s != NULL);
case S_IFLNK:
case S_IFREG:
default:
+#define _suffix(_s, _x) \
+ (slen >= sizeof(_x) && !strcmp((_s)+slen-(sizeof(_x)-1), (_x)))
+
/* XXX all files with extension ".pm" are perl modules for now. */
-/*@-branchstate@*/
- if (slen >= sizeof(".pm") && !strcmp(s+slen-(sizeof(".pm")-1), ".pm"))
+ if (_suffix(s, ".pm"))
ftype = "Perl5 module source text";
+
+ /* XXX all files with extension ".la" are libtool for now. */
+ else if (_suffix(s, ".la"))
+ ftype = "libtoo library file";
+
+ /* XXX all files with extension ".pc" are pkgconfig for now. */
+ else if (_suffix(s, ".pc"))
+ ftype = "pkgconfig file";
+
/* XXX skip all files in /dev/ which are (or should be) %dev dummies. */
else if (slen >= fc->brlen+sizeof("/dev/") && !strncmp(s+fc->brlen, "/dev/", sizeof("/dev/")-1))
ftype = "";
diff --git a/build/rpmfc.h b/build/rpmfc.h
index 377861ea0..b40801246 100644
--- a/build/rpmfc.h
+++ b/build/rpmfc.h
@@ -53,6 +53,8 @@ enum FCOLOR_e {
RPMFC_ELF64 = (1 << 1),
#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64)
+ RPMFC_PKGCONFIG = (1 << 5),
+ RPMFC_LIBTOOL = (1 << 6),
RPMFC_MODULE = (1 << 7),
RPMFC_EXECUTABLE = (1 << 8),
RPMFC_SCRIPT = (1 << 9),