diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
commit | 1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch) | |
tree | 0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-oe/recipes-connectivity/samba/samba.inc | |
download | meta-openembedded-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-oe/recipes-connectivity/samba/samba.inc')
-rw-r--r-- | meta-oe/recipes-connectivity/samba/samba.inc | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/samba/samba.inc b/meta-oe/recipes-connectivity/samba/samba.inc new file mode 100644 index 0000000000..39fc8143f0 --- /dev/null +++ b/meta-oe/recipes-connectivity/samba/samba.inc | |||
@@ -0,0 +1,116 @@ | |||
1 | SECTION = "console/network" | ||
2 | LICENSE = "GPL-3.0" | ||
3 | DEPENDS = "readline virtual/libiconv zlib popt" | ||
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.samba \ | ||
9 | file://init.winbind \ | ||
10 | file://tdb.pc \ | ||
11 | " | ||
12 | |||
13 | S = "${WORKDIR}/samba-${PV}/source" | ||
14 | |||
15 | inherit autotools-brokensep update-rc.d | ||
16 | |||
17 | SAMBAMMAP = "no" | ||
18 | SAMBAMMAP_libc-glibc = "yes" | ||
19 | |||
20 | # The file system settings --foodir=dirfoo and overridden unconditionally | ||
21 | # in the samba config by --with-foodir=dirfoo - even if the --with is not | ||
22 | # specified! Fix that here. Set the privatedir to /etc/samba/private. | ||
23 | EXTRA_OECONF='--disable-cups \ | ||
24 | --with-readline=${STAGING_LIBDIR}/.. \ | ||
25 | --with-libiconv=${STAGING_LIBDIR}/.. \ | ||
26 | --without-automount \ | ||
27 | --with-configdir=${sysconfdir}/samba \ | ||
28 | --with-privatedir=${sysconfdir}/samba/private \ | ||
29 | --with-lockdir=${localstatedir}/lock \ | ||
30 | --with-piddir=${localstatedir}/run \ | ||
31 | --with-logfilebase=${localstatedir}/log \ | ||
32 | --libdir=${libdir} \ | ||
33 | --with-mandir=${mandir} \ | ||
34 | --with-swatdir=${datadir}/swat \ | ||
35 | --with-aio-support \ | ||
36 | --with-winbind \ | ||
37 | --with-wbclient \ | ||
38 | --without-acl-support \ | ||
39 | --disable-avahi \ | ||
40 | samba_cv_struct_timespec=yes \ | ||
41 | libreplace_cv_HAVE_MMAP=${SAMBAMMAP}' | ||
42 | |||
43 | PACKAGECONFIG = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" | ||
44 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" | ||
45 | PACKAGECONFIG[fam] = "--enable-fam,--disable-fam,gamin" | ||
46 | PACKAGECONFIG[talloc] = "--with-libtalloc,--without-libtalloc,talloc" | ||
47 | |||
48 | INITSCRIPT_PACKAGES = "samba winbind" | ||
49 | INITSCRIPT_NAME_samba = "samba" | ||
50 | INITSCRIPT_NAME_winbind = "winbind" | ||
51 | # No dependencies, goes in at level 20 (NOTE: take care with the | ||
52 | # level, later levels put the shutdown later too - see the links | ||
53 | # in rc6.d, the shutdown must precede network shutdown). | ||
54 | INITSCRIPT_PARAMS = "defaults" | ||
55 | CONFFILES_${PN} = "${sysconfdir}/samba/smb.conf" | ||
56 | |||
57 | do_configure_prepend () { | ||
58 | ./script/mkversion.sh | ||
59 | if [ ! -e acinclude.m4 ]; then | ||
60 | touch aclocal.m4 | ||
61 | cat aclocal.m4 > acinclude.m4 | ||
62 | fi | ||
63 | } | ||
64 | |||
65 | do_compile () { | ||
66 | oe_runmake proto_exists | ||
67 | base_do_compile | ||
68 | } | ||
69 | |||
70 | do_install_append() { | ||
71 | install -d ${D}${libdir}/pkgconfig/ | ||
72 | cp ${WORKDIR}/tdb.pc ${D}${libdir}/pkgconfig/ | ||
73 | mv ${D}${libdir}/libsmbclient.so ${D}${libdir}/libsmbclient.so.0 || true | ||
74 | ln -sf libsmbclient.so.0 ${D}${libdir}/libsmbclient.so | ||
75 | mkdir -p ${D}${base_sbindir} | ||
76 | rm -f ${D}${bindir}/*.old | ||
77 | rm -f ${D}${sbindir}/*.old | ||
78 | [ -f ${D}${sbindir}/mount.cifs ] && mv ${D}${sbindir}/mount.cifs ${D}${base_sbindir}/ | ||
79 | [ -f ${D}${sbindir}/umount.cifs ] && mv ${D}${sbindir}/umount.cifs ${D}${base_sbindir}/ | ||
80 | |||
81 | # This is needed for < 3.2.4 | ||
82 | rm -f ${D}${sbindir}/mount.smbfs ${D}${base_sbindir}/mount.smbfs | ||
83 | if [ -f ${D}${bindir}/smbmount ]; then | ||
84 | ln -sf ${bindir}/smbmount ${D}${base_sbindir}/mount.smb | ||
85 | ln -sf ${bindir}/smbmount ${D}${base_sbindir}/mount.smbfs | ||
86 | fi | ||
87 | |||
88 | install -D -m 755 ${WORKDIR}/init.samba ${D}${sysconfdir}/init.d/samba | ||
89 | install -D -m 755 ${WORKDIR}/init.winbind ${D}${sysconfdir}/init.d/winbind | ||
90 | install -D -m 644 ${WORKDIR}/smb.conf ${D}${sysconfdir}/samba/smb.conf | ||
91 | install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/volatiles.03_samba | ||
92 | install -d ${D}/var/log/samba | ||
93 | install -d ${D}/var/spool/samba | ||
94 | |||
95 | # Install other stuff not installed by "make install" | ||
96 | if [ -d ${WORKDIR}/${PN}-${PV}/nsswitch ]; then | ||
97 | install -m 0644 ${WORKDIR}/${PN}-${PV}/nsswitch/libnss_winbind.so ${D}${libdir}/libnss_winbind.so.2 | ||
98 | install -m 0644 ${WORKDIR}/${PN}-${PV}/nsswitch/libnss_wins.so ${D}${libdir}/libnss_wins.so.2 | ||
99 | fi | ||
100 | |||
101 | rmdir --ignore-fail-on-non-empty ${D}${base_sbindir} | ||
102 | sed -i -e '1s,#!.*perl,#!${USRBINPATH}/env perl,' ${D}${bindir}/findsmb | ||
103 | |||
104 | # usershare mount place | ||
105 | mkdir -p ${D}${localstatedir}/lib/samba/usershares | ||
106 | } | ||
107 | |||
108 | pkg_postinst_libnss-winbind () { | ||
109 | # add wins to the list of resolvers | ||
110 | ns=$D${sysconfdir}/nsswitch.conf | ||
111 | if ! grep "hosts:.*wins" $ns > /dev/null; then | ||
112 | hosts="`grep '^hosts:' $ns`" | ||
113 | hosts=`echo "$hosts" | sed 's/\[/\\\\[/g; s/\]/\\\\]/g'` | ||
114 | sed -i "s/$hosts/$hosts wins/" "$ns" | ||
115 | fi | ||
116 | } | ||