Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[vuplus_openembedded] / packages / tinylogin / tinylogin_1.4.bb
1 SECTION = "base"
2 DESCRIPTION = "TinyLogin is a suite of tiny UNIX \
3 utilities for handling logins, user authentication, \
4 changing passwords, and otherwise maintaining users \
5 and groups on an embedded system."
6 HOMEPAGE = "http://tinylogin.tinylogin.net/"
7 LICENSE = "GPL"
8 FILE_PR = "r5"
9
10 SRC_URI = "http://tinylogin.tinylogin.net/downloads/tinylogin-${PV}.tar.bz2 \
11         file://cvs-20040608.patch;patch=1;pnum=1 \
12         file://add-system.patch;patch=1;pnum=1 \
13         file://adduser-empty_pwd.patch;patch=1 \
14         file://remove-index.patch;patch=1"
15
16 EXTRA_OEMAKE = ""
17
18 do_compile () {
19         oe_runmake 'CC=${CC}' 'CROSS=${HOST_PREFIX}'
20 }
21
22 do_install () {
23         install -d ${D}${base_bindir}
24         install -m 4755 tinylogin ${D}${base_bindir}/tinylogin
25         install -d ${D}${sysconfdir}
26         install -m 0644 tinylogin.links ${D}${sysconfdir}
27 }
28
29 pkg_postinst_${PN} () {
30     # If we are not making an image we create links for the utilities that doesn't exist
31     # so the update-alternatives script will get the utilities it needs
32     # (update-alternatives have no problem replacing links later anyway)
33     if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/tinylogin";; /bin/*) to="tinylogin";; /*/*) to="../bin/tinylogin";; esac; ln -s $to $link; fi; done </etc/tinylogin.links; fi
34
35     # This adds the links, remember that this has to work when building an image too, hence the $D
36     while read link; do case "$link" in /*/*/*) to="../../bin/tinylogin";; /bin/*) to="tinylogin";; /*/*) to="../bin/tinylogin";; esac; bn=`basename $link`; update-alternatives --install $link $bn $to 40; done <$D/etc/tinylogin.links
37 }
38