diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2012-10-04 13:57:00 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-11-18 16:42:02 +0000 |
commit | 3d8fd40f9f339564d8b7c80e2f60cc4f49826def (patch) | |
tree | c4e614f31c43da4e718514c3b4e185824a005319 | |
parent | 4dd9d39dca1221792f963f7fa74da0d0221f12ef (diff) | |
download | poky-3d8fd40f9f339564d8b7c80e2f60cc4f49826def.tar.gz |
python-smartpm: Add smartpm recipe
This is the initial integration, basic functionality such as 'smart query'
has been tested. Active use of remote feeds and such has not yet been
verified.
Thanks to Paul Eggleton for corrections and bug fixes for the initial
integration.
(From OE-Core rev: 92182ca88aff9cec04b2af5e9babaf33bf61f0af)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
3 files changed, 245 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch new file mode 100644 index 0000000000..b2629ef051 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smart-rpm-root.patch | |||
@@ -0,0 +1,80 @@ | |||
1 | Fix smart RPM backend to handle rpm-dbpath/rpm-root properly | ||
2 | |||
3 | Don't assume that if the dbpath starts with / that it is an absolute | ||
4 | path. This matches the behaviour of rpm itself. (If the root path is | ||
5 | specified and does not start with /, rpm will prepend the root path | ||
6 | twice and fail). | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
11 | |||
12 | diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py | ||
13 | index 7092332..0489e11 100644 | ||
14 | --- a/smart/backends/rpm/base.py | ||
15 | +++ b/smart/backends/rpm/base.py | ||
16 | @@ -46,6 +46,12 @@ __all__ = ["RPMPackage", "RPMProvides", "RPMNameProvides", "RPMPreRequires", | ||
17 | "rpm", "getTS", "getArchScore", "getArchColor", "system_provides", | ||
18 | "collapse_libc_requires"] | ||
19 | |||
20 | +def rpm_join_dbpath(root, dbpath): | ||
21 | + if dbpath.startswith('/') and root: | ||
22 | + return os.path.join(root, dbpath[1:]) | ||
23 | + else: | ||
24 | + return os.path.join(root, dbpath) | ||
25 | + | ||
26 | def getTS(new=False): | ||
27 | rpm_root = os.path.abspath(sysconf.get("rpm-root", "/")) | ||
28 | if not hasattr(getTS, "ts") or getTS.root != rpm_root: | ||
29 | @@ -56,7 +62,7 @@ def getTS(new=False): | ||
30 | #if not sysconf.get("rpm-check-signatures", False): | ||
31 | # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) | ||
32 | rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm") | ||
33 | - dbdir = os.path.join(getTS.root, rpm_dbpath) | ||
34 | + dbdir = rpm_join_dbpath(getTS.root, rpm_dbpath) | ||
35 | if not os.path.isdir(dbdir): | ||
36 | try: | ||
37 | os.makedirs(dbdir) | ||
38 | diff --git a/smart/channels/rpm_sys.py b/smart/channels/rpm_sys.py | ||
39 | index efcb10e..b9fda27 100644 | ||
40 | --- a/smart/channels/rpm_sys.py | ||
41 | +++ b/smart/channels/rpm_sys.py | ||
42 | @@ -20,7 +20,7 @@ | ||
43 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
44 | # | ||
45 | from smart.backends.rpm.header import RPMDBLoader | ||
46 | -from smart.backends.rpm.base import getTS | ||
47 | +from smart.backends.rpm.base import getTS, rpm_join_dbpath | ||
48 | from smart.channel import PackageChannel | ||
49 | from smart import * | ||
50 | import os | ||
51 | @@ -32,9 +32,9 @@ class RPMSysChannel(PackageChannel): | ||
52 | |||
53 | def fetch(self, fetcher, progress): | ||
54 | getTS() # Make sure the db exists. | ||
55 | - path = os.path.join(sysconf.get("rpm-root", "/"), | ||
56 | - sysconf.get("rpm-dbpath", "var/lib/rpm"), | ||
57 | - "Packages") | ||
58 | + dbdir = rpm_join_dbpath(sysconf.get("rpm-root", "/"), | ||
59 | + sysconf.get("rpm-dbpath", "var/lib/rpm")) | ||
60 | + path = os.path.join(dbdir, "Packages") | ||
61 | digest = os.path.getmtime(path) | ||
62 | if digest == self._digest: | ||
63 | return True | ||
64 | diff --git a/smart/plugins/detectsys.py b/smart/plugins/detectsys.py | ||
65 | index 2cd49ad..3959d07 100644 | ||
66 | --- a/smart/plugins/detectsys.py | ||
67 | +++ b/smart/plugins/detectsys.py | ||
68 | @@ -20,10 +20,11 @@ | ||
69 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
70 | # | ||
71 | from smart import * | ||
72 | +from smart.backends.rpm.base import rpm_join_dbpath | ||
73 | import os | ||
74 | |||
75 | def detectRPMSystem(): | ||
76 | - dir = os.path.join(sysconf.get("rpm-root", "/"), | ||
77 | + dir = rpm_join_dbpath(sysconf.get("rpm-root", "/"), | ||
78 | sysconf.get("rpm-dbpath", "var/lib/rpm")) | ||
79 | file = os.path.join(dir, "Packages") | ||
80 | if os.path.exists(file): | ||
diff --git a/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch b/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch new file mode 100644 index 0000000000..9919a941bc --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | RPM5 has removed support for RPMVSF_NOSIGNATURES | ||
2 | |||
3 | Patch smart to no longer use this flag | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
8 | |||
9 | diff -ur smart-1.4.1.orig/smart/backends/rpm/base.py smart-1.4.1/smart/backends/rpm/base.py | ||
10 | --- smart-1.4.1.orig/smart/backends/rpm/base.py 2012-10-04 11:22:11.229351164 -0500 | ||
11 | +++ smart-1.4.1/smart/backends/rpm/base.py 2012-10-04 11:22:44.820170786 -0500 | ||
12 | @@ -53,8 +53,8 @@ | ||
13 | if sysconf.get("rpm-dbpath"): | ||
14 | rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath")) | ||
15 | getTS.ts = rpm.ts(getTS.root) | ||
16 | - if not sysconf.get("rpm-check-signatures", False): | ||
17 | - getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) | ||
18 | + #if not sysconf.get("rpm-check-signatures", False): | ||
19 | + # getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) | ||
20 | rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm") | ||
21 | dbdir = os.path.join(getTS.root, rpm_dbpath) | ||
22 | if not os.path.isdir(dbdir): | ||
23 | @@ -82,8 +82,8 @@ | ||
24 | if sysconf.get("rpm-dbpath"): | ||
25 | rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath")) | ||
26 | ts = rpm.ts(getTS.root) | ||
27 | - if not sysconf.get("rpm-check-signatures", False): | ||
28 | - ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) | ||
29 | + #if not sysconf.get("rpm-check-signatures", False): | ||
30 | + # ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES) | ||
31 | return ts | ||
32 | else: | ||
33 | return getTS.ts | ||
34 | diff -ur smart-1.4.1.orig/smart/plugins/yumchannelsync.py smart-1.4.1/smart/plugins/yumchannelsync.py | ||
35 | --- smart-1.4.1.orig/smart/plugins/yumchannelsync.py 2010-12-06 03:11:05.000000000 -0600 | ||
36 | +++ smart-1.4.1/smart/plugins/yumchannelsync.py 2012-10-04 11:23:09.799350924 -0500 | ||
37 | @@ -56,7 +56,8 @@ | ||
38 | |||
39 | rpmroot = sysconf.get("rpm-root", "/") | ||
40 | ts = rpmUtils.transaction.initReadOnlyTransaction(root=rpmroot) | ||
41 | - ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS)) | ||
42 | + #ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS)) | ||
43 | + ts.pushVSFlags(~(rpm._RPMVSF_NODIGESTS)) | ||
44 | releasever = None | ||
45 | # HACK: we're hard-coding the most used distros, will add more if needed | ||
46 | idx = ts.dbMatch('provides', 'fedora-release') | ||
diff --git a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb new file mode 100644 index 0000000000..bc0c1f9941 --- /dev/null +++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb | |||
@@ -0,0 +1,119 @@ | |||
1 | SUMMARY = "The Smart Package Manager" | ||
2 | |||
3 | DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \ | ||
4 | smart and portable algorithms for solving adequately the problem of managing software \ | ||
5 | upgrades and installation. This tool works in all major distributions and will bring \ | ||
6 | notable advantages over native tools currently in use (APT, APT-RPM, YUM, URPMI, etc)." | ||
7 | |||
8 | HOMEPAGE = "http://smartpm.org/" | ||
9 | SECTION = "devel/python" | ||
10 | LICENSE = "GPLv2" | ||
11 | LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833" | ||
12 | |||
13 | DEPENDS = "python rpm" | ||
14 | PR = "r0" | ||
15 | SRCNAME = "smart" | ||
16 | |||
17 | SRC_URI = "\ | ||
18 | http://launchpad.net/smart/trunk/${PV}/+download/${SRCNAME}-${PV}.tar.bz2 \ | ||
19 | file://smartpm-rpm5-nodig.patch \ | ||
20 | file://smart-rpm-root.patch \ | ||
21 | " | ||
22 | |||
23 | SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6" | ||
24 | SRC_URI[sha256sum] = "b1d519ddb43d60f293b065c28870a5d9e8b591cd49e8c68caea48ace91085eba" | ||
25 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
26 | |||
27 | # Options - rpm, qt4, gtk | ||
28 | PACKAGECONFIG ??= "rpm" | ||
29 | |||
30 | RPM_RDEP = "python-smartpm-backend-rpm" | ||
31 | QT_RDEP = "python-smartpm-interface-qt4" | ||
32 | GTK_RDEP = "python-smartpm-interface-gtk" | ||
33 | |||
34 | RPM_RDEP_virtclass-native = "" | ||
35 | QT_RDEP_virtclass-native = "" | ||
36 | GTK_RDEP_virtclass-native = "" | ||
37 | |||
38 | PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}" | ||
39 | PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}" | ||
40 | PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}" | ||
41 | |||
42 | inherit distutils | ||
43 | |||
44 | do_install_append() { | ||
45 | # Cleanup unused item... | ||
46 | rmdir ${D}${datadir}/share | ||
47 | |||
48 | # We don't support the following items | ||
49 | rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack | ||
50 | rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch | ||
51 | rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt | ||
52 | |||
53 | # Temporary, debian support in OE is missing the python module | ||
54 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py* | ||
55 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py* | ||
56 | rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb | ||
57 | |||
58 | # Disable automatic channel detection | ||
59 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py* | ||
60 | |||
61 | # Disable landscape support | ||
62 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py* | ||
63 | |||
64 | # Disable urpmi channel support | ||
65 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py* | ||
66 | |||
67 | # Disable yum channel support | ||
68 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py* | ||
69 | |||
70 | # Disable zypper channel support | ||
71 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py* | ||
72 | |||
73 | if [ -z "${@base_contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then | ||
74 | rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py* | ||
75 | rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm | ||
76 | fi | ||
77 | |||
78 | if [ -z "${@base_contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then | ||
79 | rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4 | ||
80 | fi | ||
81 | |||
82 | if [ -z "${@base_contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then | ||
83 | rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk | ||
84 | fi | ||
85 | } | ||
86 | |||
87 | PACKAGES = "python-smartpm-dev python-smartpm-dbg python-smartpm-doc smartpm" | ||
88 | PACKAGES += "${@base_contains('PACKAGECONFIG', 'rpm', 'python-smartpm-backend-rpm', '', d)}" | ||
89 | PACKAGES += "${@base_contains('PACKAGECONFIG', 'qt4', 'python-smartpm-interface-qt4', '', d)}" | ||
90 | PACKAGES += "${@base_contains('PACKAGECONFIG', 'gtk', 'python-smartpm-interface-gtk', '', d)}" | ||
91 | PACKAGES += "python-smartpm-interface-images" | ||
92 | PACKAGES += "python-smartpm" | ||
93 | |||
94 | RDEPENDS_smartpm = 'python-smartpm' | ||
95 | |||
96 | RDEPENDS_python-smartpm_append = " virtual/python-smartpm-backend python-codecs python-textutils python-xml" | ||
97 | RDEPENDS_python-smartpm_append += " python-fcntl python-pickle python-crypt python-compression python-shell" | ||
98 | RDEPENDS_python-smartpm_append += " python-resource python-netclient python-threading python-unixadmin" | ||
99 | |||
100 | #RDEPENDS_python-smartpm_append += " python-modules" | ||
101 | |||
102 | RDEPENDS_python-smartpm-backend-rpm = 'python-rpm' | ||
103 | RPROVIDES_python-smartpm-backend-rpm = 'virtual/python-smartpm-backend' | ||
104 | |||
105 | RDEPENDS_python-smartpm-interface-qt4 = 'qt4-x11 python-smartpm-interface-images' | ||
106 | RDEPENDS_python-smartpm-interface-gtk = 'gtk+ python-smartpm-interface-images' | ||
107 | |||
108 | FILES_smartpm = "${bindir}/smart" | ||
109 | |||
110 | FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug" | ||
111 | |||
112 | FILES_python-smartpm-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm" | ||
113 | |||
114 | FILES_python-smartpm-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4" | ||
115 | FILES_python-smartpm-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk" | ||
116 | FILES_python-smartpm-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images" | ||
117 | |||
118 | BBCLASSEXTEND = "native" | ||
119 | |||