summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/sat-solver/sat-solver/sat-solver_rpm5.patch
blob: d59c5136ea406b2cf3d1fc0b27fa7569aefb6573 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Upstream-Status: Pending

Add RPM5 configuration support

Update the cmake configuration to detect additional files needed by RPM5.

Original work by Qing He <qing.he@intel.com>.

Merged and updated to make this more likely to be accepted upstream.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>

diff -ur git.orig/CMakeLists.txt git/CMakeLists.txt
--- git.orig/CMakeLists.txt	2011-03-16 16:16:29.152786178 -0500
+++ git/CMakeLists.txt	2011-03-16 16:29:43.532032285 -0500
@@ -50,7 +50,16 @@
 ADD_DEFINITIONS( -DMULTI_SEMANTICS)
 ENDIF ( MULTI_SEMANTICS )
 
-IF ( NOT DEBIAN )
+if ( RPM5 )
+MESSAGE(STATUS "Enabling RPM 5 support")
+ADD_DEFINITIONS( -DRPM5)
+
+FIND_PACKAGE(PkgConfig REQUIRED)
+PKG_CHECK_MODULES(RPM REQUIRED rpm)
+INCLUDE_DIRECTORIES( ${RPM_INCLUDE_DIRS} )
+ENDIF ( RPM5 )
+
+IF ( RPM5 OR NOT DEBIAN )
 FIND_LIBRARY(RPMDB_LIBRARY NAMES rpmdb)
 IF ( NOT RPMDB_LIBRARY )
 FIND_LIBRARY(RPMDB_LIBRARY NAMES rpm)
@@ -59,13 +68,17 @@
 IF ( RPMIO_LIBRARY )
 SET( RPMDB_LIBRARY ${RPMIO_LIBRARY} ${RPMDB_LIBRARY} )
 ENDIF ( RPMIO_LIBRARY )
-IF ( FEDORA )
+FIND_LIBRARY(RPMMISC_LIBRARY NAMES rpmmisc)
+IF ( RPMMISC_LIBRARY )
+SET ( RPMDB_LIBRARY ${RPMMISC_LIBRARY} ${RPMDB_LIBRARY} )
+ENDIF ( RPMMISC_LIBRARY )
+IF ( RPM5 OR FEDORA )
 FIND_LIBRARY(DB_LIBRARY NAMES db)
 IF ( DB_LIBRARY )
 SET( RPMDB_LIBRARY ${DB_LIBRARY} ${RPMDB_LIBRARY} )
 ENDIF ( DB_LIBRARY )
-ENDIF ( FEDORA )
-ENDIF ( NOT DEBIAN )
+ENDIF ( RPM5 OR FEDORA )
+ENDIF ( RPM5 OR NOT DEBIAN )
 
 INCLUDE ( CheckFunctionExists )
 INCLUDE ( TestBigEndian )
diff -ur git.orig/ext/repo_rpmdb.c git/ext/repo_rpmdb.c
--- git.orig/ext/repo_rpmdb.c	2011-03-16 18:03:55.401907738 -0500
+++ git/ext/repo_rpmdb.c	2011-03-16 18:04:47.472989651 -0500
@@ -3039,7 +3039,11 @@
   repodata_set_str(data, s - s->repo->pool->solvables, PUBKEY_KEYID, keyid);
   if (dig->pubkey.userid)
     setutf8string(data, s - s->repo->pool->solvables, SOLVABLE_SUMMARY, dig->pubkey.userid);
+#ifndef RPM5
   (void)pgpFreeDig(dig);
+#else
+  (void)pgpDigFree(dig);
+#endif
   sat_free((void *)pkts);
   return 1;
 }