summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
blob: b3b471a8b1c29e8ab9917efedec334aa9f01a70f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
SUMMARY = "The Smart Package Manager"
DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \
smart and portable algorithms for solving adequately the problem of managing software \
upgrades and installation."

HOMEPAGE = "http://labix.org/smart/"
SECTION = "devel/python"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"

DEPENDS = "python rpm gettext-native"
PR = "r9"
SRCNAME = "smart"

SRC_URI = "\
          http://launchpad.net/smart/trunk/${PV}/+download/${SRCNAME}-${PV}.tar.bz2 \
          file://smartpm-rpm5-nodig.patch \
          file://smart-rpm-root.patch \
          file://smart-recommends.patch \
          file://smart-rpm-extra-macros.patch \
          file://smart-dflags.patch \
          file://smart-rpm-md-parse.patch \
          file://smart-tmpdir.patch \
          file://smart-metadata-match.patch \
          file://smart-improve-error-reporting.patch \
          file://smart-multilib-fixes.patch \
          file://smart-yaml-error.patch \
          file://smart-channelsdir.patch \
          file://smart-conflict-provider.patch \
          file://smart-flag-ignore-recommends.patch \
          file://smart-flag-exclude-packages.patch \
          "

SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6"
SRC_URI[sha256sum] = "b1d519ddb43d60f293b065c28870a5d9e8b591cd49e8c68caea48ace91085eba"
S = "${WORKDIR}/${SRCNAME}-${PV}"

# Options - rpm, qt4, gtk
PACKAGECONFIG ??= "rpm"

RPM_RDEP = "${PN}-backend-rpm"
QT_RDEP = "${PN}-interface-qt4"
GTK_RDEP = "${PN}-interface-gtk"

RPM_RDEP_class-native = ""
QT_RDEP_class-native = ""
GTK_RDEP_class-native = ""

PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}"
PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}"
PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}"

inherit distutils

do_install_append() {
   # We don't support the following items
   rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack
   rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch
   rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt

   # Temporary, debian support in OE is missing the python module
   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py*
   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py*
   rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb

   # Disable automatic channel detection
   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py*

   # Disable landscape support
   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py*

   # Disable urpmi channel support
   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py*

   # Disable yum channel support
   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py*

   # Disable zypper channel support
   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py*

   if [ -z "${@base_contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
      rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py*
      rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm
   fi

   if [ -z "${@base_contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
      rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4
   fi

   if [ -z "${@base_contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
      rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk
   fi
}

add_native_wrapper() {
        create_wrapper ${D}/${bindir}/smart \
		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
}

do_install_append_class-native() {
        add_native_wrapper
}

do_install_append_class-nativesdk() {
        add_native_wrapper
}

PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
            ${@base_contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
            ${@base_contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
            ${@base_contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \
            ${PN}-interface-images ${PN}"

RDEPENDS_smartpm = "${PN}"

RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \
                   python-pickle python-crypt python-compression python-shell \
                   python-resource python-netclient python-threading python-unixadmin python-pprint"
RDEPENDS_${PN}_class-native = ""

RDEPENDS_${PN}-backend-rpm = "python-rpm"

RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images"
RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"

FILES_smartpm = "${bindir}/smart"

FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug"

FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm"

FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4"
FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk"
FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"

BBCLASSEXTEND = "native"