summaryrefslogtreecommitdiffstats
path: root/main/samba
diff options
context:
space:
mode:
Diffstat (limited to 'main/samba')
-rw-r--r--main/samba/APKBUILD99
-rw-r--r--main/samba/samba.confd6
-rw-r--r--main/samba/samba.initd64
3 files changed, 169 insertions, 0 deletions
diff --git a/main/samba/APKBUILD b/main/samba/APKBUILD
new file mode 100644
index 000000000..c28a6e2de
--- /dev/null
+++ b/main/samba/APKBUILD
@@ -0,0 +1,99 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=samba
+pkgver=3.3.6
+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
+ "
+
+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
+}
+
+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="858cb6c640358be0e81297c5de615a3c samba-3.3.6.tar.gz
+1b701fdb22c52c63b3af0e4a286a9329 samba.initd
+c150433426e18261e6e3eed3930e1a76 samba.confd"
diff --git a/main/samba/samba.confd b/main/samba/samba.confd
new file mode 100644
index 000000000..3788c3c17
--- /dev/null
+++ b/main/samba/samba.confd
@@ -0,0 +1,6 @@
+# add "winbindd" to daemon_list if you want start winbind from here as well
+daemon_list="smbd nmbd"
+
+smbd_options="-D"
+nmbd_options="-D"
+#winbindd_options=""
diff --git a/main/samba/samba.initd b/main/samba/samba.initd
new file mode 100644
index 000000000..d2d395a98
--- /dev/null
+++ b/main/samba/samba.initd
@@ -0,0 +1,64 @@
+#!/sbin/runscript
+
+opts="reload"
+
+DAEMON=${SVCNAME#samba.}
+if [ "$DAEMON" != "samba" ]; then
+ daemon_list=$DAEMON
+fi
+
+depend() {
+ need net
+}
+
+start_smbd() {
+ start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- \
+ ${smbd_options:-"-D"}
+}
+
+stop_smbd() {
+ start-stop-daemon --stop --quiet --pidfile /var/run/samba/smbd.pid
+}
+
+start_nmbd() {
+ start-stop-daemon --start --quiet --exec /usr/sbin/nmbd -- \
+ ${nmbd_options:-"-D"}
+}
+
+stop_nmbd() {
+ start-stop-daemon --stop --quiet --pidfile /var/run/samba/nmbd.pid
+}
+
+start_winbindd() {
+ start-stop-daemon --start --quiet --exec /usr/sbin/winbindd -- \
+ $winbindd_options
+}
+
+stop_winbindd() {
+ start-stop-daemon --stop --quiet --pidfile /var/run/samba/winbindd.pid
+}
+
+start() {
+ for i in $daemon_list; do
+ ebegin "Starting $i"
+ start_$i
+ eend $?
+ done
+}
+
+stop() {
+ for i in $daemon_list; do
+ ebegin "Stopping $i"
+ stop_$i
+ eend $?
+ done
+}
+
+reload() {
+ for i in $daemon_list; do
+ ebegin "Reloading $i"
+ killall -HUP $i
+ eend $?
+ done
+}
+