Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "LSB support for OpenEmbedded" |
| 2 | SECTION = "console/utils" |
| 3 | HOMEPAGE = "http://prdownloads.sourceforge.net/lsb" |
| 4 | LICENSE = "GPLv2+" |
| 5 | PR = "r2" |
| 6 | |
| 7 | LSB_CORE = "lsb-core-${TARGET_ARCH}" |
| 8 | LSB_CORE_x86 = "lsb-core-ia32" |
| 9 | LSB_CORE_x86-64 = "lsb-core-amd64" |
| 10 | RPROVIDES_${PN} += "${LSB_CORE}" |
| 11 | |
Patrick Williams | f1e5d69 | 2016-03-30 15:21:19 -0500 | [diff] [blame] | 12 | # lsb_release needs getopt, lsbinitscripts |
| 13 | RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | |
| 15 | LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf" |
| 16 | |
| 17 | SRC_URI = "${SOURCEFORGE_MIRROR}/project/lsb/lsb_release/1.4/lsb-release-1.4.tar.gz \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 18 | file://0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | file://init-functions \ |
| 20 | file://lsb_killproc \ |
| 21 | file://lsb_log_message \ |
| 22 | file://lsb_pidofproc \ |
| 23 | file://lsb_start_daemon \ |
| 24 | " |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 25 | UPSTREAM_VERSION_UNKNOWN = "1" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 26 | |
| 27 | SRC_URI[md5sum] = "30537ef5a01e0ca94b7b8eb6a36bb1e4" |
| 28 | SRC_URI[sha256sum] = "99321288f8d62e7a1d485b7c6bdccf06766fb8ca603c6195806e4457fdf17172" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 29 | |
| 30 | UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lsb/files/lsb_release/" |
| 31 | UPSTREAM_CHECK_REGEX = "/lsb_release/(?P<pver>(\d+[\.\-_]*)+)/" |
| 32 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 33 | S = "${WORKDIR}/lsb-release-1.4" |
| 34 | |
| 35 | CLEANBROKEN = "1" |
| 36 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 37 | do_install() { |
| 38 | oe_runmake install prefix=${D}${base_prefix} mandir=${D}${datadir}/man/ DESTDIR=${D} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 39 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 40 | # these two dirs are needed by package lsb-dist-checker |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 41 | mkdir -p ${D}${sysconfdir}/opt |
| 42 | mkdir -p ${D}${localstatedir}/opt |
| 43 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 44 | mkdir -p ${D}${base_libdir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 45 | mkdir -p ${D}${sysconfdir}/lsb-release.d |
| 46 | printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release |
| 47 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 48 | if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 49 | printf "core-4.1-ia32" >> ${D}${sysconfdir}/lsb-release |
| 50 | else |
| 51 | printf "core-4.1-${TARGET_ARCH}" >> ${D}${sysconfdir}/lsb-release |
| 52 | fi |
| 53 | echo "\"" >> ${D}${sysconfdir}/lsb-release |
| 54 | echo "DISTRIB_ID=${DISTRO}" >> ${D}${sysconfdir}/lsb-release |
| 55 | echo "DISTRIB_RELEASE=${DISTRO_VERSION}" >> ${D}${sysconfdir}/lsb-release |
| 56 | if [ -n "${DISTRO_CODENAME}" ]; then |
| 57 | echo "DISTRIB_CODENAME=${DISTRO_CODENAME}" >> ${D}${sysconfdir}/lsb-release |
| 58 | fi |
| 59 | echo "DISTRIB_DESCRIPTION=\"${DISTRO_NAME} ${DISTRO_VERSION}\"" >> ${D}${sysconfdir}/lsb-release |
| 60 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 61 | if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 62 | mkdir -p ${D}${sysconfdir}/lsb-release.d |
| 63 | touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch |
| 64 | touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-noarch |
| 65 | touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ia32 |
| 66 | touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ia32 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 67 | elif [ "${TARGET_ARCH}" = "x86_64" ]; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 68 | touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch |
| 69 | touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-amd64 |
| 70 | touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-amd64 |
| 71 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 72 | if [ "${TARGET_ARCH}" = "powerpc" ]; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch |
| 74 | touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc32 |
| 75 | touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc32 |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 76 | elif [ "${TARGET_ARCH}" = "powerpc64" ]; then |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch |
| 78 | touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc64 |
| 79 | touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc64 |
| 80 | fi |
| 81 | } |
| 82 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 83 | do_install_append() { |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 84 | install -d ${D}${sysconfdir}/core-lsb |
| 85 | for i in lsb_killproc lsb_log_message lsb_pidofproc lsb_start_daemon |
| 86 | do |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 87 | install -m 0755 ${WORKDIR}/$i ${D}${sysconfdir}/core-lsb |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 88 | done |
| 89 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 90 | install -d ${D}${nonarch_base_libdir}/lsb |
| 91 | install -m 0755 ${WORKDIR}/init-functions ${D}${nonarch_base_libdir}/lsb |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 92 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 93 | # create links for LSB test |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 94 | if [ -e ${sbindir}/chkconfig ]; then |
| 95 | if [ "${nonarch_base_libdir}" != "${nonarch_libdir}" ] ; then |
| 96 | install -d ${D}${nonarch_libdir}/lsb |
| 97 | fi |
| 98 | ln -sf ${sbindir}/chkconfig ${D}${nonarch_libdir}/lsb/install_initd |
| 99 | ln -sf ${sbindir}/chkconfig ${D}${nonarch_libdir}/lsb/remove_initd |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 100 | fi |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 102 | if [ "${TARGET_ARCH}" = "x86_64" ]; then |
| 103 | if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then |
| 104 | lnr ${D}${base_libdir} ${D}${base_prefix}/lib64 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 105 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 106 | cd ${D}${base_libdir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 107 | ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2 |
| 108 | ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3 |
| 109 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 110 | if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then |
| 111 | cd ${D}${base_libdir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 112 | ln -sf ld-linux.so.2 ld-lsb.so.2 |
| 113 | ln -sf ld-linux.so.2 ld-lsb.so.3 |
| 114 | fi |
| 115 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 116 | if [ "${TARGET_ARCH}" = "powerpc64" ]; then |
| 117 | if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then |
| 118 | lnr ${D}${base_libdir} ${D}${base_prefix}/lib64 |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 119 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 120 | cd ${D}${base_libdir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 121 | ln -sf ld64.so.1 ld-lsb-ppc64.so.2 |
| 122 | ln -sf ld64.so.1 ld-lsb-ppc64.so.3 |
| 123 | fi |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 124 | if [ "${TARGET_ARCH}" = "powerpc" ]; then |
| 125 | cd ${D}${base_libdir} |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 126 | ln -sf ld.so.1 ld-lsb-ppc32.so.2 |
| 127 | ln -sf ld.so.1 ld-lsb-ppc32.so.3 |
| 128 | fi |
| 129 | } |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 130 | |
| 131 | FILES_${PN} += "${@'${base_prefix}/lib64' if d.getVar('TARGET_ARCH') == ('x86_64' or 'powerpc64') and '${base_libdir}' != '${base_prefix}/lib64' else ''} \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 132 | ${base_libdir} \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 133 | ${nonarch_libdir}/lsb \ |
| 134 | ${nonarch_base_libdir}/lsb/* \ |
| 135 | " |