increase dvbapp PR.
[vuplus_openembedded] / recipes / tftp-hpa / tftp-hpa_5.0.bb
1 DESCRIPTION = "HPA's tftp server"
2 DEPENDS = "tcp-wrappers readline"
3 SECTION = "network"
4 LICENSE = "BSD"
5 PR = "r1"
6
7 SRC_URI = "${KERNELORG_MIRROR}/pub/software/network/tftp/tftp-hpa-${PV}.tar.bz2 \
8            file://default \
9            file://init"
10
11 inherit autotools update-alternatives
12
13 # configure.in has errors
14 do_configure() {
15         oe_runconf
16 }
17
18 do_install() {
19         oe_runmake install INSTALLROOT=${D}
20
21         mv ${D}${bindir}/tftp ${D}${bindir}/tftp.${PN}
22
23         install -d ${D}${sysconfdir}/default
24         install -d ${D}${sysconfdir}/init.d
25
26         install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa
27         install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/tftp-hpa
28 }
29
30
31 INITSCRIPT_NAME = "${PN}"
32 INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 20 1 ."
33
34 PACKAGES += "tftpd-hpa"
35
36 FILES_${PN} = "${bindir}"
37 FILES_tftpd-hpa = "${sbindir} ${sysconfdir}"
38 CONFFILES_tftpd-hpa = "${sysconfdir}/default/tftpd-hpa"
39
40 ALTERNATIVE_NAME = "tftp"
41 ALTERNATIVE_LINK = "${bindir}/tftp"
42 ALTERNATIVE_PATH = "${bindir}/tftp.${PN}"
43 ALTERNATIVE_PRIORITY = "50"
44
45
46 # This is taken from update-rc.d.bbclass which works only for $PN package
47 # so I had to do that way
48
49 postinst_tftpd-hpa() {
50 if test "x$D" != "x"; then
51         OPT="-r $D"
52 else
53         OPT="-s"
54 fi
55 update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
56 }
57
58 prerm_tftpd-hpa() {
59 if test "x$D" = "x"; then
60         ${sysconfdir}/init.d/${INITSCRIPT_NAME} stop
61 fi
62 }
63
64 postrm_tftpd-hpa() {
65 if test "x$D" != "x"; then
66         OPT="-r $D"
67 else
68         OPT=""
69 fi
70 update-rc.d $OPT ${INITSCRIPT_NAME} remove
71 }
72