Merge remote-tracking branch 'OE-2.1/master' into vuplus-3.0
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-connectivity / samba / samba.inc
1 SECTION = "console/network"
2 LICENSE = "GPL"
3 DEPENDS = "readline virtual/libiconv talloc"
4
5 SRC_URI = "http://samba.org/samba/ftp/stable/samba-${PV}.tar.gz \
6            file://volatiles.03_samba \
7            file://smb.conf \
8            file://init \
9            file://tdb.pc \
10            "
11
12 S = "${WORKDIR}/samba-${PV}/source"
13
14 inherit autotools-brokensep update-rc.d
15
16 FILES_${PN}     += "${libdir}/vfs/*.so ${libdir}/charset/*.so ${libdir}/*.dat \
17                     ${libdir}/auth/*.so ${libdir}/security/*.so"
18 FILES_${PN}-dbg += "${libdir}/vfs/.debug/*.so ${libdir}/charset/.debug/*.so \
19                     ${libdir}/auth/.debug/*.so ${libdir}/security/.debug/*.so"
20
21 SAMBAMMAP = "no"
22 SAMBAMMAP_libc-glibc = "yes"
23
24 # The file system settings --foodir=dirfoo and overridden unconditionally
25 # in the samba config by --with-foodir=dirfoo - even if the --with is not
26 # specified!  Fix that here.  Set the privatedir to /etc/samba/private.
27 EXTRA_OECONF='--disable-cups \
28               --with-readline=${STAGING_LIBDIR}/.. \
29               --with-libiconv=${STAGING_LIBDIR}/.. \
30               --without-automount \
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               --with-swatdir=${datadir}/swat \
39               --with-aio-support \
40               --without-libtalloc \
41               samba_cv_struct_timespec=yes \
42               libreplace_cv_HAVE_MMAP=${SAMBAMMAP}'
43
44 INITSCRIPT_NAME = "samba"
45 # No dependencies, goes in at level 20 (NOTE: take care with the
46 # level, later levels put the shutdown later too - see the links
47 # in rc6.d, the shutdown must precede network shutdown).
48 INITSCRIPT_PARAMS = "defaults"
49 CONFFILES_${PN} = "${sysconfdir}/samba/smb.conf"
50
51 do_configure_prepend () {
52         ./script/mkversion.sh
53         if [ ! -e acinclude.m4 ]; then
54                 touch aclocal.m4        
55                 cat aclocal.m4 > acinclude.m4
56         fi
57 }
58
59 do_compile () {
60         oe_runmake proto_exists
61         base_do_compile
62 }
63
64 do_install_append() {
65         install -d ${D}${libdir}/pkgconfig/
66         cp ${WORKDIR}/tdb.pc ${D}${libdir}/pkgconfig/
67         mv ${D}${libdir}/libsmbclient.so ${D}${libdir}/libsmbclient.so.0 || true
68         ln -sf libsmbclient.so.0 ${D}${libdir}/libsmbclient.so
69         mkdir -p ${D}${base_sbindir}
70         rm -f ${D}${bindir}/*.old
71         rm -f ${D}${sbindir}/*.old
72         [ -f ${D}${sbindir}/mount.cifs ] && mv ${D}${sbindir}/mount.cifs ${D}${base_sbindir}/
73         [ -f ${D}${sbindir}/umount.cifs ] && mv ${D}${sbindir}/umount.cifs ${D}${base_sbindir}/
74
75         # This is needed for < 3.2.4
76         rm -f ${D}${sbindir}/mount.smbfs ${D}${base_sbindir}/mount.smbfs
77         if [ -f ${D}${bindir}/smbmount ]; then
78                 ln -sf ${bindir}/smbmount ${D}${base_sbindir}/mount.smb
79                 ln -sf ${bindir}/smbmount ${D}${base_sbindir}/mount.smbfs
80         fi
81         
82         install -D -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/samba
83         install -D -m 644 ${WORKDIR}/smb.conf ${D}${sysconfdir}/samba/smb.conf
84         install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/volatiles.03_samba
85         install -d ${D}/var/log/samba
86         install -d ${D}/var/spool/samba
87         rmdir ${D}/var/run
88 }
89