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
|
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=samba
pkgver=4.1.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
libsmbclient $pkgname-client
$pkgname-dc $pkgname-dc-libs:_dc_libs
$pkgname-winbind libwbclient $pkgname-winbind-clients:_winbind_clients
$pkgname-winbind-krb5-locator:_winbind_krb5_locator
$pkgname-pidl py-$pkgname:_py $pkgname-test:_test
$pkgname-libs-py:_libs_py $pkgname-libs"
depends="$pkgname-initscript $pkgname-client"
# note that heimdal is required (over mit krb5) for AD DC functionality
makedepends="popt-dev ncurses-dev openldap-dev heimdal-dev e2fsprogs-dev
libiconv-dev talloc-dev tdb-dev ldb-dev cups-dev python-dev libcap-dev
tevent-dev iniparser-dev perl subunit-dev"
source="http://us1.samba.org/samba/ftp/stable/samba-$pkgver.tar.gz
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
}
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 \
--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 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=
# we have moved libnetapi to samba-common
replaces="winbind samba"
cd "$pkgdir"
_mv_files \
usr/bin/net \
usr/bin/pdbedit \
usr/bin/profiles \
usr/bin/smbcontrol \
usr/bin/testparm \
usr/share/samba/codepages \
usr/lib/libnetapi.so.* \
var/run/samba \
var/cache/samba \
var/log/samba \
|| return 1
install -d -m 700 "$subpkgdir"/var/lib/samba/private
}
# common-libs is an attempt to avoid libpython dependency for libsmbclient
_libs_py() {
pkgdesc="Libraries that require libpython"
replaces="samba-libs"
depends=
cd "$pkgdir"
_mv_files \
usr/lib/samba/libsamba-net.so \
usr/lib/samba/libsamba_python.so \
|| return 1
return 0
}
libsmbclient() {
pkgdesc="The SMB client library"
replaces="samba"
depends=
cd "$pkgdir"
_mv_files \
usr/lib/libsmbclient.so.* \
usr/lib/libsmbsharemodes.so.* \
|| return 1
}
client() {
pkgdesc="Samba client program"
replaces="samba"
depends=
cd "$pkgdir"
_mv_files \
usr/bin/cifsdd \
usr/bin/dbwrap_tool \
usr/bin/nmblookup \
usr/bin/nmblookup4 \
usr/bin/oLschema2ldif \
usr/bin/regdiff \
usr/bin/regpatch \
usr/bin/regshell \
usr/bin/regtree \
usr/bin/rpcclient \
usr/bin/sharesec \
usr/bin/smbcacls \
usr/bin/smbclient \
usr/bin/smbclient4 \
usr/bin/smbcquotas \
usr/bin/smbget \
usr/bin/smbpasswd \
usr/bin/smbprint \
usr/bin/smbspool \
usr/bin/smbta-util \
usr/bin/smbtar \
usr/bin/smbtree \
|| return 1
}
dc() {
pkgdesc="Samba AD Domain Controller"
depends=
cd "$pkgdir"
_mv_files \
usr/bin/samba-tool \
usr/sbin/samba* \
usr/lib/samba/ldb \
usr/lib/samba/libpac.so \
usr/lib/samba/gensec \
usr/lib/samba/bind9/dlz_bind9.so \
usr/lib/mit_samba.so \
|| return 1
install -d -m 0755 "$subpkgdir"/var/lib/samba/sysvol || return 1
}
_dc_libs() {
pkgdesc="Samba AD Domain Controller libraries"
depends=
cd "$pkgdir"
_mv_files \
usr/lib/samba/bind9/dlz_bind9_9.so \
usr/lib/samba/libprocess_model.so \
usr/lib/samba/libservice.so \
usr/lib/samba/service \
usr/lib/samba/libdsdb-module.so \
usr/lib/samba/libntvfs.so \
usr/lib/samba/libposix_eadb.so \
usr/lib/libdcerpc-server.so.* \
|| return 1
}
winbind() {
pkgdesc="Samba user and group resolver"
depends=
install="winbind.pre-install winbind.pre-upgrade winbind.post-install
winbind.post-upgrade"
replaces="winbind"
cd "$pkgdir"
_mv_files \
usr/sbin/winbindd \
usr/lib/samba/idmap \
usr/lib/samba/nss_info \
usr/lib/samba/libidmap.so \
|| return 1
install -d -g winbind -m 750 \
"$subpkgdir"/var/cache/samba/winbindd_privileged
}
libwbclient() {
pkgdesc="Samba winbind client libraries"
depends=
# we have moved libwbclient from samba-common
replaces="samba-common winbind"
cd "$pkgdir"
_mv_files \
usr/lib/libwbclient.so.* \
usr/lib/samba/libwinbind-client.so \
|| return 1
}
_winbind_clients() {
pkgdesc="Samba winbind clients"
replaces="winbind"
depends=
cd "$pkgdir"
_mv_files \
usr/bin/ntlm_auth \
usr/bin/wbinfo \
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
}
pidl() {
pkgdesc="Perl IDL compiler"
depends=
mkdir -p "$subpkgdir"/usr/share
mv "$pkgdir"/usr/share/perl* "$subpkgdir"/usr/share/
}
_py() {
pkgdesc="Samba python libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}
_test() {
pkgdesc="Samba server and client testing tools"
depends=
mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib/samba
mv "$pkgdir"/usr/bin/*test \
"$pkgdir"/usr/bin/ndrdump \
"$pkgdir"/usr/bin/smbtorture \
"$subpkgdir"/usr/bin/ || return 1
mv "$pkgdir"/usr/lib/libtorture.so.* \
"$subpkgdir"/usr/lib/ || return 1
mv "$pkgdir"/usr/lib/samba/*torture* \
"$subpkgdir"/usr/lib/samba/ || return 1
}
libs() {
pkgdesc="Samba libraries"
depends=
cd "$pkgdir"
_mv_files \
usr/lib/lib*.so.* \
usr/lib/samba/lib* \
|| return 1
}
md5sums="f63feeae652afc3a0fefdd38176957fb samba-4.1.1.tar.gz
044c756d3c33c2d610c40bcd76cfb75c samba.initd
c150433426e18261e6e3eed3930e1a76 samba.confd
b7cafabfb4fa5b3ab5f2e857d8d1c733 samba.logrotate"
sha256sums="c70c343f5bcd2bfe3f4b55860e680a6ed70ce30106c8aa16ef89f8a1a85e2628 samba-4.1.1.tar.gz
86646cb845aababd9e8655994379526f03327a2cc33b489c3a7dea83ab689c8f samba.initd
1d12f98a7727967b04eb123109b34cfffef320822dc0e8059286b6e3394c3fc0 samba.confd
4c2b7d529126b2fc4f62fb09d99e49a87632d723a2d9d289a61e37dd84145be1 samba.logrotate"
sha512sums="4108f0f72df591afde9549bc86c2b8a3552e6db51d65b84cad960682a412e0f7c5ccb5202d2d8256937ecbdbf47762f1837b5449d3f1157445f485e5de2cd7f9 samba-4.1.1.tar.gz
59d05252b8ebbe6ba6a419edc86b66b9541d0bac9dbe810cccb20e64f6044e2900cc6c0979e077741ed00fbbf2d51f9184c83715013299782707b44e39aa99b1 samba.initd
4faf581ecef3ec38319e3c4ab6d3995c51fd7ba83180dc5553a2ff4dfb92efadb43030c543292130c4ed0c281dc0972c6973d52d48062c5edb39bb1c4bbb6dd6 samba.confd
f88ebe59ca3a9e9b77dd5993c13ef3e73a838efb8ed858088b464a330132d662f33e25c27819e38835389dee23057a3951de11bae1eef55db8ff5e1ec6760053 samba.logrotate"
|