aboutsummaryrefslogtreecommitdiffstats
path: root/main/samba/APKBUILD
blob: e0efee320857d21f170a072f7d5cf70b4e4cbe6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=samba
pkgver=4.2.1
pkgrel=0
pkgdesc="Tools to access a server's filespace and printers via SMB"
url="http://www.samba.org"
arch="all"
license="GPL3"
subpackages="$pkgname-dev $pkgname-doc
	$pkgname-common
	$pkgname-initscript
	$pkgname-common-tools:_common_tools
	$pkgname-common-libs:_common_libs
	libsmbclient
	$pkgname-client
	$pkgname-client-libs:_client_libs
	$pkgname-dc
	$pkgname-dc-libs:_dc_libs

	$pkgname-winbind
	libwbclient
	$pkgname-winbind-clients:_winbind_clients
	$pkgname-winbind-krb5-locator:_winbind_krb5_locator
	$pkgname-libnss-winbind:_libnss_winbind

	$pkgname-server
	$pkgname-server-libs:_server_libs
	$pkgname-ntdb-tools:_ntdb_tools

	$pkgname-pidl
	py-$pkgname:_py
	$pkgname-test:_test
	$pkgname-libs-py:_libs_py
	$pkgname-libs"

# samba backage only pulls in samba-server. This is helps to verify that
# no libs or files are forgotten during packaging
depends="$pkgname-server"

# note that heimdal is required (over mit krb5) for AD DC functionality
makedepends="popt-dev ncurses-dev openldap-dev heimdal-dev e2fsprogs-dev
	talloc-dev tdb-dev ldb-dev cups-dev python-dev libcap-dev
	tevent-dev iniparser-dev perl subunit-dev docbook-xsl libarchive-dev"
source="http://us1.samba.org/samba/ftp/stable/samba-$pkgver.tar.gz
	fix-libreplace.patch
	musl-fix-headers.patch
	uclibc-xattr-create.patch
	wrappers.patch
	heimdal-1.5-api.patch
	gnutls-3.4.0.patch
	domain.patch
	samba.initd
	samba.confd
	samba.logrotate
	"
pkggroups="winbind"

_builddir="$srcdir"/samba-$pkgver
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	rm source4/heimdal_build/krb5-types.h || return 1
}

build() {
	cd "$_builddir"
	local _jobs=$JOBS
	if [ -z "$_jobs" ]; then
		_jobs=$(awk '/^core id/ {n++} END{print n}' /proc/cpuinfo)
	fi
	./configure --prefix=/usr \
		--jobs=${_jobs:-2} \
		--sysconfdir=/etc/samba \
		--with-configdir=/etc/samba \
		--localstatedir=/var \
		--enable-fhs \
		--with-lockdir=/var/cache/samba \
		--with-piddir=/var/run/samba \
		--with-logfilebase=/var/log/samba \
		--without-pam \
		--without-systemd \
		--with-ads \
		--with-shared-modules=idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2,pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4,auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4 \
		--enable-cups \
		--without-gettext \
		--bundled-libraries=NONE,ntdb \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install

	install -d "$pkgdir"/var/log/samba \
		"$pkgdir"/usr/share/doc/samba \
		|| return 1
	install -d -m 0755 "$pkgdir"/var/lib/samba/sysvol || return 1
	install -D packaging/RHEL/setup/smbusers "$pkgdir"/etc/samba/smbusers \
		|| return 1
	install -m 0744 packaging/printing/smbprint "$pkgdir"/usr/bin/smbprint \
		|| return 1
	install -Dm644 "$srcdir"/samba.logrotate "$pkgdir"/etc/logrotate.d/samba
}

initscript() {
	pkgdesc="Init script for Samba"
	depends=""
	install -Dm755 $srcdir/samba.initd "$subpkgdir"/etc/init.d/samba
	install -Dm644 $srcdir/samba.confd "$subpkgdir"/etc/conf.d/samba
}

_mv_files() {
	local i
	for i in "$@"; do
		mkdir -p "$subpkgdir"/${i%/*}
		mv "$pkgdir"/$i "$subpkgdir"/$i || return 1
	done
}

common() {
	pkgdesc="Samba common files for both client an servers"
	depends=
	cd "$pkgdir"
	_mv_files \
		etc \
		usr/share/samba/codepages \
		var \
		|| return 1
	install -d -m700 "$subpkgdir"/var/lib/samba/private
}

# common-libs is an attempt to avoid libpython dependency for libsmbclient
_libs_py() {
	pkgdesc="Libraries that require libpython"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/samba/libsamba-net-samba4.so \
		usr/lib/samba/libsamba-python-samba4.so \
		|| return 1
	return 0
}

_common_tools() {
	pkgdesc="Tools for Samba servers and clients"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/bin/net \
		usr/bin/pdbedit \
		usr/bin/profiles \
		usr/bin/smbcontrol \
		usr/bin/smbpasswd \
		usr/bin/testparm \
		usr/lib/samba/libgpo-samba4.so \
		usr/lib/samba/libnet-keytab-samba4.so \
		|| return 1
}

_common_libs() {
	pkgdesc="Samba libraries shared by common-tools and servers"
	depends=""
	cd "$pkgdir"
	_mv_files \
		usr/lib/libnetapi.so.0 \
		usr/lib/libsmbldap.so.0 \
		usr/lib/samba/libads-samba4.so \
		usr/lib/samba/libauth-samba4.so \
		usr/lib/samba/libdfs-server-ad-samba4.so \
		usr/lib/samba/libndr-samba4.so \
		usr/lib/samba/libnpa-tstream-samba4.so \
		usr/lib/samba/libprinting-migrate-samba4.so \
		usr/lib/samba/libsmbd-base-samba4.so \
		usr/lib/samba/libsmbd-conn-samba4.so \
		usr/lib/samba/libsmbldaphelper-samba4.so \
		usr/lib/samba/pdb \
		|| return 1
}

libsmbclient() {
	pkgdesc="The SMB client library"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/libsmbclient.so.* \
		|| return 1
}

client() {
	pkgdesc="Samba client programs"
	depends="$pkgname-common=$pkgver-r$pkgrel"
	cd "$pkgdir"
	_mv_files \
		usr/bin/cifsdd \
		usr/bin/dbwrap_tool \
		usr/bin/nmblookup \
		usr/bin/oLschema2ldif \
		usr/bin/regdiff \
		usr/bin/regpatch \
		usr/bin/regshell \
		usr/bin/regtree \
		usr/bin/rpcclient \
		usr/bin/samba-regedit \
		usr/bin/sharesec \
		usr/bin/smbcacls \
		usr/bin/smbclient \
		usr/bin/smbcquotas \
		usr/bin/smbget \
		usr/bin/smbprint \
		usr/bin/smbspool \
		usr/bin/smbta-util \
		usr/bin/smbtar \
		usr/bin/smbtree \
		usr/lib/libregistry.so.* \
		usr/lib/samba/libcmdline-credentials-samba4.so \
		|| return 1
}

_client_libs() {
	pkgdesc="Samba libraries shared by clients and DC"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/libdcerpc.so.* \
		usr/lib/libsmbclient-raw.so.* \
		usr/lib/samba/libcli-ldap-samba4.so \
		usr/lib/samba/libhttp-samba4.so \
		usr/lib/samba/libnetif-samba4.so \
		|| return 1
}

dc() {
	pkgdesc="Samba AD Domain Controller"
	depends="py-samba=$pkgver-r$pkgrel $pkgname-common=$pkgver-r$pkgrel"
	cd "$pkgdir"
	_mv_files \
		usr/bin/samba-tool \
		usr/sbin/samba* \
		usr/lib/mit_samba.so \
		usr/lib/samba/ldb \
		usr/lib/samba/libpac-samba4.so \
		usr/lib/samba/gensec \
		\
		usr/lib/samba/bind9 \
		usr/lib/samba/process_model \
		usr/lib/samba/service \
		usr/share/samba/setup \
		|| return 1
}

_dc_libs() {
	pkgdesc="Samba AD Domain Controller libraries"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/samba/libntvfs-samba4.so \
		usr/lib/samba/libprocess-model-samba4.so \
		usr/lib/samba/libservice-samba4.so \
		usr/lib/samba/libshares-samba4.so \
		\
		usr/lib/libdcerpc-atsvc.so.* \
		usr/lib/libdcerpc-samr.so.* \
		usr/lib/libdcerpc-server.so.* \
		usr/lib/libsamba-policy.so.* \
		usr/lib/samba/libdnsserver-common-samba4.so \
		usr/lib/samba/libdsdb-module-samba4.so \
		|| return 1
}

_server_libs() {
	pkgdesc="Samba libraries shared by server and DC"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/samba/libLIBWBCLIENT-OLD-samba4.so \
		usr/lib/samba/libauth-unix-token-samba4.so \
		usr/lib/samba/libauth4-samba4.so \
		usr/lib/samba/libposix-eadb-samba4.so \
		|| return 1
}


winbind() {
	pkgdesc="Samba user and group resolver"
	depends="$pkgname-common=$pkgver-r$pkgrel"
	install="winbind.pre-install winbind.pre-upgrade winbind.post-install
		winbind.post-upgrade"
	cd "$pkgdir"
	_mv_files \
		usr/lib/samba/libMESSAGING-samba4.so \
		usr/lib/samba/libcluster-samba4.so \
		usr/lib/samba/libdcerpc-samba4.so \
		\
		usr/lib/samba/libidmap-samba4.so \
		usr/lib/samba/libnss-info-samba4.so \
		usr/sbin/winbindd \
		\
		usr/lib/samba/idmap \
		usr/lib/samba/nss_info \
		|| return 1
	install -d -g winbind -m 750 \
		"$subpkgdir"/var/cache/samba/winbindd_privileged
}

libwbclient() {
	pkgdesc="Samba winbind client libraries"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/libwbclient.so.* \
		usr/lib/samba/libwinbind-client-samba4.so \
		|| return 1
}

_winbind_clients() {
	pkgdesc="Samba winbind client tools"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/bin/ntlm_auth \
		usr/bin/wbinfo \
		|| return 1
}

_libnss_winbind() {
	pkgdesc="Samba winbind NSS plugin"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/libnss_winbind.so* \
		usr/lib/libnss_wins.so* \
		|| return 1
}

_winbind_krb5_locator() {
	pkgdesc="Samba winbind krb5 locator"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/winbind_krb5_locator.so \
		|| return 1
}

server() {
	pkgdesc="Samba server"
	depends="$pkgname-common=$pkgver-r$pkgrel
		$pkgname-initscript=$pkgver-r$pkgrel"
	cd "$pkgdir"
	_mv_files \
		usr/sbin/nmbd \
		usr/sbin/smbd \
		usr/bin/eventlogadm \
		usr/bin/smbstatus \
		\
		usr/lib/samba/auth \
		usr/lib/samba/hdb \
		usr/lib/samba/vfs \
		\
		usr/lib/samba/libxattr-tdb-samba4.so \
		usr/lib/samba/libdb-glue-samba4.so \
		usr/lib/samba/libnon-posix-acls-samba4.so \
		usr/lib/samba/libtdb-compat-samba4.so \
		usr/lib/samba/libHDB-SAMBA4-samba4.so \
		|| return 1
}


pidl() {
	pkgdesc="Perl IDL compiler"
	depends="perl"
	cd "$pkgdir"
	_mv_files \
		usr/bin/pidl \
		usr/share/perl* \
		|| return 1
}

_py() {
	pkgdesc="Samba python libraries"
	depends="py-tdb"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

_test() {
	pkgdesc="Samba server and client testing tools"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/bin/gentest \
		usr/bin/locktest \
		usr/bin/masktest \
		usr/bin/ndrdump \
		usr/bin/smbtorture \
		usr/lib/libtorture.so.* \
		usr/lib/samba/libdlz-bind9-for-torture-samba4.so \
		|| return 1
}

_ntdb_tools() {
	pkgdesc="Samba ntdb tools"
	depends=""
	cd "$pkgdir"
	_mv_files \
		usr/bin/ntdb* \
		|| return 1
}

libs() {
	pkgdesc="Samba core libraries"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/samba/libcli-spoolss-samba4.so \
		usr/lib/samba/libtrusts-util-samba4.so \
		usr/lib/libsamba-passdb.so.* \
		usr/lib/libsmbconf.so.* \
		usr/lib/samba/libCHARSET3-samba4.so \
		usr/lib/samba/libgse-samba4.so \
		usr/lib/samba/liblibcli-lsa3-samba4.so \
		usr/lib/samba/liblibcli-netlogon3-samba4.so \
		usr/lib/samba/liblibsmb-samba4.so \
		usr/lib/samba/libmsrpc3-samba4.so \
		usr/lib/samba/libpopt-samba3-samba4.so \
		usr/lib/samba/libsamba-cluster-support-samba4.so \
		usr/lib/samba/libsamba3-util-samba4.so \
		usr/lib/samba/libsecrets3-samba4.so \
		usr/lib/samba/libsmbd-shim-samba4.so \
		usr/lib/samba/libsmbregistry-samba4.so \
		usr/lib/samba/libutil-cmdline-samba4.so \
		usr/lib/samba/libutil-reg-samba4.so \
		usr/lib/libdcerpc-binding.so.* \
		usr/lib/libgensec.so.* \
		usr/lib/libndr-krb5pac.so.* \
		usr/lib/libndr-nbt.so.* \
		usr/lib/libndr-standard.so.* \
		usr/lib/libndr.so.* \
		usr/lib/libsamba-credentials.so.* \
		usr/lib/libsamba-hostconfig.so.* \
		usr/lib/libsamba-util.so.* \
		usr/lib/libsamdb.so.* \
		usr/lib/libtevent-util.so.* \
		usr/lib/samba/libaddns-samba4.so \
		usr/lib/samba/libasn1util-samba4.so \
		usr/lib/samba/libauth-sam-reply-samba4.so \
		usr/lib/samba/libauthkrb5-samba4.so \
		usr/lib/samba/libccan-samba4.so \
		usr/lib/samba/libcli-cldap-samba4.so \
		usr/lib/samba/libcli-ldap-common-samba4.so \
		usr/lib/samba/libcli-nbt-samba4.so \
		usr/lib/samba/libcli-smb-common-samba4.so \
		usr/lib/samba/libcliauth-samba4.so \
		usr/lib/samba/libdbwrap-samba4.so \
		usr/lib/samba/libdcerpc-samba-samba4.so \
		usr/lib/samba/liberrors-samba4.so \
		usr/lib/samba/libevents-samba4.so \
		usr/lib/samba/libflag-mapping-samba4.so \
		usr/lib/samba/libinterfaces-samba4.so \
		usr/lib/samba/libkrb5samba-samba4.so \
		usr/lib/samba/libldbsamba-samba4.so \
		usr/lib/samba/libndr-samba-samba4.so \
		usr/lib/samba/libntdb.so.* \
		usr/lib/samba/libreplace-samba4.so \
		usr/lib/samba/libsamba-debug-samba4.so \
		usr/lib/samba/libsamba-modules-samba4.so \
		usr/lib/samba/libsamba-security-samba4.so \
		usr/lib/samba/libsamba-sockets-samba4.so \
		usr/lib/samba/libsamdb-common-samba4.so \
		usr/lib/samba/libserver-role-samba4.so \
		usr/lib/samba/libsmb-transport-samba4.so \
		usr/lib/samba/libsocket-blocking-samba4.so \
		usr/lib/samba/libtdb-wrap-samba4.so \
		usr/lib/samba/libutil-ntdb-samba4.so \
		usr/lib/samba/libutil-setid-samba4.so \
		usr/lib/samba/libutil-tdb-samba4.so \
		\
		usr/lib/samba/libsmbpasswdparser-samba4.so \
		|| return 1
}

md5sums="614b4c7b9bbc70cff4cb56956f565741  samba-4.2.1.tar.gz
b8c06c1a37bce8a7feea3b6896483da0  fix-libreplace.patch
2386589c1e2cbcf95b644554b8a2f4d1  musl-fix-headers.patch
f9ee1f13e59c60ee7e481f51329bf7d4  uclibc-xattr-create.patch
395a84482d72136384050d0bc7f969b5  wrappers.patch
6eb6a33023e7a71a222886be3ee2453d  heimdal-1.5-api.patch
1af1a55aa4229da1a81d82c745e3373a  gnutls-3.4.0.patch
f0d10a87a2067d0d3accdcb6c9b64ea9  domain.patch
044c756d3c33c2d610c40bcd76cfb75c  samba.initd
c150433426e18261e6e3eed3930e1a76  samba.confd
b7cafabfb4fa5b3ab5f2e857d8d1c733  samba.logrotate"
sha256sums="37eaa239c116dc2c22c29c5a2931eb178ed22e48b594687247446703119b4ac3  samba-4.2.1.tar.gz
13617f691c648b44867c1a76d8be7c185021e8a8f3b695f8689a9f6244e65827  fix-libreplace.patch
0cf7e4eadf442422434d2b0fb43193f3a79f2887e32432f12cb6aed1941e807a  musl-fix-headers.patch
dcf6a7118297d6567d8ff31c9eff1afffdf2f548db36fd17d00cdf0ffc555fe3  uclibc-xattr-create.patch
6bbaeb3c68c64023039bb9a66fd82766ac6d77cf56ac8986eebd6f8a9fce512b  wrappers.patch
d4880c4ccceba5017d64cead644f8f363f22d6e91f2c2e1687dd7b45e6ca27e0  heimdal-1.5-api.patch
808da766baaca15622c14de4dc3639b78ecf2f3388b0c8cb8625afc3950a812e  gnutls-3.4.0.patch
5554fff0df5d31e67a705c60d97e187b4109c79c8a4063c8ea7ebe1e0e4a7e7e  domain.patch
86646cb845aababd9e8655994379526f03327a2cc33b489c3a7dea83ab689c8f  samba.initd
1d12f98a7727967b04eb123109b34cfffef320822dc0e8059286b6e3394c3fc0  samba.confd
4c2b7d529126b2fc4f62fb09d99e49a87632d723a2d9d289a61e37dd84145be1  samba.logrotate"
sha512sums="7a35a3f4cf52520c3d38f086055a787c135d94fb8e8072169eb8a8ad0521c7c7a1cc49e3e3e73ad33e0849e953aaf484afcd8d28a905be798f5f4e08432d5d51  samba-4.2.1.tar.gz
4adbbeb75de6c55199e10f284e741ee252f403b7809251caf4baf378669770be01d469b23e12f8119ed5dca5080dd45bda1b5b78cc7a791be44c1eb6fb8c0fa2  fix-libreplace.patch
8d2e1be5f020d0558917f328770b289d0a41836616952d0d3208cecd457df3649f1357a2d35dc54123559ab6a1b720f3189286c65cee90b02ccbae7d676ae383  musl-fix-headers.patch
b43809d7ecbf3968f5154c2ded6ed47dae36921f1895ea98bcce50557eb2ad39b736345ffb4214655ed3154c143c20431d248cde828285380bafbf4d2627df9b  uclibc-xattr-create.patch
1e22dfb4e5db22af27f683d9fdd040a9f568b198b55095dd2dfdec81d9eb8e23d965c92663855ff02ba32cc62b97ca6fbe2cc79dd843e223b4be74bfb3cce71f  wrappers.patch
86181f661bca29d698be3a402a915e35ba4289fd3c34e6e2f4f151125b5f169e729189b48d84472d64857cbcf580ad767077bc791e3b6a1b1c313dc96b3e00ae  heimdal-1.5-api.patch
a52b636f35893b42f4731cb2f7966a6c4ed397632d931b717c6fb4412fc6528837f5c69d6a7fa1374aaa92e278ebe4b50cc9ceab4fe98882e010f21b6f3901db  gnutls-3.4.0.patch
62d373dbaee75121a1d73f2c09cdca7239705808ff807b171d1d5a28fd4ffc66bdb52494b62786d7aaba8aeece5c08433b532ca96a28d712452fe9daac8d8d2e  domain.patch
59d05252b8ebbe6ba6a419edc86b66b9541d0bac9dbe810cccb20e64f6044e2900cc6c0979e077741ed00fbbf2d51f9184c83715013299782707b44e39aa99b1  samba.initd
4faf581ecef3ec38319e3c4ab6d3995c51fd7ba83180dc5553a2ff4dfb92efadb43030c543292130c4ed0c281dc0972c6973d52d48062c5edb39bb1c4bbb6dd6  samba.confd
f88ebe59ca3a9e9b77dd5993c13ef3e73a838efb8ed858088b464a330132d662f33e25c27819e38835389dee23057a3951de11bae1eef55db8ff5e1ec6760053  samba.logrotate"