teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.7.0-extra-provides.patch

Panu Matilainen b60210
diff -up rpm-4.7.0-beta1/build/rpmfc.c.extra-prov rpm-4.7.0-beta1/build/rpmfc.c
Panu Matilainen b60210
--- rpm-4.7.0-beta1/build/rpmfc.c.extra-prov	2009-02-26 17:31:12.000000000 +0200
Panu Matilainen b60210
+++ rpm-4.7.0-beta1/build/rpmfc.c	2009-02-26 17:31:55.000000000 +0200
Panu Matilainen b60210
@@ -485,6 +485,7 @@ static const struct rpmfcTokens_s const 
Panu Matilainen b60210
   { "RPM v4",			RPMFC_ARCHIVE|RPMFC_INCLUDE },
Panu Matilainen b60210
 
Panu Matilainen b60210
   { " image",			RPMFC_IMAGE|RPMFC_INCLUDE },
Panu Matilainen b60210
+  { " font metrics",		RPMFC_WHITE|RPMFC_INCLUDE },
Panu Matilainen b60210
   { " font",			RPMFC_FONT|RPMFC_INCLUDE },
Panu Matilainen b60210
   { " Font",			RPMFC_FONT|RPMFC_INCLUDE },
Panu Matilainen b60210
 
Panu Matilainen b60210
@@ -1189,6 +1190,31 @@ exit:
Panu Matilainen b60210
 #endif
Panu Matilainen b60210
 }
Panu Matilainen b60210
 
Panu Matilainen b60210
+static int rpmfcMISC(rpmfc fc)
Panu Matilainen b60210
+{
Panu Matilainen b60210
+    struct stat st;
Panu Matilainen b60210
+    int rc = -1;
Panu Matilainen b60210
+    const char *what = NULL;
Panu Matilainen b60210
+    const char * fn = fc->fn[fc->ix];
Panu Matilainen b60210
+    /* this part is enumerated, compare equality not bit flags */
Panu Matilainen b60210
+    int ftype = fc->fcolor->vals[fc->ix] & 0x000F0000;
Panu Matilainen b60210
+
Panu Matilainen b60210
+    if (ftype == RPMFC_FONT) {
Panu Matilainen b60210
+	what = "fontconfig";
Panu Matilainen b60210
+    } else if (ftype == RPMFC_TEXT && rpmFileHasSuffix(fn, ".desktop")) {
Panu Matilainen b60210
+	what = "desktop";
Panu Matilainen b60210
+    }
Panu Matilainen b60210
+
Panu Matilainen b60210
+    if (what == NULL || stat(fn, &st) < 0 || !S_ISREG(st.st_mode)) {
Panu Matilainen b60210
+	goto exit;
Panu Matilainen b60210
+    }
Panu Matilainen b60210
+
Panu Matilainen b60210
+    (void) rpmfcHelper(fc, 'P', what);
Panu Matilainen b60210
+    rc = 0;
Panu Matilainen b60210
+
Panu Matilainen b60210
+exit:
Panu Matilainen b60210
+    return rc;
Panu Matilainen b60210
+}
Panu Matilainen b60210
 typedef const struct rpmfcApplyTbl_s {
Panu Matilainen b60210
     int (*func) (rpmfc fc);
Panu Matilainen b60210
     int colormask;
Panu Matilainen b60210
@@ -1201,6 +1227,7 @@ static const struct rpmfcApplyTbl_s cons
Panu Matilainen b60210
     { rpmfcSCRIPT,	(RPMFC_SCRIPT|RPMFC_BOURNE|
Panu Matilainen b60210
 			 RPMFC_PERL|RPMFC_PYTHON|RPMFC_MONO|
Panu Matilainen b60210
 			 RPMFC_PKGCONFIG|RPMFC_LIBTOOL) },
Panu Matilainen b60210
+    { rpmfcMISC,	RPMFC_FONT|RPMFC_TEXT },
Panu Matilainen b60210
     { rpmfcSYMLINK,	RPMFC_SYMLINK },
Panu Matilainen b60210
     { NULL, 0 }
Panu Matilainen b60210
 };
Panu Matilainen b60210
@@ -1320,7 +1347,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t arg
Panu Matilainen b60210
     size_t slen;
Panu Matilainen b60210
     int fcolor;
Panu Matilainen b60210
     int xx;
Panu Matilainen b60210
-    int msflags = MAGIC_CHECK;	/* XXX MAGIC_COMPRESS flag? */
Panu Matilainen b60210
+    int msflags = MAGIC_CHECK; /* add MAGIC_COMPRESS eventually */
Panu Matilainen b60210
     magic_t ms = NULL;
Panu Matilainen b60210
 
Panu Matilainen b60210
     if (fc == NULL || argv == NULL)
Panu Matilainen b60210
diff -up rpm-4.7.0-beta1/macros.in.extra-prov rpm-4.7.0-beta1/macros.in
Panu Matilainen b60210
--- rpm-4.7.0-beta1/macros.in.extra-prov	2009-02-26 17:31:12.000000000 +0200
Panu Matilainen b60210
+++ rpm-4.7.0-beta1/macros.in	2009-02-26 17:32:38.000000000 +0200
Panu Matilainen b60210
@@ -494,6 +494,9 @@ print (t)\
Panu Matilainen b60210
 %__pkgconfig_provides   %{_rpmconfigdir}/pkgconfigdeps.sh --provides
Panu Matilainen b60210
 %__pkgconfig_requires   %{_rpmconfigdir}/pkgconfigdeps.sh --requires
Panu Matilainen b60210
 
Panu Matilainen b60210
+%__fontconfig_provides	%{_rpmconfigdir}/fontconfig.prov
Panu Matilainen b60210
+%__desktop_provides     %{_rpmconfigdir}/desktop-file.prov
Panu Matilainen b60210
+
Panu Matilainen b60210
 #==============================================================================
Panu Matilainen b60210
 # ---- Database configuration macros.
Panu Matilainen b60210
 #	Macros used to configure Berkley db parameters.