blob: d6c378bcfde3b9d56f7cabc619c1a7697af9dc5e [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 \
22 file://smart-rpm4-fixes.patch \
23 file://smart-add-for-rpm-ignoresize-check.patch \
24 file://smart-already-installed-message.patch \
25 file://smart-set-noprogress-for-pycurl.patch \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050026 file://smart-cache.py-getPackages-matches-name-version.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050027 "
28
29SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0"
30PV = "1.5+git${SRCPV}"
31
32S = "${WORKDIR}/git"
33
34# Options - rpm, qt4, gtk
35PACKAGECONFIG ??= "rpm"
36
37RPM_RDEP = "${PN}-backend-rpm"
38QT_RDEP = "${PN}-interface-qt4"
39GTK_RDEP = "${PN}-interface-gtk"
40
41RPM_RDEP_class-native = ""
42QT_RDEP_class-native = ""
43GTK_RDEP_class-native = ""
44
45RPM_RDEP_class-nativesdk = ""
46QT_RDEP_class-nativesdk = ""
47GTK_RDEP_class-nativesdk = ""
48
49PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}"
50PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}"
51PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}"
52
53inherit distutils
54
55do_install_append() {
56 # We don't support the following items
57 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack
58 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch
59 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt
60
61 # Temporary, debian support in OE is missing the python module
62 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py*
63 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py*
64 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb
65
66 # Disable automatic channel detection
67 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py*
68
69 # Disable landscape support
70 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py*
71
72 # Disable urpmi channel support
73 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py*
74
75 # Disable yum channel support
76 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py*
77
78 # Disable zypper channel support
79 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py*
80
81 if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
82 rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py*
83 rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm
84 fi
85
86 if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
87 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4
88 fi
89
90 if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
91 rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk
92 fi
93}
94
95add_native_wrapper() {
96 create_wrapper ${D}/${bindir}/smart \
97 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
98 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
99 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
100}
101
102do_install_append_class-native() {
103 sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/smart
104 add_native_wrapper
105}
106
107do_install_append_class-nativesdk() {
108 add_native_wrapper
109}
110
111PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
112 ${@bb.utils.contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
113 ${@bb.utils.contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
114 ${@bb.utils.contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \
115 ${PN}-interface-images ${PN}"
116
117RDEPENDS_smartpm = "${PN}"
118
119RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \
120 python-pickle python-crypt python-compression python-shell \
121 python-resource python-netclient python-threading python-unixadmin python-pprint"
122RDEPENDS_${PN}_class-native = ""
123
124RDEPENDS_${PN}-backend-rpm = "python-rpm"
125
126RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images"
127RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"
128
129FILES_smartpm = "${bindir}/smart"
130
131FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug"
132
133FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm"
134
135FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4"
136FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk"
137FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"
138
139BBCLASSEXTEND = "native nativesdk"
140