blob: d9a908db2e2181efccce1559042cf7ef12bbc156 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "The Smart Package Manager"
2DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \
3smart and portable algorithms for solving adequately the problem of managing software \
4upgrades and installation."
5
6HOMEPAGE = "http://labix.org/smart/"
7SECTION = "devel/python"
8LICENSE = "GPLv2"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
10
11DEPENDS = "python rpm gettext-native python-rpm"
12SRCNAME = "smart"
13
14SRC_URI = "\
15 git://github.com/smartpm/smart.git \
16 file://smartpm-rpm5-nodig.patch \
17 file://smart-recommends.patch \
18 file://smart-improve-error-reporting.patch \
19 file://smart-channelsdir.patch \
20 file://smart-attempt.patch \
21 file://smart-attempt-fix.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022 file://smart-add-for-rpm-ignoresize-check.patch \
23 file://smart-already-installed-message.patch \
24 file://smart-set-noprogress-for-pycurl.patch \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050025 file://smart-cache.py-getPackages-matches-name-version.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026 "
27
28SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0"
29PV = "1.5+git${SRCPV}"
30
31S = "${WORKDIR}/git"
32
33# Options - rpm, qt4, gtk
34PACKAGECONFIG ??= "rpm"
35
36RPM_RDEP = "${PN}-backend-rpm"
37QT_RDEP = "${PN}-interface-qt4"
38GTK_RDEP = "${PN}-interface-gtk"
39
40RPM_RDEP_class-native = ""
41QT_RDEP_class-native = ""
42GTK_RDEP_class-native = ""
43
44RPM_RDEP_class-nativesdk = ""
45QT_RDEP_class-nativesdk = ""
46GTK_RDEP_class-nativesdk = ""
47
48PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}"
49PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}"
50PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}"
51
52inherit distutils
53
54do_install_append() {
55 # We don't support the following items
56 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack
57 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch
58 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt
59
60 # Temporary, debian support in OE is missing the python module
61 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py*
62 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py*
63 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb
64
65 # Disable automatic channel detection
66 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py*
67
68 # Disable landscape support
69 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py*
70
71 # Disable urpmi channel support
72 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py*
73
74 # Disable yum channel support
75 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py*
76
77 # Disable zypper channel support
78 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py*
79
80 if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
81 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py*
82 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm
83 fi
84
85 if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
86 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4
87 fi
88
89 if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
90 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk
91 fi
92}
93
94add_native_wrapper() {
95 create_wrapper ${D}/${bindir}/smart \
96 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
97 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
98 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
99}
100
101do_install_append_class-native() {
102 sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/smart
103 add_native_wrapper
104}
105
106do_install_append_class-nativesdk() {
107 add_native_wrapper
108}
109
110PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
111 ${@bb.utils.contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
112 ${@bb.utils.contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
113 ${@bb.utils.contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \
114 ${PN}-interface-images ${PN}"
115
116RDEPENDS_smartpm = "${PN}"
117
118RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \
119 python-pickle python-crypt python-compression python-shell \
120 python-resource python-netclient python-threading python-unixadmin python-pprint"
121RDEPENDS_${PN}_class-native = ""
122
123RDEPENDS_${PN}-backend-rpm = "python-rpm"
124
125RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images"
126RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"
127
128FILES_smartpm = "${bindir}/smart"
129
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500130FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm"
131
132FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4"
133FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk"
134FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"
135
136BBCLASSEXTEND = "native nativesdk"
137