samba-3.0.25c support From: Dan Williams Notable changes from 3.0.23c support: 1/ Required a new configure.patch * forces HAVE_SECURE_MKSTEMP and HAVE_KERNEL_OPLOCKS_LINUX to 1 in the cross-compile case * added 'cross' option for SMB_BUILD_CC_NEGATIVE_ENUM_VALUES * forces HAVE_GETGROUPLIST to fix "Failed to set gid privileges" messages at run time * forces LONGLONG and LL support, but these may not be necessary 2/ Requires '--with-libiconv' fix to avoid "CROSS COMPILE Badness" Tested with: DISTRO = angstrom-2007.1 MACHINE = i686-generic --- packages/samba/samba-3.0.25c/configure.patch | 283 ++++++++++++++++++++++++++ packages/samba/samba_3.0.25c.bb | 48 ++++ 2 files changed, 331 insertions(+), 0 deletions(-) diff --git a/packages/samba/samba-3.0.25c/configure.patch b/packages/samba/samba-3.0.25c/configure.patch new file mode 100644 index 0000000..982eaf7 --- /dev/null +++ b/packages/samba/samba-3.0.25c/configure.patch @@ -0,0 +1,283 @@ +Index: source/aclocal.m4 +=================================================================== +--- source.orig/aclocal.m4 ++++ source/aclocal.m4 +@@ -1,5 +1,5 @@ + dnl test whether dirent has a d_off member +-AC_DEFUN(AC_DIRENT_D_OFF, ++AC_DEFUN([AC_DIRENT_D_OFF], + [AC_CACHE_CHECK([for d_off in dirent], ac_cv_dirent_d_off, + [AC_TRY_COMPILE([ + #include +@@ -13,7 +13,7 @@ fi + + dnl Mark specified module as shared + dnl SMB_MODULE(name,static_files,shared_files,subsystem,whatif-static,whatif-shared) +-AC_DEFUN(SMB_MODULE, ++AC_DEFUN([SMB_MODULE], + [ + AC_MSG_CHECKING([how to build $1]) + if test "$[MODULE_][$1]"; then +@@ -44,7 +44,7 @@ AC_DEFUN(SMB_MODULE, + fi + ]) + +-AC_DEFUN(SMB_SUBSYSTEM, ++AC_DEFUN([SMB_SUBSYSTEM], + [ + AC_SUBST($1_STATIC) + AC_SUBST($1_MODULES) +@@ -246,7 +246,7 @@ EOF + ]) + + dnl Copied from libtool.m4 +-AC_DEFUN(AC_PROG_LD_GNU, ++AC_DEFUN([AC_PROG_LD_GNU], + [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, + [# I'd rather use --version here, but apparently some GNU ld's only accept -v. + if $LD -v 2>&1 &5; then +@@ -257,7 +257,7 @@ fi]) + ]) + + dnl Removes -I/usr/include/? from given variable +-AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[ ++AC_DEFUN([CFLAGS_REMOVE_USR_INCLUDE],[ + ac_new_flags="" + for i in [$]$1; do + case [$]i in +@@ -270,7 +270,7 @@ AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[ + + dnl Removes '-L/usr/lib[/]', '-Wl,-rpath,/usr/lib[/]' + dnl and '-Wl,-rpath -Wl,/usr/lib[/]' from given variable +-AC_DEFUN(LIB_REMOVE_USR_LIB,[ ++AC_DEFUN([LIB_REMOVE_USR_LIB],[ + ac_new_flags="" + l="" + for i in [$]$1; do +@@ -301,7 +301,7 @@ AC_DEFUN(LIB_REMOVE_USR_LIB,[ + + dnl From Bruno Haible. + +-AC_DEFUN(jm_ICONV, ++AC_DEFUN([jm_ICONV], + [ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable libiconv installed). +@@ -387,7 +387,7 @@ AC_DEFUN(jm_ICONV, + fi + ]) + +-AC_DEFUN(rjs_CHARSET,[ ++AC_DEFUN([rjs_CHARSET],[ + dnl Find out if we can convert from $1 to UCS2-LE + AC_MSG_CHECKING([can we convert from $1 to UCS2-LE?]) + AC_TRY_RUN([ +@@ -405,7 +405,7 @@ main(){ + + dnl CFLAGS_ADD_DIR(CFLAGS, $INCDIR) + dnl This function doesn't add -I/usr/include into CFLAGS +-AC_DEFUN(CFLAGS_ADD_DIR,[ ++AC_DEFUN([CFLAGS_ADD_DIR],[ + if test "$2" != "/usr/include" ; then + $1="$$1 -I$2" + fi +@@ -413,7 +413,7 @@ fi + + dnl LIB_ADD_DIR(LDFLAGS, $LIBDIR) + dnl This function doesn't add -L/usr/lib into LDFLAGS +-AC_DEFUN(LIB_ADD_DIR,[ ++AC_DEFUN([LIB_ADD_DIR],[ + if test "$2" != "/usr/lib" ; then + $1="$$1 -L$2" + fi +@@ -486,7 +486,7 @@ AC_ENABLE_STATIC(no)]) + dnl AC_TRY_RUN_STRICT(PROGRAM,CFLAGS,CPPFLAGS,LDFLAGS, + dnl [ACTION-IF-TRUE],[ACTION-IF-FALSE], + dnl [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR]) +-AC_DEFUN( [AC_TRY_RUN_STRICT], ++AC_DEFUN([AC_TRY_RUN_STRICT], + [ + old_CFLAGS="$CFLAGS"; + CFLAGS="$2"; +Index: source/configure.in +=================================================================== +--- source.orig/configure.in ++++ source/configure.in +@@ -537,7 +537,7 @@ AC_CACHE_CHECK([that the C compiler unde + return 0; + } + ], +- SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes,SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=no)]) ++ SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes,SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=no,SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=cross)]) + if test x"$SMB_BUILD_CC_NEGATIVE_ENUM_VALUES" != x"yes"; then + AC_MSG_WARN([using --unit-enums for pidl]) + PIDL_ARGS="$PIDL_ARGS --uint-enums" +@@ -1219,9 +1219,10 @@ if test x"$ac_cv_func_execl" = x"no"; th + EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)" + fi + ++ac_cv_func_chflags=no + AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strerror chown fchown chmod fchmod chroot link mknod mknod64) + AC_CHECK_FUNCS(strtol strtoll strtoul strtoull strtouq __strtoull) +-AC_CHECK_FUNCS(fstat strchr utime utimes chflags) ++AC_CHECK_FUNCS(fstat strchr utime utimes) + AC_CHECK_FUNCS(getrlimit fsync memset strlcpy strlcat setpgid) + AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid) + AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent) +@@ -1391,8 +1392,8 @@ main() { + #endif + exit(0); + } +-], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no]) +- if test x"$linux_getgrouplist_ok" = x"yes"; then ++], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no], [linux_getgrouplist_ok=cross]) ++ if test x"$linux_getgrouplist_ok" = x"yes" -o x"$linux_getgrouplist_ok" = x"cross"; then + AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist]) + fi + ;; +@@ -1925,7 +1926,7 @@ AC_CACHE_CHECK([for long long],samba_cv_ + AC_TRY_RUN([#include + main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }], + samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)]) +-if test x"$samba_cv_have_longlong" = x"yes"; then ++if test x"$samba_cv_have_longlong" = x"yes" -o x"$samba_cv_have_longlong" = x"cross"; then + AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's]) + AC_CHECK_TYPE(intptr_t, unsigned long long) + else +@@ -1938,8 +1939,8 @@ fi + + AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [ + AC_TRY_COMPILE([#include ],[long long i = 0x8000000000LL], +- samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)]) +-if test x"$samba_cv_compiler_supports_ll" = x"yes"; then ++ samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no,samba_cv_compiler_supports_ll=cross)]) ++if test x"$samba_cv_compiler_supports_ll" = x"yes" -o x"$samba_cv_compiler_supports_ll" = x"cross"; then + AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Whether the compiler supports the LL prefix on long long integers]) + fi + +@@ -2457,7 +2458,7 @@ dnl AC_CACHE_CHECK([for working i + dnl ]) + + LIBS="$ic_save_LIBS" +- if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then ++ if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes" -o x"$samba_cv_HAVE_NATIVE_ICONV" = x"cross"; then + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS +@@ -2507,7 +2508,7 @@ main() { + } + ], + samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)]) +-if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then ++if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes" -o x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"cross"; then + AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX,1,[Whether to use linux kernel oplocks]) + fi + +@@ -2777,7 +2778,7 @@ main() { + samba_cv_HAVE_SECURE_MKSTEMP=yes, + samba_cv_HAVE_SECURE_MKSTEMP=no, + samba_cv_HAVE_SECURE_MKSTEMP=cross)]) +-if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then ++if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes" -o x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"cross"; then + AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure]) + fi + +@@ -2832,7 +2833,7 @@ AC_TRY_RUN([ + #include "${srcdir-.}/lib/interfaces.c"], + samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)]) + CPPFLAGS="$SAVE_CPPFLAGS" +-if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then ++if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes" -o test x"$samba_cv_HAVE_IFACE_IFCONF" = x"cross"; then + iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available]) + fi + fi +Index: source/lib/replace/libreplace.m4 +=================================================================== +--- source.orig/lib/replace/libreplace.m4 ++++ source/lib/replace/libreplace.m4 +@@ -1,4 +1,4 @@ +-AC_DEFUN_ONCE(AC_LIBREPLACE_LOCATION_CHECKS, ++AC_DEFUN_ONCE([AC_LIBREPLACE_LOCATION_CHECKS], + [ + echo "LIBREPLACE_LOCATION_CHECKS: START" + +@@ -27,7 +27,7 @@ echo "LIBREPLACE_LOCATION_CHECKS: END" + ]) dnl end AC_LIBREPLACE_LOCATION_CHECKS + + +-AC_DEFUN_ONCE(AC_LIBREPLACE_BROKEN_CHECKS, ++AC_DEFUN_ONCE([AC_LIBREPLACE_BROKEN_CHECKS], + [ + echo "LIBREPLACE_BROKEN_CHECKS: START" + +@@ -339,11 +339,11 @@ AC_CHECK_FUNCS([syslog memset memcpy],,[ + echo "LIBREPLACE_BROKEN_CHECKS: END" + ]) dnl end AC_LIBREPLACE_BROKEN_CHECKS + +-AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_START, ++AC_DEFUN_ONCE([AC__LIBREPLACE_ALL_CHECKS_START], + [ + #LIBREPLACE_ALL_CHECKS: START" + ]) +-AC_DEFUN_ONCE(AC__LIBREPLACE_ALL_CHECKS_END, ++AC_DEFUN_ONCE([AC__LIBREPLACE_ALL_CHECKS_END], + [ + #LIBREPLACE_ALL_CHECKS: END" + ]) +Index: source/lib/replace/libreplace_cc.m4 +=================================================================== +--- source.orig/lib/replace/libreplace_cc.m4 ++++ source/lib/replace/libreplace_cc.m4 +@@ -1,10 +1,10 @@ + +-AC_DEFUN_ONCE(AC__LIBREPLACE_ONLY_CC_CHECKS_START, ++AC_DEFUN_ONCE([AC__LIBREPLACE_ONLY_CC_CHECKS_START], + [ + echo "LIBREPLACE_CC_CHECKS: START" + ]) + +-AC_DEFUN_ONCE(AC__LIBREPLACE_ONLY_CC_CHECKS_END, ++AC_DEFUN_ONCE([AC__LIBREPLACE_ONLY_CC_CHECKS_END], + [ + echo "LIBREPLACE_CC_CHECKS: END" + ]) +Index: source/lib/replace/libreplace_macros.m4 +=================================================================== +--- source.orig/lib/replace/libreplace_macros.m4 ++++ source/lib/replace/libreplace_macros.m4 +@@ -76,7 +76,7 @@ fi + ]) + + dnl AC_PROG_CC_FLAG(flag) +-AC_DEFUN(AC_PROG_CC_FLAG, ++AC_DEFUN([AC_PROG_CC_FLAG], + [AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1, + [echo 'void f(){}' > conftest.c + if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then +@@ -103,7 +103,7 @@ AH_VERBATIM([$1], [#ifndef $1 + dnl see if a declaration exists for a function or variable + dnl defines HAVE_function_DECL if it exists + dnl AC_HAVE_DECL(var, includes) +-AC_DEFUN(AC_HAVE_DECL, ++AC_DEFUN([AC_HAVE_DECL], + [ + AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[ + AC_TRY_COMPILE([$2],[int i = (int)$1], +@@ -289,7 +289,7 @@ m4_ifdef([AS_HELP_STRING], , [m4_define( + + dnl check if the prototype in the header matches the given one + dnl AC_VERIFY_C_PROTOTYPE(prototype,functionbody,[IF-TRUE].[IF-FALSE],[extraheaders]) +-AC_DEFUN(AC_VERIFY_C_PROTOTYPE, ++AC_DEFUN([AC_VERIFY_C_PROTOTYPE], + [AC_CACHE_CHECK([for prototype $1], AS_TR_SH([ac_cv_c_prototype_$1]), + AC_COMPILE_IFELSE([ + AC_INCLUDES_DEFAULT +@@ -307,7 +307,7 @@ AC_DEFUN(AC_VERIFY_C_PROTOTYPE, + AS_IF([test $AS_TR_SH([ac_cv_c_prototype_$1]) = yes],[$3],[$4]) + ]) + +-AC_DEFUN(LIBREPLACE_PROVIDE_HEADER, ++AC_DEFUN([LIBREPLACE_PROVIDE_HEADER], + [AC_CHECK_HEADER([$1], + [ AC_CONFIG_COMMANDS(rm-$1, [rm -f $libreplacedir/$1], [libreplacedir=$libreplacedir]) ], + [ AC_CONFIG_COMMANDS(mk-$1, [echo "#include \"replace.h\"" > $libreplacedir/$1], [libreplacedir=$libreplacedir]) ] diff --git a/packages/samba/samba_3.0.25c.bb b/packages/samba/samba_3.0.25c.bb new file mode 100644 index 0000000..0379657 --- /dev/null +++ b/packages/samba/samba_3.0.25c.bb @@ -0,0 +1,48 @@ +require samba.inc +inherit update-rc.d + +SRC_URI += "file://config-lfs.patch;patch=1 \ + file://init \ + file://quota.patch;patch=1;pnum=0 \ + " + +INITSCRIPT_NAME = "samba" +# No dependencies, goes in at level 20 (NOTE: take care with the +# level, later levels put the shutdown later too - see the links +# in rc6.d, the shutdown must precede network shutdown). +INITSCRIPT_PARAMS = "defaults" +CONFFILES_${PN} = "${sysconfdir}/samba/smb.conf" + +# The file system settings --foodir=dirfoo and overridden unconditionally +# in the samba config by --with-foodir=dirfoo - even if the --with is not +# specified! Fix that here. Set the privatedir to /etc/samba/private. +EXTRA_OECONF += "\ + samba_cv_struct_timespec=yes \ + --with-configdir=${sysconfdir}/samba \ + --with-privatedir=${sysconfdir}/samba/private \ + --with-lockdir=${localstatedir}/lock \ + --with-piddir=${localstatedir}/run \ + --with-logfilebase=${localstatedir}/log \ + --with-libdir=${libdir} \ + --with-mandir=${mandir} \ + --with-swatdir=${datadir}/swat \ + --with-libiconv=${STAGING_DIR}/${TARGET_SYS} \ + " + +do_install_append() { + install -d "${D}${localstatedir}/log" + rm -f ${D}/sbin/mount.smbfs + ln -sf smbmount ${D}${sbindir}/mount.smbfs + install -d "${D}${sysconfdir}/init.d" + install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/samba + install -d "${D}${sysconfdir}/samba" + install -c -m 644 ../examples/smb.conf.default ${D}${sysconfdir}/samba/smb.conf +} + +PACKAGES =+ "swat" + +FILES_swat = "${sbindir}/swat ${datadir}/swat ${libdir}/*.msg" +FILES_${PN} += "${libdir}/vfs/*.so ${libdir}/charset/*.so ${libdir}/*.dat ${libdir}/auth/*.so" +# +# bug fix for samba.inc: +FILES_cifs-doc = "${mandir}/man8/mount.cifs.8"