# $Id$ PNAME="samba" PVER="3.6.25" PBUILD="r2" PCAT="net-fs" DESCRIPTION="Samba provides seamless file and print services to SMB/CIFS clients." HOMEPAGE="http://www.samba.org" DEPEND=">= virtual/glibc >= dev-libs/popt-1.16 >= sys-libs/ncurses-5.9 >= sys-libs/libcap-2" SDEPEND=">= sys-dev/automake-4 >= sys-dev/autoconf-5 >= virtual/sed" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" FILESDIR="${SOURCEDIR}/samba" msetfeature "!check" # no check target in Makefile sminclude mtools systemd alx NMBD_SVC_VER=1.2 SRC_URI=( http://us1.samba.org/samba/ftp/stable/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/nmbd.service-${NMBD_SVC_VER} ) UP2DATE="updatecmd http://ftp.samba.org/pub/samba | grep '${PNAME}-3.6.*' | lasttarball gz" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # examples: to be copied as docs rm -rf ${SRCDIR}/examples.ORIG || die # add our vendor suffix sed -i "s:^\(SAMBA_VERSION_VENDOR_SUFFIX=\).*:\1\"magellan\":" ${SRCDIR}/source3/VERSION || die cd ${SRCDIR}/source3 sh script/mkversion.sh || die # compilation fix # (u)mount.cifs is broken; missing include/version.h header ln -snf ../include ${SRCDIR}/source3/client || die } src_compile() { cd ${SRCDIR}/source3 # remove swat completely now; since we have no httpd server yet # if really needed we make an extra package to save diskspace # --disable-swat option is there, no patches needed anymore ;) mconfigure \ --with-fhs \ --sysconfdir=/etc/samba \ --localstatedir=/var \ --with-configdir=/etc/samba \ --libdir=/usr/$(mlibdir)/samba \ --with-swatdir=/usr/share/doc/${PNAME}-${PVER}/swat \ --with-piddir=/var/run/samba \ --with-lockdir=/var/cache/samba \ --with-logfilebase=/var/log/samba \ --with-privatedir=/var/lib/samba/private \ --enable-shared-libs \ --without-cifsmount \ --without-automount \ --without-libsmbclient \ --without-syslog \ --without-acl-support \ --disable-cups \ --without-krb5 \ --without-ldap \ --without-readline \ --without-winbind \ --without-pam \ --without-pam_smbpass \ --without-quotas \ --without-sys-quotas \ --disable-swat \ --disable-avahi \ --disable-developer \ --disable-dmalloc \ || die mmake bin/nmbd || die } src_install() { cd ${SRCDIR}/source3 minstalldir /usr/sbin || die minstallexec bin/nmbd /usr/sbin/nmbd || die minstalldir /usr/$(mlibdir) || die mcopy -a bin/lib*.so\* /usr/$(mlibdir) || die # needed directories by samba at runtime mkeepdir /var/run/samba || die mkeepdir /var/lib/samba || die mkeepdir /var/cache/samba || die # install systemd units minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die minstalldir /etc/tmpfiles.d || die MCONFIG=/etc/tmpfiles.d/samba.conf mclearconfig || die maddconfig 'd /run/samba 0755 root root -' # create a mininmal configuration to get nmbd working minstalldir /etc/samba || die echo '[global]' > ${BINDIR}/etc/samba/smb.conf || die echo 'workgroup = WORKGROUP' >> ${BINDIR}/etc/samba/smb.conf || die echo '#netbios name = ' >> ${BINDIR}/etc/samba/smb.conf || die echo 'dns proxy = no' >> ${BINDIR}/etc/samba/smb.conf || die } preinstall() { add_conf_prot_ignore /etc/samba/smb.conf /etc/tmpfiles.d/samba.conf } postinstall() { mstartunit nmbd.service } postremove() { mstopunit nmbd.service }