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 \ |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 26 | file://smart-cache.py-getPackages-matches-name-version.patch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 27 | " |
| 28 | |
| 29 | SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0" |
| 30 | PV = "1.5+git${SRCPV}" |
| 31 | |
| 32 | S = "${WORKDIR}/git" |
| 33 | |
| 34 | # Options - rpm, qt4, gtk |
| 35 | PACKAGECONFIG ??= "rpm" |
| 36 | |
| 37 | RPM_RDEP = "${PN}-backend-rpm" |
| 38 | QT_RDEP = "${PN}-interface-qt4" |
| 39 | GTK_RDEP = "${PN}-interface-gtk" |
| 40 | |
| 41 | RPM_RDEP_class-native = "" |
| 42 | QT_RDEP_class-native = "" |
| 43 | GTK_RDEP_class-native = "" |
| 44 | |
| 45 | RPM_RDEP_class-nativesdk = "" |
| 46 | QT_RDEP_class-nativesdk = "" |
| 47 | GTK_RDEP_class-nativesdk = "" |
| 48 | |
| 49 | PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}" |
| 50 | PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}" |
| 51 | PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}" |
| 52 | |
| 53 | inherit distutils |
| 54 | |
| 55 | do_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 | |
| 95 | add_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 | |
| 102 | do_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 | |
| 107 | do_install_append_class-nativesdk() { |
| 108 | add_native_wrapper |
| 109 | } |
| 110 | |
| 111 | PACKAGES = "${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 | |
| 117 | RDEPENDS_smartpm = "${PN}" |
| 118 | |
| 119 | RDEPENDS_${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" |
| 122 | RDEPENDS_${PN}_class-native = "" |
| 123 | |
| 124 | RDEPENDS_${PN}-backend-rpm = "python-rpm" |
| 125 | |
| 126 | RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images" |
| 127 | RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images" |
| 128 | |
| 129 | FILES_smartpm = "${bindir}/smart" |
| 130 | |
| 131 | FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug" |
| 132 | |
| 133 | FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm" |
| 134 | |
| 135 | FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4" |
| 136 | FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk" |
| 137 | FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images" |
| 138 | |
| 139 | BBCLASSEXTEND = "native nativesdk" |
| 140 | |