blob: c9f6a8bd9fec28b99f9e7f341ecba33bfe3946d2 [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 \
18 file://init-functions \
19 file://lsb_killproc \
20 file://lsb_log_message \
21 file://lsb_pidofproc \
22 file://lsb_start_daemon \
23 "
24
25SRC_URI[md5sum] = "30537ef5a01e0ca94b7b8eb6a36bb1e4"
26SRC_URI[sha256sum] = "99321288f8d62e7a1d485b7c6bdccf06766fb8ca603c6195806e4457fdf17172"
27S = "${WORKDIR}/lsb-release-1.4"
28
29CLEANBROKEN = "1"
30
31do_install(){
32 oe_runmake install prefix=${D} mandir=${D}/${datadir}/man/ DESTDIR=${D}
33
34 # this 2 dirs are needed by package lsb-dist-checker
35 mkdir -p ${D}${sysconfdir}/opt
36 mkdir -p ${D}${localstatedir}/opt
37
38 mkdir -p ${D}${base_bindir}
39 mkdir -p ${D}/${baselib}
40 mkdir -p ${D}${sysconfdir}/lsb-release.d
41 printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
42
43 if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
44 printf "core-4.1-ia32" >> ${D}${sysconfdir}/lsb-release
45 else
46 printf "core-4.1-${TARGET_ARCH}" >> ${D}${sysconfdir}/lsb-release
47 fi
48 echo "\"" >> ${D}${sysconfdir}/lsb-release
49 echo "DISTRIB_ID=${DISTRO}" >> ${D}${sysconfdir}/lsb-release
50 echo "DISTRIB_RELEASE=${DISTRO_VERSION}" >> ${D}${sysconfdir}/lsb-release
51 if [ -n "${DISTRO_CODENAME}" ]; then
52 echo "DISTRIB_CODENAME=${DISTRO_CODENAME}" >> ${D}${sysconfdir}/lsb-release
53 fi
54 echo "DISTRIB_DESCRIPTION=\"${DISTRO_NAME} ${DISTRO_VERSION}\"" >> ${D}${sysconfdir}/lsb-release
55
56 if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
57 mkdir -p ${D}${sysconfdir}/lsb-release.d
58 touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
59 touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-noarch
60 touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ia32
61 touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ia32
62 elif [ "${TARGET_ARCH}" = "x86_64" ];then
63 touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
64 touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-amd64
65 touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-amd64
66 fi
67 if [ "${TARGET_ARCH}" = "powerpc" ];then
68 touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
69 touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc32
70 touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc32
71 elif [ "${TARGET_ARCH}" = "powerpc64" ];then
72 touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
73 touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc64
74 touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc64
75 fi
76}
77
78do_install_append(){
79 install -d ${D}${sysconfdir}/core-lsb
80 for i in lsb_killproc lsb_log_message lsb_pidofproc lsb_start_daemon
81 do
82 install -m 0755 ${WORKDIR}/${i} ${D}${sysconfdir}/core-lsb
83 done
84
85 install -d ${D}/lib/lsb
86 install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
87
88 # creat links for LSB test
89 install -d ${D}/usr/lib/lsb
90 ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
91 ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
92
93 if [ "${TARGET_ARCH}" = "x86_64" ];then
94 cd ${D}
95 if [ "${baselib}" != "lib64" ]; then
96 ln -sf ${baselib} lib64
97 fi
98 cd ${D}/${baselib}
99 ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
100 ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
101 fi
102 if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
103 cd ${D}/${baselib}
104 ln -sf ld-linux.so.2 ld-lsb.so.2
105 ln -sf ld-linux.so.2 ld-lsb.so.3
106 fi
107
108 if [ "${TARGET_ARCH}" = "powerpc64" ];then
109 cd ${D}
110 if [ "${baselib}" != "lib64" ]; then
111 ln -sf ${baselib} lib64
112 fi
113 cd ${D}/${baselib}
114 ln -sf ld64.so.1 ld-lsb-ppc64.so.2
115 ln -sf ld64.so.1 ld-lsb-ppc64.so.3
116 fi
117 if [ "${TARGET_ARCH}" = "powerpc" ];then
118 cd ${D}/${baselib}
119 ln -sf ld.so.1 ld-lsb-ppc32.so.2
120 ln -sf ld.so.1 ld-lsb-ppc32.so.3
121 fi
122}
123FILES_${PN} += "/lib64 \
124 /usr/lib/lsb \
125 ${base_libdir}/lsb/* \
126 /lib/lsb/* \
127 "