rpm 4.5.90 here we come...

- spec largely rewritten and changelog truncated, too many changes to list
    here
- only provides are extracted for libtool and pkgconfig dependencies
    initially to avoid creating unsolvable dependencies
- just a couple of patches left over from F9
- building against BDB 4.5.20 for compatibility in case we need to go
    backwards
This commit is contained in:
Panu Matilainen 2008-07-11 15:54:19 +00:00
parent 172a33ecd1
commit cbac7f35a8
6 changed files with 355 additions and 693 deletions

View File

@ -1 +1 @@
rpm-4.4.2.3.tar.gz rpm-4.5.90.git8426.tar.bz2

View File

@ -0,0 +1,158 @@
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 3cc2d6d..84d1e8a 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -522,7 +522,7 @@ static const struct rpmfcTokens_s const rpmfcTokens[] = {
{ "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 },
@@ -683,6 +683,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
@@ -1115,6 +1214,7 @@ static const struct rpmfcApplyTbl_s const rpmfcApplyTable[] = {
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_PKGCONFIG) },
{ rpmfcSCRIPT, (RPMFC_SCRIPT|RPMFC_LIBTOOL) },
{ rpmfcSCRIPT, RPMFC_MONO },
+ { rpmfcSYMLINK, RPMFC_SYMLINK },
{ NULL, 0 }
};
@@ -1135,6 +1235,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++) {
@@ -1185,11 +1286,13 @@ assert(se != NULL);
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);
@@ -1211,7 +1314,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]++;
}

View File

@ -0,0 +1,13 @@
diff --git a/macros.in b/macros.in
index 830072a..bdce7f4 100644
--- a/macros.in
+++ b/macros.in
@@ -805,6 +805,8 @@ print (t)\
export RPM_BUILD_ROOT}\
%{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
export CLASSPATH}\
+ PKG_CONFIG_PATH=\"%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
+ export PKG_CONFIG_PATH\
\
%{verbose:set -x}%{!verbose:exec > /dev/null}\
umask 022\

View File

@ -0,0 +1,17 @@
diff --git a/macros.in b/macros.in
index 830072a..e75ca18 100644
--- a/macros.in
+++ b/macros.in
@@ -460,10 +460,10 @@ print (t)\
%__mono_requires @RPMCONFIGDIR@/mono-find-requires %{_builddir}/%{?buildsubdir} %{buildroot} %{_libdir}
%__libtool_provides @RPMCONFIGDIR@/libtooldeps.sh --provides %{buildroot} %{name}
-%__libtool_requires @RPMCONFIGDIR@/libtooldeps.sh --requires %{buildroot} %{name}
+#%__libtool_requires @RPMCONFIGDIR@/libtooldeps.sh --requires %{buildroot} %{name}
%__pkgconfig_provides @RPMCONFIGDIR@/pkgconfigdeps.sh --provides
-%__pkgconfig_requires @RPMCONFIGDIR@/pkgconfigdeps.sh --requires
+#%__pkgconfig_requires @RPMCONFIGDIR@/pkgconfigdeps.sh --requires
#==============================================================================
# ---- Database configuration macros.

856
rpm.spec

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
b8f0661ac765ce1a2de66ca53e37af83 rpm-4.4.2.3.tar.gz 019294e156d2a3acefee118e38f65836 rpm-4.5.90.git8426.tar.bz2