blob: 07856108b04344311bdf5fd41d6d65e07e775c3a [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "LSB support for OpenEmbedded"
2SECTION = "console/utils"
3HOMEPAGE = "http://prdownloads.sourceforge.net/lsb"
4LICENSE = "GPLv2+"
5PR = "r2"
6
7LSB_CORE = "lsb-core-${TARGET_ARCH}"
8LSB_CORE_x86 = "lsb-core-ia32"
9LSB_CORE_x86-64 = "lsb-core-amd64"
10RPROVIDES_${PN} += "${LSB_CORE}"
11
Patrick Williamsf1e5d692016-03-30 15:21:19 -050012# lsb_release needs getopt, lsbinitscripts
13RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt} lsbinitscripts"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014
15LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
16
17SRC_URI = "${SOURCEFORGE_MIRROR}/project/lsb/lsb_release/1.4/lsb-release-1.4.tar.gz \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018 file://0001-fix-lsb_release-to-work-with-busybox-head-and-find.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019 file://init-functions \
20 file://lsb_killproc \
21 file://lsb_log_message \
22 file://lsb_pidofproc \
23 file://lsb_start_daemon \
24 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050025UPSTREAM_VERSION_UNKNOWN = "1"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026
27SRC_URI[md5sum] = "30537ef5a01e0ca94b7b8eb6a36bb1e4"
28SRC_URI[sha256sum] = "99321288f8d62e7a1d485b7c6bdccf06766fb8ca603c6195806e4457fdf17172"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050029
30UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lsb/files/lsb_release/"
31UPSTREAM_CHECK_REGEX = "/lsb_release/(?P<pver>(\d+[\.\-_]*)+)/"
32
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033S = "${WORKDIR}/lsb-release-1.4"
34
35CLEANBROKEN = "1"
36
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037do_install() {
38 oe_runmake install prefix=${D}${base_prefix} mandir=${D}${datadir}/man/ DESTDIR=${D}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039
Brad Bishop6e60e8b2018-02-01 10:27:11 -050040 # these two dirs are needed by package lsb-dist-checker
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041 mkdir -p ${D}${sysconfdir}/opt
42 mkdir -p ${D}${localstatedir}/opt
43
Brad Bishop6e60e8b2018-02-01 10:27:11 -050044 mkdir -p ${D}${base_libdir}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045 mkdir -p ${D}${sysconfdir}/lsb-release.d
46 printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
47
Brad Bishop6e60e8b2018-02-01 10:27:11 -050048 if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050049 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 Bishop6e60e8b2018-02-01 10:27:11 -050061 if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050062 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 Bishop6e60e8b2018-02-01 10:27:11 -050067 elif [ "${TARGET_ARCH}" = "x86_64" ]; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068 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 Bishop6e60e8b2018-02-01 10:27:11 -050072 if [ "${TARGET_ARCH}" = "powerpc" ]; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073 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 Bishop6e60e8b2018-02-01 10:27:11 -050076 elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077 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 Bishop6e60e8b2018-02-01 10:27:11 -050083do_install_append() {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084 install -d ${D}${sysconfdir}/core-lsb
85 for i in lsb_killproc lsb_log_message lsb_pidofproc lsb_start_daemon
86 do
Brad Bishop6e60e8b2018-02-01 10:27:11 -050087 install -m 0755 ${WORKDIR}/$i ${D}${sysconfdir}/core-lsb
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088 done
89
Brad Bishop6e60e8b2018-02-01 10:27:11 -050090 install -d ${D}${nonarch_base_libdir}/lsb
91 install -m 0755 ${WORKDIR}/init-functions ${D}${nonarch_base_libdir}/lsb
Patrick Williamsc124f4f2015-09-15 14:41:29 -050092
Brad Bishop6e60e8b2018-02-01 10:27:11 -050093 # create links for LSB test
Brad Bishopd7bf8c12018-02-25 22:55:05 -050094 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 Bishop6e60e8b2018-02-01 10:27:11 -0500100 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500101
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500102 if [ "${TARGET_ARCH}" = "x86_64" ]; then
103 if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then
104 lnr ${D}${base_libdir} ${D}${base_prefix}/lib64
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500105 fi
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500106 cd ${D}${base_libdir}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500107 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 Bishop6e60e8b2018-02-01 10:27:11 -0500110 if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ]; then
111 cd ${D}${base_libdir}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500112 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 Bishop6e60e8b2018-02-01 10:27:11 -0500116 if [ "${TARGET_ARCH}" = "powerpc64" ]; then
117 if [ "${base_libdir}" != "${base_prefix}/lib64" ]; then
118 lnr ${D}${base_libdir} ${D}${base_prefix}/lib64
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500119 fi
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500120 cd ${D}${base_libdir}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500121 ln -sf ld64.so.1 ld-lsb-ppc64.so.2
122 ln -sf ld64.so.1 ld-lsb-ppc64.so.3
123 fi
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500124 if [ "${TARGET_ARCH}" = "powerpc" ]; then
125 cd ${D}${base_libdir}
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500126 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 Bishop6e60e8b2018-02-01 10:27:11 -0500130
131FILES_${PN} += "${@'${base_prefix}/lib64' if d.getVar('TARGET_ARCH') == ('x86_64' or 'powerpc64') and '${base_libdir}' != '${base_prefix}/lib64' else ''} \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500132 ${base_libdir} \
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500133 ${nonarch_libdir}/lsb \
134 ${nonarch_base_libdir}/lsb/* \
135 "