aboutsummaryrefslogtreecommitdiffstats
path: root/main/samba/APKBUILD
blob: 1e740cb506060987965c222cb7e51e92235c2c88 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=samba
pkgver=3.3.7
pkgrel=0
pkgdesc="Tools to access a server's filespace and printers via SMB"
url="http://www.samba.org"
license="GPL3"
subpackages="$pkgname-dev $pkgname-doc winbind $pkgname-common 
	$pkgname-initscript tdb"
depends="samba-initscript"
makedepends="db-dev popt-dev ncurses-dev openldap-dev heimdal-dev"
source="http://us1.$pkgname.org/$pkgname/ftp/stable/$pkgname-$pkgver.tar.gz
	samba.initd
	samba.confd
	samba.logrotate
	"

build() { 
	cd "$srcdir"/$pkgname-$pkgver/source
	./configure --prefix=/usr \
		--sysconfdir=/etc/samba \
		--with-configdir=/etc/samba \
		--localstatedir=/var \
		--with-fhs \
		--with-lockdir=/var/cache/samba \
		--with-piddir=/var/run/samba \
		--with-logfilebase=/var/log/samba \
		--without-pam \
		--with-ads \
		--with-krb5 \
		--with-libsmbclient \
		--with-shared-modules=idmap_rid,imap_ad \
		--disable-nss-wrapper \
		--disable-dnssd \
		--disable-swat
	make everything || return 1
	make DESTDIR="$pkgdir" install

	install -d "$pkgdir"/var/log/samba \
		"$pkgdir"/usr/share/doc/samba
	cd "$srcdir"/$pkgname-$pkgver
	cp -r examples "$pkgdir"/usr/share/doc/samba/
	install -D packaging/RHEL/setup/smbusers "$pkgdir"/etc/samba/smbusers
	install -Dm644 ../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
}

winbind() {
	pkgdesc="Samba user and group resolver"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/bin/wbinfo \
		usr/bin/ntlm_auth \
		usr/sbin/winbindd \
		usr/lib/samba/idmap \
		usr/lib/libwbclient* 
}

common() {
	pkgdesc="Samba common files for both client an servers"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/bin/net \
		usr/bin/nmblookup \
		usr/bin/smbpasswd \
		usr/bin/testparm \
		usr/lib/samba/*.dat \
		usr/lib/libtalloc* \
		var/run/samba \
		var/cache/samba \
		var/log/samba
}

tdb() {
	pkgdesc="Trivial database"
	depends=
	cd "$pkgdir"
	_mv_files \
		usr/lib/libtdb* \
		usr/bin/tdb*
}

md5sums="bc7228cc686986353df67ff42b1b2b1e  samba-3.3.7.tar.gz
1b701fdb22c52c63b3af0e4a286a9329  samba.initd
c150433426e18261e6e3eed3930e1a76  samba.confd
b7cafabfb4fa5b3ab5f2e857d8d1c733  samba.logrotate"