Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "The Smart Package Manager" |
| 2 | DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \ |
| 3 | smart and portable algorithms for solving adequately the problem of managing software \ |
| 4 | upgrades and installation." |
| 5 | |
| 6 | HOMEPAGE = "http://labix.org/smart/" |
| 7 | SECTION = "devel/python" |
| 8 | LICENSE = "GPLv2" |
| 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833" |
| 10 | |
| 11 | DEPENDS = "python rpm gettext-native python-rpm" |
| 12 | SRCNAME = "smart" |
| 13 | |
| 14 | SRC_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 \ |
| 26 | " |
| 27 | |
| 28 | SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0" |
| 29 | PV = "1.5+git${SRCPV}" |
| 30 | |
| 31 | S = "${WORKDIR}/git" |
| 32 | |
| 33 | # Options - rpm, qt4, gtk |
| 34 | PACKAGECONFIG ??= "rpm" |
| 35 | |
| 36 | RPM_RDEP = "${PN}-backend-rpm" |
| 37 | QT_RDEP = "${PN}-interface-qt4" |
| 38 | GTK_RDEP = "${PN}-interface-gtk" |
| 39 | |
| 40 | RPM_RDEP_class-native = "" |
| 41 | QT_RDEP_class-native = "" |
| 42 | GTK_RDEP_class-native = "" |
| 43 | |
| 44 | RPM_RDEP_class-nativesdk = "" |
| 45 | QT_RDEP_class-nativesdk = "" |
| 46 | GTK_RDEP_class-nativesdk = "" |
| 47 | |
| 48 | PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}" |
| 49 | PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}" |
| 50 | PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}" |
| 51 | |
| 52 | inherit distutils |
| 53 | |
| 54 | do_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 | |
| 94 | add_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 | |
| 101 | do_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 | |
| 106 | do_install_append_class-nativesdk() { |
| 107 | add_native_wrapper |
| 108 | } |
| 109 | |
| 110 | PACKAGES = "${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 | |
| 116 | RDEPENDS_smartpm = "${PN}" |
| 117 | |
| 118 | RDEPENDS_${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" |
| 121 | RDEPENDS_${PN}_class-native = "" |
| 122 | |
| 123 | RDEPENDS_${PN}-backend-rpm = "python-rpm" |
| 124 | |
| 125 | RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images" |
| 126 | RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images" |
| 127 | |
| 128 | FILES_smartpm = "${bindir}/smart" |
| 129 | |
| 130 | FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug" |
| 131 | |
| 132 | FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm" |
| 133 | |
| 134 | FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4" |
| 135 | FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk" |
| 136 | FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images" |
| 137 | |
| 138 | BBCLASSEXTEND = "native nativesdk" |
| 139 | |