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