Skip to content

Commit

Permalink
samba4: samba3 to samba4 migration
Browse files Browse the repository at this point in the history
Allow to run unlimited separate smbds on a single machine.
Configuration files in /project/admin/samba4
startup via /etc/mxstartups.
  • Loading branch information
wwwutz authored and donald committed Jul 7, 2017
1 parent a64b2b7 commit 84bdc37
Showing 1 changed file with 18 additions and 29 deletions.
47 changes: 18 additions & 29 deletions samba4.be0
Original file line number Diff line number Diff line change
@@ -1,65 +1,54 @@
#!/usr/bin/env beesh
# BEE_VERSION samba4-4.6.5-2
# BEE_VERSION samba4-4.6.5-3

SRCURL[0]="http://www.samba.org/samba/ftp/stable/samba-${PKGVERSION}.tar.gz"
SRCURL[0]="https://www.samba.org/samba/ftp/stable/samba-${PKGVERSION}.tar.gz"

EXCLUDE="^/var"
# mariux patch to allow -with-config-file=
PATCHURL[0]="/src/mariux/download/samba4-add-config-file-configure-option.patch"

PREFIX=/usr/local/samba4
LOCALSTATEDIR=/var/samba4
SYSCONFDIR=${PREFIX}/etc
VARPATH=/var/samba4/localhost
BEE_BUILDTYPE=
# build_in_sourcedir

mee_configure() {

# ./configure \
# see also https://github.com/samba-team/samba/blob/master/dynconfig/wscript
python ./buildtools/bin/waf configure \
--prefix=${PREFIX} \
--sysconfdir=${SYSCONFDIR} \
--with-configdir=/etc/samba4 \
--localstatedir=state \
--with-lockdir=locks \
--with-statedir=state \
--with-privatedir=private \
--with-logfilebase=log \
--with-cachedir=cache \
--with-piddir=. \
--with-config-file=/etc/samba4/smb.conf-localhost \
--localstatedir=${VARPATH}/state \
--with-lockdir=${VARPATH}/locks \
--with-statedir=${VARPATH}/state \
--with-privatedir=${VARPATH}/private \
--with-logfilebase=${VARPATH}/log \
--with-cachedir=${VARPATH}/cache \
--with-piddir=${VARPATH} \
--with-sockets-dir=${VARPATH}/run \
--with-privileged-socket-dir=${VARPATH}/run-priv \
--with-pammodulesdir=/lib/security \
--without-ad-dc \
--without-winbind \
--without-systemd

}

mee_build() {
# use 'make showflags' to get defaults... and add rpath GRMPF!!

make ${BEE_MAKEFLAGS} LDFLAGS='-pie -Wl,-z,relro -Wl,--as-needed -L./bin -Wl,-rpath,${LIBDIR}'
}

mee_install() {
make install DESTDIR=${D}

mkdir -p ${D}${PREFIX}
# ln -s ${LOCALSTATEDIR} ${D}${PREFIX}/var
mkdir -p ${D}${SYSCONFDIR}

mkdir -p ${D}/lib
mkdir -p ${D}/usr/lib

# enable resolve/map windows domain usernames
mv -v ${D}${LIBDIR}/libnss_win{s,bind}.so* ${D}/lib
ln -v -sf ../../lib/libnss_winbind.so.2 ${D}${LIBDIR}/libnss_winbind.so
ln -v -sf ../../lib/libnss_wins.so.2 ${D}${LIBDIR}/libnss_wins.so

# clean up variable folders
# in our case we run smbd in /var/samba4/${NAME}
rmdir -v ${D}/cache
rmdir -v ${D}/locks
rmdir -v ${D}/log
rmdir -v ${D}/private
rm -rv ${D}/state

# for donald..
echo "PATH=${BINDIR}:${SBINDIR}:\${PATH}" >>${D}${PREFIX}/profile

}

0 comments on commit 84bdc37

Please sign in to comment.