merge of '4b865f129d7c784106bb82861c16cc6330c629a9'
[vuplus_openembedded] / packages / samba / samba-essential_3.0.20.bb
1 PR = "r5"
2
3 SRC_URI = "http://us2.samba.org/samba/ftp/stable/samba-${PV}.tar.gz \
4            file://configure.patch;patch=1 \
5            file://cifs.patch;patch=1 \
6            file://config-lfs.patch;patch=1 \
7            file://init-essential \
8            file://quota.patch;patch=1;pnum=0 \
9            file://smb-essential.conf \
10            file://smb-essential-inactive.conf \
11            file://Managing-Samba.txt"
12
13 S := "${WORKDIR}/samba-${PV}/source"
14
15 RCONFLICTS = "samba"
16
17 require samba-essential.inc
18 inherit update-rc.d
19
20 INITSCRIPT_NAME = "samba"
21 # No dependencies, goes in at level 20 (NOTE: take care with the
22 # level, later levels put the shutdown later too - see the links
23 # in rc6.d, the shutdown must precede network shutdown).
24 INITSCRIPT_PARAMS = "defaults"
25 CONFFILES_${PN} = "${sysconfdir}/samba/smb.conf"
26
27 # The file system settings --foodir=dirfoo and overridden unconditionally
28 # in the samba config by --with-foodir=dirfoo - even if the --with is not
29 # specified!  Fix that here.  Set the privatedir to /etc/samba/private.
30 EXTRA_OECONF += "\
31         --with-configdir=${sysconfdir}/samba \
32         --with-privatedir=${sysconfdir}/samba/private \
33         --with-lockdir=${localstatedir}/lock \
34         --with-piddir=${localstatedir}/run \
35         --with-logfilebase=${localstatedir}/log \
36         --with-libdir=${libdir} \
37         --with-mandir=${mandir} \
38         "
39
40 do_install_append() {
41         install -d "${D}${localstatedir}/log"
42         rm -f ${D}/sbin/mount.smbfs
43         rmdir ${D}/sbin
44         install -d "${D}${sysconfdir}/init.d"
45         install -d "${D}${sysconfdir}/samba/private"
46
47         install -c -m 755 ${WORKDIR}/init-essential ${D}${sysconfdir}/init.d/samba
48
49         install -d "${D}${sysconfdir}/samba"
50         install -d "${D}/usr/share/samba/help"
51
52         install -m 0644 ${WORKDIR}/smb-essential-inactive.conf "${D}${sysconfdir}/samba/"
53         install -m 0644 ${WORKDIR}/smb-essential.conf "${D}${sysconfdir}/samba/smb.conf"
54
55         install -m 0644 ${WORKDIR}/Managing-Samba.txt  ${D}/usr/share/samba/help
56
57 }
58
59 do_configure_append() {
60         distro_up="`echo "${DISTRO}" | awk '{printf("%s\n",toupper($0))}'`"
61
62         cat ${WORKDIR}/smb-essential-inactive.conf | sed "s/MYWORKGROUP/${distro_up}/" > ${WORKDIR}/smb-essential-inactive.conf_
63         mv  ${WORKDIR}/smb-essential-inactive.conf_ ${WORKDIR}/smb-essential-inactive.conf
64
65         cat ${WORKDIR}/smb-essential.conf | sed "s/MYWORKGROUP/${distro_up}/" > ${WORKDIR}/smb-essential.conf_
66         mv  ${WORKDIR}/smb-essential.conf_ ${WORKDIR}/smb-essential.conf
67 }
68
69 FILES_${PN} = "${bindir}/smbpasswd \
70                ${sbindir}/nmbd \
71                ${sbindir}/smbd \
72                ${libdir}/charset \
73                ${libdir}/vfs \
74                ${libdir}/*.dat \
75                /usr/share/samba \
76                /etc"