Magellan Linux

Contents of /trunk/extras/samba/samba-4.6.3-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 29136 - (show annotations) (download)
Wed May 24 11:52:58 2017 UTC (7 years ago) by niro
File size: 6042 byte(s)
-rebuild without splitted libsystemd
1 # $Id$
2
3 PNAME="samba"
4 PVER="4.6.3"
5 PBUILD="r3"
6
7 PCAT="net-fs"
8
9 DESCRIPTION="Samba provides seamless file and print services to SMB/CIFS clients."
10 HOMEPAGE="http://www.samba.org"
11
12 # todo: external ldb and tevent!
13 DEPEND=">= virtual/glibc
14 >= net-print/cups-2.2
15 >= dev-db/tdb-1.3
16 >= dev-libs/popt-1.16
17 >= dev-libs/talloc-2.1
18 >= sys-apps/acl-2.2
19 >= sys-libs/ncurses-6.0
20 >= sys-libs/readline-7.0
21 >= sys-libs/pam-1.1
22 >= sys-libs/libsystemd-230
23 >= app-admin/gamin-0.1.10
24 >= dev-libs/openssl-1.0.2
25 >= net-dns/avahi-0.6.31
26 >= app-crypt/gnutls-3.5
27 >= net-nds/libldap-2.4
28 >= net-fs/cifs-utils-6.4"
29
30 SDEPEND=">= sys-dev/automake-4
31 >= sys-dev/autoconf-5
32 >= virtual/sed
33 >= dev-lang/perl-5.24.1
34 >= dev-lang/python-2.7
35 >= net-nds/openldap-2.4
36 >= app-text/docbook-xsl-stylesheets-1.78"
37
38 SRCFILE="${PNAME}-${PVER}.tar.gz"
39 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
40
41 msetfeature "!check" # no check target in Makefile
42 sminclude mtools multilib systemd
43
44 # imap modules
45 SMB_SHARED_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
46 # pdb modules
47 SMB_SHARED_MODULES+=",pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4,auth_unix"
48 # auth modules
49 SMB_SHARED_MODULES+=",auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
50
51 # use external tdb
52 SMB_BUNDLED_LIBRARIES="!tdb"
53 # use external talloc
54 SMB_BUNDLED_LIBRARIES+=",!talloc,!pytalloc-util"
55 # use internal tevent
56 SMB_BUNDLED_LIBRARIES+=",tevent"
57 # use external popt
58 SMB_BUNDLED_LIBRARIES+=",!popt"
59 # use internal ldb
60 SMB_BUNDLED_LIBRARIES+=",ldb,pyldb-util"
61
62 CONFD_VER=1.2
63 SMBD_SVC_VER=1.5
64 NMBD_SVC_VER=1.3
65 WINBINDD_SVC_VER=1.2
66
67 SRC_URI=(
68 http://us1.samba.org/samba/ftp/stable/${SRCFILE}
69 mirror://${PNAME}/${SRCFILE}
70 mirror://${PNAME}/lmhosts
71 mirror://${PNAME}/smbusers
72 mirror://${PNAME}/samba.confd-${CONFD_VER}
73 mirror://${PNAME}/samba.pamd
74 mirror://${PNAME}/samba.logrotate
75 mirror://${PNAME}/samba.service
76 mirror://${PNAME}/nmbd.service-${NMBD_SVC_VER}
77 mirror://${PNAME}/smbd.service-${SMBD_SVC_VER}
78 mirror://${PNAME}/winbindd.service-${WINBINDD_SVC_VER}
79 )
80
81 UP2DATE="updatecmd http://ftp.samba.org/pub/samba | grep '${PNAME}-[0-9].*' | highesttarball gz"
82
83 src_prepare()
84 {
85 munpack ${SRCFILE} || die
86
87 # add our vendor suffix
88 all-abis 'sed -i "s:^\(SAMBA_VERSION_VENDOR_SUFFIX=\).*:\1\"magellan\":" VERSION || die'
89 #all-abis 'sh script/mkversion.sh || die' # new waf build system creates this one automatically
90 }
91
92 src_compile()
93 {
94 mconfigure \
95 --enable-fhs \
96 --sysconfdir=/etc/samba \
97 --localstatedir=/var \
98 --with-configdir=/etc/samba \
99 --with-modulesdir=/usr/'$(mlibdir)'/samba \
100 --with-piddir=/run/samba \
101 --with-lockdir=/var/cache/samba \
102 --with-logfilebase=/var/log/samba \
103 --with-privatedir=/var/lib/samba/private \
104 --bundled-libraries="${SMB_BUNDLED_LIBRARIES}" \
105 --with-shared-modules="${SMB_SHARED_MODULES}" \
106 --with-syslog \
107 --with-acl-support \
108 --enable-cups \
109 --with-ads \
110 --with-ldap \
111 --with-winbind \
112 --with-pam \
113 --with-quotas \
114 --with-systemd \
115 --enable-avahi \
116 --disable-rpath \
117 --disable-rpath-install \
118 || die
119
120 mmake || die
121 }
122
123 src_install()
124 {
125 # required directories
126 minstalldir /etc/samba || die
127 all-abis 'minstalldir /usr/$(mlibdir)/cups/backend || die'
128 minstalldir /usr/share/doc/${PNAME}-${PVER}/examples || die
129
130 # required directories by samba at runtime
131 mkeepdir /var/log/samba || die
132 mkeepdir /run/samba || die
133 mkeepdir /var/cache/samba || die
134 mkeepdir /var/lib/samba/netlogon || die
135 mkeepdir /var/lib/samba/profiles || die
136 mkeepdir /var/lib/samba/printers/W32X86 || die
137 mkeepdir /var/lib/samba/printers/WIN40 || die
138 mkeepdir /var/lib/samba/printers/W32ALPHA || die
139 mkeepdir /var/lib/samba/printers/W32MIPS || die
140 mkeepdir /var/lib/samba/printers/W32PPC || die
141 mkeepdir /var/lib/samba/private || die
142 mkeepdir /var/spool/samba || die
143
144 # fix permissions
145 mchmod 0700 /var/lib/samba/private || die
146 mchmod 1777 /var/spool/samba || die
147
148 mmake DESTDIR=${BINDIR} install || die
149
150 # if exist remove *.old binaries
151 if [[ -n $(find ${BINDIR}/usr/bin -type f -name '*.old') ]]
152 then
153 for i in ${BINDIR}/usr/bin/*.old
154 do
155 [[ -e ${i} ]] && rm -f ${i} || die
156 done
157 fi
158
159 # add cups printing support
160 all-abis 'mlink ../../../bin/smbspool /usr/$(mlibdir)/cups/backend/smb || die'
161
162 # install our config files
163 # fake smb.conf to get smbmount work
164 memptyfile /etc/samba/smb.conf || die
165
166 # our smb example config
167 minstalletc packaging/LSB/smb.conf smb.conf.example /etc/samba || die
168 # fix logrotate
169 sed -i 's:log.%m:%m.log:g' ${BINDIR}/etc/samba/smb.conf.example || die
170
171 # our lmhosts and smbusers config
172 minstalletc lmhosts lmhosts /etc/samba || die
173 minstalletc smbusers smbusers /etc/samba || die
174
175 # install systemd units
176 minstallconf samba.confd-${CONFD_VER} samba || die
177 minstallunit nmbd.service-${NMBD_SVC_VER} nmbd.service || die
178 minstallunit smbd.service-${SMBD_SVC_VER} smbd.service || die
179 minstallunit winbindd.service-${WINBINDD_SVC_VER} winbindd.service || die
180 minstallunit samba.service || die
181 minstalldir /etc/tmpfiles.d || die
182 MCONFIG=/etc/tmpfiles.d/samba.conf
183 mclearconfig || die
184 maddconfig 'd /run/samba 0755 root root -'
185
186 # install pam configuration
187 minstallpam samba.pamd samba || die
188
189 # install logrotate config
190 minstalllog samba.logrotate samba || die
191
192 # other docs
193 minstalldocs COPYING Manifest README REVISION Read-Manifest-Now Roadmap WHATSNEW.txt || die
194 }
195
196 postinstall()
197 {
198 mstartunit nmbd.service
199 mstartunit winbindd.service
200 mstartunit smbd.service
201
202 echo
203 echo "To initialize samba's password database, please run:"
204 echo " pdbedit --force-initialized-passwords"
205 echo
206 echo "If you experience client locks in file transfers _only_, try the parameter"
207 echo " use sendfile = no (man smb.conf(5), man sendfile(2))"
208 echo
209 echo "There also seem some problems with the smbfs implementation of the recent 2.6 kernels."
210 echo "If you experience problems (lockups) with smbfs, try cifs as an alternative."
211 echo
212 }
213
214 postremove()
215 {
216 mstopunit nmbd.service
217 mstopunit winbindd.service
218 mstopunit smbd.service
219 }