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