fba08d869305f00998f7081c4ab13e399dc9a0b7
[vuplus_openembedded] / sysvinit / sysvinit_2.85.oe
1 DEPENDS = "virtual/libc"
2 DESCRIPTION = "System-V like init.\
3  Init is the first program to run after your system is booted, and\
4  continues to run as process number 1 until your system halts. Inits\
5  job is to start other programs that are essential to the operation of\
6  your system. All processes are descended from init. For more information,\
7  see the manual page init(8)."
8 PACKAGES = "sysvinit sysv-rc"
9 FILES_${PN} = "/sbin ${bindir} ${sysconfdir}"
10 FILES_sysv-rc = "${sbindir}"
11
12 SRC_URI = "ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-${PV}.tar.gz \
13            cvs://anoncvs:anoncvs@cvs.handhelds.org/cvs;module=apps/update-rc.d"
14 S = "${WORKDIR}/sysvinit-${PV}/src"
15
16 CFLAGS_prepend = "-D_GNU_SOURCE "
17 export LCRYPT = "-lcrypt"
18
19 do_install () {
20         install -d ${D}/${bindir} ${D}/${sbindir} \
21                    ${D}/sbin ${D}/${sysconfdir}/default \
22                    ${D}/${sysconfdir}/init.d
23 #       install -m 755 debian/sysv-rc/sbin/invoke-rc.d \
24 #               debian/sysv-rc/sbin/update-rc.d ${D}${sbindir}/
25         install -m 755 halt killall5 \
26                 runlevel shutdown ${D}/sbin/
27         install -m 755 init ${D}/sbin/sysvinit
28         install -m 755 mesg last ${D}${bindir}
29         install -m 0755 ${FILESDIR}/need                ${D}/sbin/need.sysvinit
30         install -m 0755 ${FILESDIR}/provide             ${D}/sbin/provide.sysvinit
31         ln -sf halt ${D}/sbin/reboot
32         ln -sf halt ${D}/sbin/poweroff
33         ln -sf init ${D}/sbin/telinit
34         ln -sf killall5 ${D}/sbin/pidof
35         ln -sf last ${D}${bindir}/lastb
36 #       echo "/etc/inittab" > ${D}/CONTROL/conffiles
37 #       echo "/etc/default/rcS" >> ${D}/CONTROL/conffiles
38 #       install -m 0755    ${FILESDIR}/prerm            ${D}/CONTROL/
39 #       install -m 0755    ${FILESDIR}/postinst         ${D}/CONTROL/
40         if [ -e ${FILESDIR}/inittab_${MACHINE} ]; then
41                 install -m 0644    ${FILESDIR}/inittab_${MACHINE}       ${D}/etc/inittab
42         else
43                 install -m 0644    ${FILESDIR}/inittab  ${D}/etc/inittab
44         fi
45         install -m 0644    ${FILESDIR}/rcS-default      ${D}/etc/default/rcS
46         install -m 0755    ${FILESDIR}/rc               ${D}/etc/init.d
47         install -m 0755    ${FILESDIR}/rcS              ${D}/etc/init.d
48         install -m 0755    ${WORKDIR}/update-rc.d/update-rc.d ${D}/${sbindir}/
49 }
50
51 do_stage () {
52         install -m 0755    ${WORKDIR}/update-rc.d/update-rc.d ${STAGING_BINDIR}/
53 }
54
55 pkg_postinst () {
56         set -e
57
58 # FIXME: use update-alternatives.. but what if the user doesnt have it?
59 #       if [ -n "`which update-alternatives 2>/dev/null`" ]; then
60 #               update-alternatives blah
61 #       else
62                 ln -sf sysvinit ${D}/sbin/init
63 #       fi
64         exit 0
65 }
66
67 #pkg_prerm () {
68 #       set -e
69 # FIXME: use update-alternatives
70 #       exit 0
71 #}