blob: 861910cc29513d92f4f92890b7cc8687faa738ee [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 \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016 file://smart-recommends.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017 file://smart-channelsdir.patch \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060018 file://smart-rpm-transaction-failure-check.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019 file://smart-attempt.patch \
20 file://smart-attempt-fix.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050021 file://smart-add-for-rpm-ignoresize-check.patch \
22 file://smart-already-installed-message.patch \
23 file://smart-set-noprogress-for-pycurl.patch \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050024 file://smart-cache.py-getPackages-matches-name-version.patch \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060025 file://smart-channel-remove-all.patch \
26 file://smart-locale.patch \
27 file://smartpm-rpm5-support-check-signatures.patch \
28 file://smart-add-deugging-when-targetpath-is-empty.patch \
29 file://channels-rpm_sys-use-md5sum-instead-of-mtime-as-the-.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030 "
31
32SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0"
33PV = "1.5+git${SRCPV}"
34
35S = "${WORKDIR}/git"
36
37# Options - rpm, qt4, gtk
38PACKAGECONFIG ??= "rpm"
39
40RPM_RDEP = "${PN}-backend-rpm"
41QT_RDEP = "${PN}-interface-qt4"
42GTK_RDEP = "${PN}-interface-gtk"
43
44RPM_RDEP_class-native = ""
45QT_RDEP_class-native = ""
46GTK_RDEP_class-native = ""
47
48RPM_RDEP_class-nativesdk = ""
49QT_RDEP_class-nativesdk = ""
50GTK_RDEP_class-nativesdk = ""
51
52PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}"
53PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}"
54PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}"
55
56inherit distutils
57
58do_install_append() {
59 # We don't support the following items
Patrick Williamsc0f7c042017-02-23 20:41:17 -060060 rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/slack
61 rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/arch
62 rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063
64 # Temporary, debian support in OE is missing the python module
Patrick Williamsc0f7c042017-02-23 20:41:17 -060065 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/aptchannelsync.py*
66 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/debdir.py*
67 rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/deb
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068
69 # Disable automatic channel detection
Patrick Williamsc0f7c042017-02-23 20:41:17 -060070 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/detectsys.py*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071
72 # Disable landscape support
Patrick Williamsc0f7c042017-02-23 20:41:17 -060073 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/landscape.py*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074
75 # Disable urpmi channel support
Patrick Williamsc0f7c042017-02-23 20:41:17 -060076 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/urpmichannelsync.py*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077
78 # Disable yum channel support
Patrick Williamsc0f7c042017-02-23 20:41:17 -060079 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/yumchannelsync.py*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050080
81 # Disable zypper channel support
Patrick Williamsc0f7c042017-02-23 20:41:17 -060082 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/zyppchannelsync.py*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083
84 if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060085 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/smart/plugins/rpmdir.py*
86 rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/backends/rpm
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087 fi
88
89 if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060090 rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt4
Patrick Williamsc124f4f2015-09-15 14:41:29 -050091 fi
92
93 if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060094 rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/gtk
Patrick Williamsc124f4f2015-09-15 14:41:29 -050095 fi
96}
97
98add_native_wrapper() {
99 create_wrapper ${D}/${bindir}/smart \
100 RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
101 RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
102 RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
103}
104
105do_install_append_class-native() {
106 sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/smart
107 add_native_wrapper
108}
109
110do_install_append_class-nativesdk() {
111 add_native_wrapper
112}
113
114PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
115 ${@bb.utils.contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
116 ${@bb.utils.contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
117 ${@bb.utils.contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \
118 ${PN}-interface-images ${PN}"
119
120RDEPENDS_smartpm = "${PN}"
121
122RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \
123 python-pickle python-crypt python-compression python-shell \
124 python-resource python-netclient python-threading python-unixadmin python-pprint"
125RDEPENDS_${PN}_class-native = ""
126
127RDEPENDS_${PN}-backend-rpm = "python-rpm"
128
129RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images"
130RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"
131
132FILES_smartpm = "${bindir}/smart"
133
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600134FILES_${PN}-backend-rpm = "${PYTHON_SITEPACKAGES_DIR}/smart/backends/rpm"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500135
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600136FILES_${PN}-interface-qt4 = "${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/qt4"
137FILES_${PN}-interface-gtk = "${PYTHON_SITEPACKAGES_DIR}/smart/interfaces/gtk"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500138FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"
139
140BBCLASSEXTEND = "native nativesdk"
141