# Psion's smbclient: samba 3.0.7 with their configure.patch. # # "My Network" on the photograph is LinNeighborhood, installed from Psion's # own linneighborhood_0.6.5-r8_armv5te.ipk. That ipk says # "Depends: smbclient", and it does all its work by shelling out to # smbclient, nmblookup and smbmount -- none of which are on the card, so the # window opens and can browse nothing. # # samba_3.0.7.oe (PR=r2) is Psion's recipe. FILES_smbclient is exactly # smbclient, nmblookup, smbmount, smbumount, smbmnt and ${libdir}/*.dat. # # The 3.0.7 release tarball is gone -- samba.org's old-versions now stops at # 2.2.12, Debian's archive and snapshot skip 3.0.6 to 3.0.8, and the OE, # Yocto and Gentoo source mirrors have dropped it. The Wayback captures of # us1/us2.samba.org exist in the CDX index but will not replay. The source # here is the samba-3.0.7 tag from samba-team/samba, and Psion's # configure.patch applies to it with all 18 hunks clean and no fuzz, which is # what says it is the right tree. # # A git tag has no generated configure, so autoconf runs first -- which is # what the recipe's "inherit autotools" does anyway. set -x rm -rf /build/out; mkdir -p /build/out/bin export LC_ALL=C export CC=gcc-3.4 cd /build/samba-3.0.7/source || { echo "NO_SOURCE"; exit 1; } echo "=== VERIFY: Psion's cross guard is in configure.in" grep -c 'linux_getgrouplist_ok=cross' configure.in # Psion's configure.patch is itself an autoconf-compatibility patch: it rewrites # AC_DEFUN(NAME, ...) as AC_DEFUN([NAME], ...) right through aclocal.m4, which is # what a 2.5x autoconf wanted. It stops one short. AC_TRY_RUN_STRICT ends with # # AC_TRY_RUN([$1],[$5],[$6],[$7]); # # and under autoconf 2.61 that macro expands to a block ending in "fi", so the # trailing semicolon lands alone at the start of the next line and no shell will # parse it -- "configure: line 3930: syntax error near unexpected token ';'". # The semicolon is a no-op in the original. It is removed in the source tree, # in the same spirit as Psion's own hunks; this only checks it has not come back. echo "=== VERIFY: no trailing semicolon after AC_TRY_RUN in AC_TRY_RUN_STRICT" if grep -q 'AC_TRY_RUN(\[\$1\],\[\$5\],\[\$6\],\[\$7\]);' aclocal.m4; then echo "SEMICOLON_BACK -- configure will not parse"; exit 1 fi echo "semicolon fix present" echo "=== do_configure_prepend, verbatim from samba_3.0.7.oe" ./script/mkversion.sh if [ ! -e acinclude.m4 ]; then cat aclocal.m4 > acinclude.m4 fi echo "VERSION_H=$(head -c 200 include/version.h 2>/dev/null)" echo "=== autoconf (the tag ships no configure)" autoconf 2>&1 | tail -20 if [ ! -x configure ]; then echo "AUTOCONF_FAILED -- trying autoconf2.59/2.13 if present" autoconf2.59 2>&1 | tail -5 fi ls -la configure 2>/dev/null || { echo "NO_CONFIGURE"; exit 1; } # The tag ships no include/config.h.in either -- it is generated, and without it # config.status stops at "cannot find input file: include/config.h.in" after a # fully successful configure run. "inherit autotools" runs autoheader as well. echo "=== autoheader" autoheader 2>&1 | tail -10 ls -la include/config.h.in 2>/dev/null || { echo "NO_CONFIG_H_IN"; exit 1; } # The chroot's /bin/sh is busybox, which has no $LINENO. autoconf 2.61's # fallback rewrites the script into configure.lineno with sed and the result # does not parse under ash: "3929: Syntax error: ';' unexpected". Every other # package here configured fine because its tarball shipped a configure # generated by a 2.5x autoconf at release time; this one is generated now. # bash has $LINENO, so the rewrite never happens. /bin/sh stays busybox. export CONFIG_SHELL=/bin/bash /bin/bash -c 'echo "BASH_OK=$BASH_VERSION lineno=$LINENO"' echo "=== configure, with Psion's EXTRA_OECONF" /bin/bash ./configure \ --prefix=/usr --libdir=/usr/lib --bindir=/usr/bin --sbindir=/usr/sbin \ --disable-cups --with-readline=/usr \ --without-ads --without-automount --with-smbmount \ --with-configdir=/etc \ > /build/out/conf.log 2>&1 echo "RC_conf=$?" tail -25 /build/out/conf.log echo "=== VERIFY: readline and smbmount were actually picked up" grep -iE 'readline|smbmount' /build/out/conf.log | tail -12 echo "=== build only what FILES_smbclient ships, plus the library" make SHELL=/bin/bash proto 2>&1 | tail -5 for t in bin/smbclient bin/nmblookup bin/smbmount bin/smbmnt bin/smbumount bin/libsmbclient.so; do echo "--- make $t" make SHELL=/bin/bash "$t" > /build/out/make-$(basename $t).log 2>&1 echo "RC_$(basename $t)=$?" tail -6 /build/out/make-$(basename $t).log done echo "=== artefacts" for f in smbclient nmblookup smbmount smbmnt smbumount libsmbclient.so; do if [ -f "bin/$f" ]; then cp "bin/$f" /build/out/bin/ echo "GOT_$f=$(wc -c < bin/$f)" else echo "MISSING_$f" fi done echo "=== the *.dat unicode maps FILES_smbclient also ships" mkdir -p /build/out/dat for d in codepages/*.dat source/codepages/*.dat ../codepages/*.dat; do [ -f "$d" ] && cp "$d" /build/out/dat/ 2>/dev/null done ls /build/out/dat/ 2>/dev/null | head echo "DAT_COUNT=$(ls /build/out/dat/ 2>/dev/null | wc -l)" echo "=== VERIFY: OABI and what they link" for f in /build/out/bin/*; do echo "--- $f" readelf -h "$f" 2>/dev/null | grep -iE 'class|flags|machine' readelf -d "$f" 2>/dev/null | grep NEEDED done echo BUILD_SCRIPT_DONE