9 |
DESCRIPTION="Samba provides seamless file and print services to SMB/CIFS clients." |
DESCRIPTION="Samba provides seamless file and print services to SMB/CIFS clients." |
10 |
HOMEPAGE="http://www.samba.org" |
HOMEPAGE="http://www.samba.org" |
11 |
|
|
12 |
|
# todo: external ldb and tevent! |
13 |
DEPEND=">= virtual/glibc |
DEPEND=">= virtual/glibc |
14 |
>= net-print/cups-2.0 |
>= net-print/cups-2.0 |
15 |
>= dev-db/tdb-1.3 |
>= dev-db/tdb-1.3 |
16 |
>= dev-libs/popt-1.16 |
>= dev-libs/popt-1.16 |
17 |
>= dev-libs/talloc-2.1 |
>= dev-libs/talloc-2.1 |
18 |
|
>= sys-apps/acl-2.2 |
19 |
>= sys-libs/ncurses-5.9 |
>= sys-libs/ncurses-5.9 |
20 |
>= sys-libs/readline-6.3 |
>= sys-libs/readline-6.3 |
21 |
|
>= sys-libs/pam-1.1 |
22 |
|
>= sys-libs/libsystemd-daemon-220 |
23 |
>= app-admin/gamin-0.1.10 |
>= app-admin/gamin-0.1.10 |
24 |
>= dev-libs/openssl-1.0.2 |
>= dev-libs/openssl-1.0.2 |
25 |
>= net-dns/avahi-0.6.31 |
>= net-dns/avahi-0.6.31 |
26 |
|
>= net-nds/libldap-2.4 |
27 |
>= net-fs/cifs-utils-6.3" |
>= net-fs/cifs-utils-6.3" |
28 |
|
|
29 |
SDEPEND=">= sys-dev/automake-4 |
SDEPEND=">= sys-dev/automake-4 |
30 |
>= sys-dev/autoconf-5 |
>= sys-dev/autoconf-5 |
31 |
>= virtual/sed |
>= virtual/sed |
32 |
|
>= dev-lang/perl-5.22.0 |
33 |
|
>= dev-lang/python-2.7 |
34 |
|
>= net-nds/openldap-2.4 |
35 |
>= app-text/docbook-xsl-stylesheets-1.78" |
>= app-text/docbook-xsl-stylesheets-1.78" |
36 |
|
|
37 |
SRCFILE="${PNAME}-${PVER}.tar.gz" |
SRCFILE="${PNAME}-${PVER}.tar.gz" |
38 |
SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" |
|
SRCSUBDIR="source3" |
|
39 |
|
|
40 |
msetfeature "!check" # no check target in Makefile |
msetfeature "!check" # no check target in Makefile |
41 |
sminclude mtools multilib systemd |
sminclude mtools multilib systemd |
42 |
|
|
43 |
SMBD_SVC_VER=1.3 |
# imap modules |
44 |
NMBD_SVC_VER=1.2 |
SMB_SHARED_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2" |
45 |
|
# pdb modules |
46 |
|
SMB_SHARED_MODULES+=",pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4,auth_unix" |
47 |
|
# auth modules |
48 |
|
SMB_SHARED_MODULES+=",auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4" |
49 |
|
|
50 |
|
# use external tdb |
51 |
|
SMB_BUNDLED_LIBRARIES="!tdb" |
52 |
|
# use external talloc |
53 |
|
SMB_BUNDLED_LIBRARIES+=",!talloc,!pytalloc-util" |
54 |
|
# use internal tevent |
55 |
|
SMB_BUNDLED_LIBRARIES+=",tevent" |
56 |
|
# use external popt |
57 |
|
SMB_BUNDLED_LIBRARIES+=",!popt" |
58 |
|
# use internal ldb |
59 |
|
SMB_BUNDLED_LIBRARIES+=",ldb,pyldb-util" |
60 |
|
|
61 |
|
CONFD_VER=1.2 |
62 |
|
SMBD_SVC_VER=1.4 |
63 |
|
NMBD_SVC_VER=1.3 |
64 |
|
WINBINDD_SVC_VER=1.2 |
65 |
|
|
66 |
SRC_URI=( |
SRC_URI=( |
67 |
http://us1.samba.org/samba/ftp/stable/${SRCFILE} |
http://us1.samba.org/samba/ftp/stable/${SRCFILE} |
68 |
mirror://${PNAME}/${SRCFILE} |
mirror://${PNAME}/${SRCFILE} |
|
mirror://${PNAME}/smb.conf-3.0.14a |
|
69 |
mirror://${PNAME}/lmhosts |
mirror://${PNAME}/lmhosts |
70 |
mirror://${PNAME}/smbusers |
mirror://${PNAME}/smbusers |
71 |
mirror://${PNAME}/samba.confd |
mirror://${PNAME}/samba.confd |
72 |
|
mirror://${PNAME}/samba.pamd |
73 |
mirror://${PNAME}/samba.logrotate |
mirror://${PNAME}/samba.logrotate |
74 |
mirror://${PNAME}/nmbd.service-${NMBD_SVC_VER} |
mirror://${PNAME}/nmbd.service-${NMBD_SVC_VER} |
75 |
mirror://${PNAME}/smbd.service-${SMBD_SVC_VER} |
mirror://${PNAME}/smbd.service-${SMBD_SVC_VER} |
76 |
mirror://${PNAME}/winbindd.service |
mirror://${PNAME}/winbindd.service |
77 |
|
mirror://${PNAME}/${PNAME}-${PVER}-s4-lib-tls-use-gnutls_priority_set_direct.patch |
78 |
) |
) |
79 |
|
|
80 |
UP2DATE="updatecmd http://ftp.samba.org/pub/samba | grep '${PNAME}-[0-9].*' | highesttarball gz" |
UP2DATE="updatecmd http://ftp.samba.org/pub/samba | grep '${PNAME}-[0-9].*' | highesttarball gz" |
83 |
{ |
{ |
84 |
munpack ${SRCFILE} || die |
munpack ${SRCFILE} || die |
85 |
|
|
86 |
|
# fix build with gnutls-3.4; upstream pending |
87 |
|
mpatch ${PNAME}-${PVER}-s4-lib-tls-use-gnutls_priority_set_direct.patch || die |
88 |
|
|
89 |
# add our vendor suffix |
# add our vendor suffix |
90 |
all-abis 'sed -i "s:^\(SAMBA_VERSION_VENDOR_SUFFIX=\).*:\1\"magellan\":" VERSION || die' |
all-abis 'sed -i "s:^\(SAMBA_VERSION_VENDOR_SUFFIX=\).*:\1\"magellan\":" VERSION || die' |
91 |
all-abis 'sh script/mkversion.sh || die' |
#all-abis 'sh script/mkversion.sh || die' # new waf build system creates this one automatically |
|
|
|
|
# compilation fix |
|
|
# (u)mount.cifs is broken; missing include/version.h header |
|
|
all-abis 'ln -snf ../include client || die' |
|
92 |
} |
} |
93 |
|
|
94 |
src_compile() |
src_compile() |
95 |
{ |
{ |
|
# remove swat completely now; since we have no httpd server yet |
|
|
# if really needed we make an extra package to save diskspace |
|
96 |
mconfigure \ |
mconfigure \ |
97 |
--enable-fhs \ |
--enable-fhs \ |
98 |
--sysconfdir=/etc/samba \ |
--sysconfdir=/etc/samba \ |
99 |
--localstatedir=/var \ |
--localstatedir=/var \ |
100 |
--with-configdir=/etc/samba \ |
--with-configdir=/etc/samba \ |
101 |
--libdir=/usr/'$(mlibdir)'/samba \ |
--with-modulesdir=/usr/'$(mlibdir)'/samba \ |
|
--with-swatdir=/usr/share/doc/${PNAME}-${PVER}/swat \ |
|
102 |
--with-piddir=/run/samba \ |
--with-piddir=/run/samba \ |
103 |
--with-lockdir=/var/cache/samba \ |
--with-lockdir=/var/cache/samba \ |
104 |
--with-logfilebase=/var/log/samba \ |
--with-logfilebase=/var/log/samba \ |
105 |
--with-privatedir=/var/lib/samba/private \ |
--with-privatedir=/var/lib/samba/private \ |
106 |
--enable-shared-libs \ |
--bundled-libraries="${SMB_BUNDLED_LIBRARIES}" \ |
107 |
--with-automount \ |
--with-shared-modules="${SMB_SHARED_MODULES}" \ |
|
--with-libsmbclient \ |
|
108 |
--with-syslog \ |
--with-syslog \ |
109 |
--without-acl-support \ |
--with-acl-support \ |
110 |
--enable-cups \ |
--enable-cups \ |
111 |
--without-krb5 \ |
--with-ads \ |
112 |
--without-ldap \ |
--with-ldap \ |
|
--with-readline \ |
|
113 |
--with-winbind \ |
--with-winbind \ |
114 |
--without-pam \ |
--with-pam \ |
|
--without-pam_smbpass \ |
|
|
--without-libtdb \ |
|
|
--enable-external-libtdb \ |
|
|
--without-libtalloc \ |
|
|
--enable-external-libtalloc \ |
|
115 |
--with-quotas \ |
--with-quotas \ |
|
--with-sys-quotas \ |
|
|
--with-cifsmount=no \ |
|
116 |
--with-systemd \ |
--with-systemd \ |
|
--disable-swat \ |
|
117 |
--enable-avahi \ |
--enable-avahi \ |
|
--disable-developer \ |
|
|
--disable-dmalloc \ |
|
118 |
--disable-rpath \ |
--disable-rpath \ |
119 |
--disable-rpath-install \ |
--disable-rpath-install \ |
120 |
|| die |
|| die |
124 |
|
|
125 |
src_install() |
src_install() |
126 |
{ |
{ |
127 |
# needed directories |
# required directories |
128 |
minstalldir /etc/samba || die |
minstalldir /etc/samba || die |
129 |
all-abis 'minstalldir /usr/$(mlibdir)/cups/backend || die' |
all-abis 'minstalldir /usr/$(mlibdir)/cups/backend || die' |
130 |
minstalldir /usr/share/doc/${PNAME}-${PVER}/examples || die |
minstalldir /usr/share/doc/${PNAME}-${PVER}/examples || die |
131 |
|
|
132 |
# needed directories by samba at runtime |
# required directories by samba at runtime |
133 |
mkeepdir /var/log/samba || die |
mkeepdir /var/log/samba || die |
134 |
mkeepdir /run/samba || die |
mkeepdir /run/samba || die |
135 |
mkeepdir /var/cache/samba || die |
mkeepdir /var/cache/samba || die |
147 |
mchmod 0700 /var/lib/samba/private || die |
mchmod 0700 /var/lib/samba/private || die |
148 |
mchmod 1777 /var/spool/samba || die |
mchmod 1777 /var/spool/samba || die |
149 |
|
|
150 |
mmake DESTDIR=${BINDIR} install-everything || die |
mmake DESTDIR=${BINDIR} install || die |
151 |
|
|
152 |
# if exist remove *.old binaries |
# if exist remove *.old binaries |
153 |
if [[ -n $(find ${BINDIR}/usr/bin -type f -name '*.old') ]] |
if [[ -n $(find ${BINDIR}/usr/bin -type f -name '*.old') ]] |
158 |
done |
done |
159 |
fi |
fi |
160 |
|
|
|
# install wins nsswitch extensions |
|
|
SRCSUBDIR="" # nsswitch resides under $SRCDIR |
|
|
all-abis 'minstalldir /usr/$(mlibdir) || die' |
|
|
all-abis 'minstallfile nsswitch/libnss_wins.so /usr/$(mlibdir) || die' |
|
|
all-abis 'mlink libnss_wins.so /usr/$(mlibdir)/libnss_wins.so.2 || die' |
|
|
all-abis 'minstallfile nsswitch/libnss_winbind.so /usr/$(mlibdir) || die' |
|
|
all-abis 'mlink libnss_winbind.so /usr/$(mlibdir)/libnss_winbind.so.2 || die' |
|
|
|
|
|
# samba doesn't create these symlinks anymore |
|
|
all-abis 'mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so.0 || die' |
|
|
all-abis 'mlink samba/libsmbclient.so /usr/$(mlibdir)/libsmbclient.so || die' |
|
|
# using external talloc |
|
|
# all-abis 'mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so.1 || die' |
|
|
# all-abis 'mlink samba/libtalloc.so /usr/$(mlibdir)/libtalloc.so || die' |
|
|
all-abis 'mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so.0 || die' |
|
|
all-abis 'mlink samba/libwbclient.so /usr/$(mlibdir)/libwbclient.so || die' |
|
|
all-abis 'mlink samba/libtevent.so /usr/$(mlibdir)/libtevent.so || die' |
|
|
all-abis 'mlink samba/libtevent.so /usr/$(mlibdir)/libtevent.so.0 || die' |
|
|
|
|
161 |
# add cups printing support |
# add cups printing support |
162 |
all-abis 'mlink ../../../bin/smbspool /usr/$(mlibdir)/cups/backend/smb || die' |
all-abis 'mlink ../../../bin/smbspool /usr/$(mlibdir)/cups/backend/smb || die' |
163 |
|
|
175 |
minstalletc smbusers smbusers /etc/samba || die |
minstalletc smbusers smbusers /etc/samba || die |
176 |
|
|
177 |
# install systemd units |
# install systemd units |
178 |
minstallconf samba.confd samba || die |
minstallconf samba.confd-${CONFD_VER} samba || die |
179 |
minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die |
minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die |
180 |
minstallunit smbd.service-${SMBD_SVC_VER} smbd.service || die |
minstallunit smbd.service-${SMBD_SVC_VER} smbd.service || die |
181 |
minstallunit winbindd.service || die |
minstallunit winbindd.service-${WINBINDD_SVC_VER} winbindd.service || die |
182 |
|
minstallunit samba.service || die |
183 |
minstalldir /etc/tmpfiles.d || die |
minstalldir /etc/tmpfiles.d || die |
184 |
MCONFIG=/etc/tmpfiles.d/samba.conf |
MCONFIG=/etc/tmpfiles.d/samba.conf |
185 |
mclearconfig || die |
mclearconfig || die |
186 |
maddconfig 'd /run/samba 0755 root root -' |
maddconfig 'd /run/samba 0755 root root -' |
187 |
|
|
188 |
|
# install pam configuration |
189 |
|
minstallpam samba.pam samba || die |
190 |
|
|
191 |
# install logrotate config |
# install logrotate config |
192 |
minstalllog samba.logrotate samba || die |
minstalllog samba.logrotate samba || die |
193 |
|
|
|
# # install example docs - not wanted anymore to save some space |
|
|
# cp -a ${SRCDIR}/examples/* ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples || die |
|
|
# |
|
|
# # fix all permissions |
|
|
# chmod -R 755 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples -type d) || die |
|
|
# chmod -R 644 $(find ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/examples ! -type d) || die |
|
|
|
|
|
# # remove unneeded docs, this saves some space ;) |
|
|
# rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/help/{guide,howto,devel} || die |
|
|
# rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat/using_samba || die |
|
|
|
|
|
# using a patch now |
|
|
# # remove swat completely now; since we have no httpd server yet |
|
|
# # if really needed we make an extra package to save diskspace |
|
|
# rm -f ${BINDIR}/usr/sbin/swat || die |
|
|
# rm -f ${BINDIR}/usr/share/man/man8/swat.8 || die |
|
|
# rm -rf ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/swat || die |
|
|
|
|
194 |
# other docs |
# other docs |
195 |
minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die |
minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die |
196 |
} |
} |