blob: ece0eab0ff0dda9575f3951490276933fd7136ce [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"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050027
28UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/lsb/files/lsb_release/"
29UPSTREAM_CHECK_REGEX = "/lsb_release/(?P<pver>(\d+[\.\-_]*)+)/"
30
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031S = "${WORKDIR}/lsb-release-1.4"
32
33CLEANBROKEN = "1"
34
35do_install(){
36 oe_runmake install prefix=${D} mandir=${D}/${datadir}/man/ DESTDIR=${D}
37
38 # this 2 dirs are needed by package lsb-dist-checker
39 mkdir -p ${D}${sysconfdir}/opt
40 mkdir -p ${D}${localstatedir}/opt
41
42 mkdir -p ${D}${base_bindir}
43 mkdir -p ${D}/${baselib}
44 mkdir -p ${D}${sysconfdir}/lsb-release.d
45 printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
46
47 if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
48 printf "core-4.1-ia32" >> ${D}${sysconfdir}/lsb-release
49 else
50 printf "core-4.1-${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}/lib/lsb
90 install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
91
92 # creat links for LSB test
93 install -d ${D}/usr/lib/lsb
94 ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
95 ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
96
97 if [ "${TARGET_ARCH}" = "x86_64" ];then
98 cd ${D}
99 if [ "${baselib}" != "lib64" ]; then
100 ln -sf ${baselib} lib64
101 fi
102 cd ${D}/${baselib}
103 ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
104 ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
105 fi
106 if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
107 cd ${D}/${baselib}
108 ln -sf ld-linux.so.2 ld-lsb.so.2
109 ln -sf ld-linux.so.2 ld-lsb.so.3
110 fi
111
112 if [ "${TARGET_ARCH}" = "powerpc64" ];then
113 cd ${D}
114 if [ "${baselib}" != "lib64" ]; then
115 ln -sf ${baselib} lib64
116 fi
117 cd ${D}/${baselib}
118 ln -sf ld64.so.1 ld-lsb-ppc64.so.2
119 ln -sf ld64.so.1 ld-lsb-ppc64.so.3
120 fi
121 if [ "${TARGET_ARCH}" = "powerpc" ];then
122 cd ${D}/${baselib}
123 ln -sf ld.so.1 ld-lsb-ppc32.so.2
124 ln -sf ld.so.1 ld-lsb-ppc32.so.3
125 fi
126}
127FILES_${PN} += "/lib64 \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500128 ${base_libdir} \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500129 /usr/lib/lsb \
130 ${base_libdir}/lsb/* \
131 /lib/lsb/* \
132 "