rpms/rpm/devel rpm-4.7.0-devel-autodep.patch, NONE, 1.1 rpm-4.7.0-extra-provides.patch, NONE, 1.1 .cvsignore, 1.33, 1.34 rpm.spec, 1.334, 1.335 sources, 1.139, 1.140

Panu Matilainen pmatilai at fedoraproject.org
Fri Mar 6 18:28:51 UTC 2009


Author: pmatilai

Update of /cvs/pkgs/rpms/rpm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1159

Modified Files:
	.cvsignore rpm.spec sources 
Added Files:
	rpm-4.7.0-devel-autodep.patch rpm-4.7.0-extra-provides.patch 
Log Message:
- update to rpm 4.7.0 beta1


rpm-4.7.0-devel-autodep.patch:

--- NEW FILE rpm-4.7.0-devel-autodep.patch ---
diff -up rpm-4.7.0-beta1/build/rpmfc.c.devel-autodep rpm-4.7.0-beta1/build/rpmfc.c
--- rpm-4.7.0-beta1/build/rpmfc.c.devel-autodep	2009-02-23 09:16:11.000000000 +0200
+++ rpm-4.7.0-beta1/build/rpmfc.c	2009-02-26 17:30:04.000000000 +0200
@@ -506,7 +506,7 @@ static const struct rpmfcTokens_s const 
   { "ASCII text",		RPMFC_WHITE|RPMFC_INCLUDE },
   { "ISO-8859 text",		RPMFC_WHITE|RPMFC_INCLUDE },
 
-  { "symbolic link to",		RPMFC_SYMLINK },
+  { "symbolic link to",		RPMFC_SYMLINK|RPMFC_INCLUDE },
   { "socket",			RPMFC_DEVICE },
   { "special",			RPMFC_DEVICE },
 
@@ -667,6 +667,105 @@ rpmds rpmfcRequires(rpmfc fc)
 
 
 /**
+ * Ensure that symlinks for shared libs generate a dep on the shared lib
+ * @param fc            file classifier
+ * @return              0 on success
+ */
+static int rpmfcSYMLINK(rpmfc fc)
+{
+    const char * fn = fc->fn[fc->ix];
+    struct stat sb;
+    int fdno;
+
+    if (fc->skipReq) 
+	return 0;
+
+    if (stat(fn, &sb) < 0)
+	return -1;
+    if (S_ISLNK(sb.st_mode))
+        return -1;
+    
+    fdno = open(fn, O_RDONLY);
+    if (fdno < 0) {
+	return fdno;
+    }
+
+#if HAVE_GELF_H && HAVE_LIBELF
+    Elf * elf = NULL;
+    GElf_Ehdr ehdr_mem, * ehdr;
+    int isElf64 = 0;
+    int i, cnt;
+    char * soname = NULL;
+    rpmds ds;
+
+    (void) elf_version(EV_CURRENT);
+    elf = NULL;
+    if ((elf = elf_begin (fdno, ELF_C_READ_MMAP, NULL)) == NULL
+        || elf_kind(elf) != ELF_K_ELF
+        || (ehdr = gelf_getehdr(elf, &ehdr_mem)) == NULL
+        || ehdr->e_type != ET_DYN)
+	goto exit;
+
+/* alpha uses /lib, not /lib64 so don't add (64bit) deps */
+#if !defined(__alpha__)
+    isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64;
+#endif
+
+    for (i = 0; i < ehdr->e_phnum; ++i) {
+	GElf_Phdr phdr_mem;
+	GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
+	GElf_Shdr shdr_mem;
+	Elf_Data * data = NULL;
+	Elf_Scn * scn;
+	GElf_Shdr *shdr;
+
+	if (phdr == NULL || phdr->p_type != PT_DYNAMIC)
+	    continue;
+
+	scn = gelf_offscn(elf, phdr->p_offset);
+	shdr = gelf_getshdr(scn, &shdr_mem);
+
+	if (shdr != NULL && shdr->sh_type == SHT_DYNAMIC)
+	    data = elf_getdata (scn, NULL);
+	if (data == NULL)
+	    continue; 
+	  
+	for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) {
+	    GElf_Dyn dynmem;
+	    GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dynmem);
+	    char *depname = NULL;
+
+	    if (dyn == NULL)
+		break;
+	    if (dyn->d_tag != DT_SONAME)
+		continue;
+
+	    /* add the soname to package deps */
+	    soname = elf_strptr(elf, shdr->sh_link, dyn->d_un.d_val);
+	    if (soname == NULL)
+		break;
+
+	    rasprintf(&depname, "%s%s", soname, isElf64 ? "()(64bit)" : "");
+	    /* Add to package dependencies. */
+	    ds = rpmdsSingle(RPMTAG_REQUIRENAME, depname, "", 
+			     RPMSENSE_FIND_REQUIRES);
+	    free(depname);
+
+	    rpmdsMerge(&fc->requires, ds);
+	    rpmfcAddFileDep(&fc->ddict, fc->ix, ds);
+	    ds = rpmdsFree(ds);
+	    break;
+	}
+    }
+exit:
+    if (elf) (void) elf_end(elf);
+    close(fdno);
+    return 0;
+#endif
+    return -1;
+}
+
+/**
  * Extract script dependencies.
  * @param fc		file classifier
  * @return		0 on success
@@ -1097,6 +1196,7 @@ static const struct rpmfcApplyTbl_s cons
     { rpmfcSCRIPT,	(RPMFC_SCRIPT|RPMFC_BOURNE|
 			 RPMFC_PERL|RPMFC_PYTHON|RPMFC_MONO|
 			 RPMFC_PKGCONFIG|RPMFC_LIBTOOL) },
+    { rpmfcSYMLINK,	RPMFC_SYMLINK },
     { NULL, 0 }
 };
 
@@ -1117,6 +1217,7 @@ rpmRC rpmfcApply(rpmfc fc)
     int ix;
     int i;
     int xx;
+    int skipping = 0;
 
     /* Generate package and per-file dependencies. */
     for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
@@ -1171,11 +1272,13 @@ rpmRC rpmfcApply(rpmfc fc)
 	default:
 	    break;
 	case 'P':	
+	    skipping = fc->skipProv;
 	    ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags);
 	    dix = rpmdsFind(fc->provides, ds);
 	    ds = rpmdsFree(ds);
 	    break;
 	case 'R':
+	    skipping = fc->skipReq;
 	    ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags);
 	    dix = rpmdsFind(fc->requires, ds);
 	    ds = rpmdsFree(ds);
@@ -1197,7 +1300,7 @@ assert(dix >= 0);
 	    previx = ix;
 	    xx = argiAdd(&fc->fddictx, ix, argiCount(fc->ddictx)-1);
 	}
-	if (fc->fddictn && fc->fddictn->vals)
+	if (fc->fddictn && fc->fddictn->vals && !skipping)
 	    fc->fddictn->vals[ix]++;
     }
 

rpm-4.7.0-extra-provides.patch:

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


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/rpm/devel/.cvsignore,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- .cvsignore	6 Feb 2009 13:55:13 -0000	1.33
+++ .cvsignore	6 Mar 2009 18:28:20 -0000	1.34
@@ -1 +1 @@
-rpm-4.6.0.tar.bz2
+rpm-4.7.0-beta1.tar.bz2


Index: rpm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rpm/devel/rpm.spec,v
retrieving revision 1.334
retrieving revision 1.335
diff -u -r1.334 -r1.335
--- rpm.spec	27 Feb 2009 09:02:57 -0000	1.334
+++ rpm.spec	6 Mar 2009 18:28:20 -0000	1.335
@@ -4,6 +4,8 @@
 %bcond_with sqlite
 # just for giggles, option to build with internal Berkeley DB
 %bcond_with int_bdb
+# not yet, a missing test-data file in beta1 tarball causes two tests to fail
+%bcond_with check
 
 # switch rpm itself back to md5 file digests until the dust settles a bit
 %define _source_filedigest_algorithm 0
@@ -13,8 +15,9 @@
 
 %define rpmhome /usr/lib/rpm
 
-%define rpmver 4.6.0
-%define srcver %{rpmver}
+%define rpmver 4.7.0
+%define snapver beta1
+%define srcver %{rpmver}-%{snapver}
 
 %define bdbver 4.7.25
 %define dbprefix db
@@ -22,17 +25,17 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: 11%{?dist}
+Release: 0.%{snapver}.1%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
-Source0: http://rpm.org/releases/4.6.x/%{name}-%{srcver}.tar.bz2
+Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
 %if %{with int_bdb}
 Source1: db-%{bdbver}.tar.gz
 %endif
 Source10: desktop-file.prov
 Source11: fontconfig.prov
 
-Patch0: rpm-4.5.90-devel-autodep.patch
+Patch0: rpm-4.7.0-devel-autodep.patch
 Patch1: rpm-4.5.90-pkgconfig-path.patch
 Patch2: rpm-4.5.90-gstreamer-provides.patch
 # Fedora specspo is setup differently than what rpm expects, considering
@@ -40,17 +43,9 @@
 Patch3: rpm-4.6.0-fedora-specspo.patch
 
 # Patches already in upstream
-Patch200: rpm-4.6.0-rc1-defaultdocdir.patch
-Patch201: rpm-4.6.0-inherit-group.patch
-Patch202: rpm-4.6.0-anyarch-actions-fix.patch
-Patch203: rpm-4.6.0-utf-dependencies.patch
-Patch204: rpm-4.6.0-noarch-elf-check.patch
-Patch205: rpm-4.6.0-pkgconfig-reqs.patch
-Patch206: rpm-4.6.0-python-validate.patch
-Patch207: rpm-4.6.0-rpmds-null.patch
 
 # These are not yet upstream
-Patch300: rpm-4.6.0-extra-provides.patch
+Patch300: rpm-4.7.0-extra-provides.patch
 
 # Partially GPL/LGPL dual-licensed and some bits with BSD
 # SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD 
@@ -70,6 +65,10 @@
 BuildRequires: db4-devel = %{bdbver}
 %endif
 
+%if %{with check}
+BuildRequires: fakechroot
+%endif
+
 # XXX generally assumed to be installed but make it explicit as rpm
 # is a bit special...
 BuildRequires: redhat-rpm-config
@@ -93,6 +92,8 @@
 %if %{with sqlite}
 BuildRequires: sqlite-devel
 %endif
+# Not enabling these yet
+# BuildRequires: libcap-devel libacl-devel
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -182,15 +183,6 @@
 %patch2 -p1 -b .gstreamer-prov
 %patch3 -p1 -b .fedora-specspo
 
-%patch200 -p1 -b .defaultdocdir
-%patch201 -p1 -b .inherit-group
-%patch202 -p1 -b .anyarch-actions-fix
-%patch203 -p1 -b .utf-dependencies
-%patch204 -p1 -b .noarch-elf-check
-%patch205 -p1 -b .pkgconfig-reqs
-#%patch206 -p1 -b .python-bytecompile
-%patch207 -p1 -b .rpmds-null
-
 %patch300 -p1 -b .extra-prov
 
 %if %{with int_bdb}
@@ -270,6 +262,11 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with check}
+%check
+make check
+%endif
+
 %post libs -p /sbin/ldconfig
 %postun libs -p /sbin/ldconfig
 
@@ -328,7 +325,7 @@
 
 %files libs
 %defattr(-,root,root)
-%{_libdir}/librpm*-*.so
+%{_libdir}/librpm*.so.*
 
 %files build
 %defattr(-,root,root)
@@ -391,6 +388,9 @@
 %doc doc/librpm/html/*
 
 %changelog
+* Fri Mar 06 2009 Panu Matilainen <pmatilai at redhat.com> - 4.7.0-0.beta1.1
+- update to 4.7.0-beta1 (http://rpm.org/wiki/Releases/4.7.0)
+
 * Fri Feb 27 2009 Panu Matilainen <pmatilai at redhat.com> - 4.6.0-11
 - build rpm itself with md5 file digests for now to ensure upgradability
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/rpm/devel/sources,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -r1.139 -r1.140
--- sources	6 Feb 2009 13:55:13 -0000	1.139
+++ sources	6 Mar 2009 18:28:21 -0000	1.140
@@ -1 +1 @@
-77bf389f87f61ff53b068a9870aa91ca  rpm-4.6.0.tar.bz2
+ea6cf6444b401ed19f4756a1bc279884  rpm-4.7.0-beta1.tar.bz2




More information about the fedora-extras-commits mailing list