help2man: fix drag in of target perl for the native package
[openembedded.git] / recipes / sysvinit / sysvinit_2.86.bb
blob66c3952ae4fa00fe5f661c6ce6f7f5b07ae3e21b
1 DESCRIPTION = "System-V like init."
2 SECTION = "base"
3 LICENSE = "GPLv2+"
4 HOMEPAGE = "http://freshmeat.net/projects/sysvinit/"
5 PR = "r63"
7 # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
8 # Set PACKAGE_ARCH appropriately.
9 PACKAGE_ARCH_${PN}-inittab = "${MACHINE_ARCH}"
11 RDEPENDS_${PN} = "${PN}-inittab"
13 PACKAGES =+ "bootlogd ${PN}-inittab"
14 FILES_bootlogd = "/etc/init.d/bootlogd /etc/init.d/stop-bootlogd /etc/rc?.d/S*bootlogd /sbin/bootlogd"
15 FILES_${PN}-inittab = "${sysconfdir}/inittab"
16 CONFFILES_${PN}-inittab = "${sysconfdir}/inittab"
18 USE_VT ?= "1"
19 SYSVINIT_ENABLED_GETTYS ?= "1"
21 SRC_URI = "ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-${PV}.tar.gz \
22 file://install.patch \
23 file://need \
24 file://provide \
25 file://inittab \
26 file://rcS-default \
27 file://rc \
28 file://rcS \
29 file://bootlogd.init"
31 S = "${WORKDIR}/sysvinit-${PV}"
32 B = "${S}/src"
34 inherit update-alternatives
36 ALTERNATIVE_NAME = "init"
37 ALTERNATIVE_LINK = "${base_sbindir}/init"
38 ALTERNATIVE_PATH = "${base_sbindir}/init.sysvinit"
39 ALTERNATIVE_PRIORITY = "60"
41 PACKAGES =+ "sysvinit-utils sysvinit-pidof sysvinit-sulogin"
42 FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*"
43 FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit"
44 FILES_sysvinit-sulogin = "${base_sbindir}/sulogin"
45 FILES_sysvinit-utils = "${bindir}/last.${PN} ${bindir}/mesg.${PN} ${bindir}/wall.${PN} ${bindir}/lastb ${bindir}/utmpdump ${base_sbindir}/killall5"
46 RRECOMMENDS_${PN} = "sysvinit-utils"
47 RRECOMMENDS_${PN}_micro = ""
48 RRECOMMENDS_${PN}_slugos = ""
50 CFLAGS_prepend = "-D_GNU_SOURCE "
51 export LCRYPT = "-lcrypt"
52 EXTRA_OEMAKE += "'INSTALL=install' \
53 'bindir=${base_bindir}' \
54 'sbindir=${base_sbindir}' \
55 'usrbindir=${bindir}' \
56 'usrsbindir=${sbindir}' \
57 'includedir=${includedir}' \
58 'mandir=${mandir}' \
59 DISTRO=''"
61 do_install () {
62 oe_runmake 'ROOT=${D}' install
63 install -d ${D}${sysconfdir}
64 install -d ${D}${sysconfdir}/default
65 install -d ${D}${sysconfdir}/init.d
66 install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
67 if [ ! -z "${SERIAL_CONSOLE}" ]; then
68 echo "S:2345:respawn:${base_sbindir}/getty ${SERIAL_CONSOLE}" >> ${D}${sysconfdir}/inittab
70 if [ "${USE_VT}" = "1" ]; then
71 cat <<EOF >>${D}${sysconfdir}/inittab
72 # ${base_sbindir}/getty invocations for the runlevels.
74 # The "id" field MUST be the same as the last
75 # characters of the device (after "tty").
77 # Format:
78 # <id>:<runlevels>:<action>:<process>
81 EOF
83 for n in ${SYSVINIT_ENABLED_GETTYS}
85 echo "$n:2345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
86 done
87 echo "" >> ${D}${sysconfdir}/inittab
89 install -m 0644 ${WORKDIR}/rcS-default ${D}${sysconfdir}/default/rcS
90 install -m 0755 ${WORKDIR}/rc ${D}${sysconfdir}/init.d
91 install -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d
92 install -m 0755 ${WORKDIR}/bootlogd.init ${D}${sysconfdir}/init.d/bootlogd
93 ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd
94 install -d ${D}${sysconfdir}/rcS.d
95 ln -sf ../init.d/bootlogd ${D}${sysconfdir}/rcS.d/S07bootlogd
96 for level in 2 3 4 5; do
97 install -d ${D}${sysconfdir}/rc$level.d
98 ln -sf ../init.d/stop-bootlogd ${D}${sysconfdir}/rc$level.d/S99stop-bootlogd
99 done
100 mv ${D}${base_sbindir}/init ${D}${base_sbindir}/init.${PN}
101 mv ${D}${base_bindir}/pidof ${D}${base_bindir}/pidof.${PN}
102 mv ${D}${base_bindir}/mountpoint ${D}${base_bindir}/mountpoint.${PN}
103 mv ${D}${base_sbindir}/halt ${D}${base_sbindir}/halt.${PN}
104 mv ${D}${base_sbindir}/reboot ${D}${base_sbindir}/reboot.${PN}
105 mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN}
106 mv ${D}${base_sbindir}/poweroff ${D}${base_sbindir}/poweroff.${PN}
107 mv ${D}${bindir}/last ${D}${bindir}/last.${PN}
108 mv ${D}${bindir}/mesg ${D}${bindir}/mesg.${PN}
109 mv ${D}${bindir}/wall ${D}${bindir}/wall.${PN}
112 pkg_postinst_${PN} () {
113 #!/bin/sh
114 update-alternatives --install ${base_bindir}/mountpoint mountpoint mountpoint.${PN} 200
115 update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 200
116 update-alternatives --install ${base_sbindir}/reboot reboot reboot.${PN} 200
117 update-alternatives --install ${base_sbindir}/poweroff poweroff poweroff.${PN} 200
118 update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${PN} 200
121 pkg_postinst_sysvinit-utils () {
122 #!/bin/sh
123 update-alternatives --install ${bindir}/last last last.${PN} 200
124 update-alternatives --install ${bindir}/mesg mesg mesg.${PN} 200
125 update-alternatives --install ${bindir}/wall wall wall.${PN} 200
128 pkg_prerm_${PN} () {
129 #!/bin/sh
130 update-alternatives --remove mountpoint mountpoint.${PN}
131 update-alternatives --remove halt halt.${PN}
132 update-alternatives --remove reboot reboot.${PN}
133 update-alternatives --remove shutdown shutdown.${PN}
136 pkg_prerm_sysvinit-utils () {
137 #!/bin/sh
138 update-alternatives --remove last last.${PN}
139 update-alternatives --remove mesg mesg.${PN}
140 update-alternatives --remove wall wall.${PN}
143 pkg_postinst_sysvinit-pidof () {
144 #!/bin/sh
145 update-alternatives --install ${base_bindir}/pidof pidof pidof.${PN} 200
148 pkg_prerm_sysvinit-pidof () {
149 #!/bin/sh
150 update-alternatives --remove pidof pidof.${PN}
153 SRC_URI[md5sum] = "7d5d61c026122ab791ac04c8a84db967"
154 SRC_URI[sha256sum] = "035f98fae17d9cff002993c564ccc83dc4ed136127172caeff872b6abdb679d8"