diff options
author | Taner Tas <taner76@gmail.com> | 2018-08-23 02:32:02 +0300 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-08-28 12:38:27 +0000 |
commit | 856205e3df24830397d289fd0ac8c769f8e199a4 (patch) | |
tree | 3f405271e9e9cced0f591bcc28ea5857ca94ec75 | |
parent | e8189cc676563b320c477490959e009917c1d9de (diff) | |
download | aports-856205e3df24830397d289fd0ac8c769f8e199a4.tar.bz2 aports-856205e3df24830397d289fd0ac8c769f8e199a4.tar.xz |
main/samba: Various improvements
* Improve initscript
* Fix start service as DC
* Add bind-9.12 support for DC DNS backend
* Enable pam_winbind module and add corresponding subpackage
* uclibc-xattr-create.patch removed
-rw-r--r-- | main/samba/APKBUILD | 25 | ||||
-rw-r--r-- | main/samba/bind-9.12.patch | 23 | ||||
-rw-r--r-- | main/samba/samba.confd | 2 | ||||
-rw-r--r-- | main/samba/samba.initd | 23 | ||||
-rw-r--r-- | main/samba/uclibc-xattr-create.patch | 15 |
5 files changed, 62 insertions, 26 deletions
diff --git a/main/samba/APKBUILD b/main/samba/APKBUILD index bac30fa6b9..f3a87cc2c8 100644 --- a/main/samba/APKBUILD +++ b/main/samba/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=samba pkgver=4.8.4 -pkgrel=0 +pkgrel=1 pkgdesc="Tools to access a server's filespace and printers via SMB" url="http://www.samba.org" arch="all" @@ -21,6 +21,7 @@ subpackages="$pkgname-dev $pkgname-doc $pkgname-winbind-clients:_winbind_clients $pkgname-winbind-krb5-locator:_winbind_krb5_locator $pkgname-libnss-winbind:_libnss_winbind + pam-winbind:_pam_winbind $pkgname-heimdal-libs:_heimdal_libs $pkgname-dc @@ -42,14 +43,14 @@ depends="$pkgname-server=$pkgver-r$pkgrel makedepends="popt-dev ncurses-dev openldap-dev e2fsprogs-dev talloc-dev tdb-dev py2-tdb ldb-dev>=1.2.2 cups-dev python2-dev libcap-dev tevent-dev py2-tevent iniparser-dev perl subunit-dev docbook-xsl - libarchive-dev acl-dev fuse-dev libtirpc-dev rpcgen" + libarchive-dev acl-dev fuse-dev libtirpc-dev rpcgen linux-pam-dev" source="https://us1.samba.org/samba/ftp/stable/$pkgname-$pkgver.tar.gz - uclibc-xattr-create.patch domain.patch getpwent_r.patch musl_uintptr.patch netdb-defines.patch netapp.patch + bind-9.12.patch $pkgname.initd $pkgname.confd @@ -103,7 +104,7 @@ build() { --with-lockdir=/var/cache/$pkgname \ --with-piddir=/run/$pkgname \ --with-logfilebase=/var/log/$pkgname \ - --without-pam \ + --with-pam \ --without-systemd \ --with-ads \ --with-shared-modules=$_idmap_modules,$_pdb_modules,$_auth_modules \ @@ -336,12 +337,20 @@ _winbind_krb5_locator() { usr/lib/winbind_krb5_locator.so } +_pam_winbind() { + pkgdesc="PAM module for winbind" + depends= + cd "$pkgdir" + _mv_files \ + usr/lib/security +} + dc() { pkgdesc="Samba AD Domain Controller" depends="$pkgname-common=$pkgver-r$pkgrel $pkgname-server=$pkgver-r$pkgrel $pkgname-winbind=$pkgver-r$pkgrel - py-$pkgname=$pkgver-r$pkgrel" + py-$pkgname=$pkgver-r$pkgrel tdb" cd "$pkgdir" _mv_files \ usr/bin/samba-tool \ @@ -516,12 +525,12 @@ libs() { } sha512sums="a3ad651717df5a441064693412965a66bb3d7927baa4ca5625b0948d7253af74eaf05c7e75e6c07853186513df38a925019616cd6439a96e9828b04cd8c5350d samba-4.8.4.tar.gz -b43809d7ecbf3968f5154c2ded6ed47dae36921f1895ea98bcce50557eb2ad39b736345ffb4214655ed3154c143c20431d248cde828285380bafbf4d2627df9b uclibc-xattr-create.patch 62d373dbaee75121a1d73f2c09cdca7239705808ff807b171d1d5a28fd4ffc66bdb52494b62786d7aaba8aeece5c08433b532ca96a28d712452fe9daac8d8d2e domain.patch 0d4fd9862191554dc9c724cec0b94fd19afbfd0c4ed619e4c620c075e849cb3f3d44db1e5f119d890da23a3dd0068d9873703f3d86c47b91310521f37356208b getpwent_r.patch a99e771f28d787dc22e832b97aa48a1c5e13ddc0c030c501a3c12819ff6e62800ef084b62930abe88c6767d785d5c37e2e9f18a4f9a24f2ee1f5d9650320c556 musl_uintptr.patch 1854577d0e4457e27da367a6c7ec0fb5cfd63cefea0a39181c9d6e78cf8d3eb50878cdddeea3daeec955d00263151c2f86ea754ff4276ef98bc52c0276d9ffe8 netdb-defines.patch 202667cb0383414d9289cd67574f5e1140c9a0ff63bb82a746a59b2397a00db15654bfb30cb5ec1cd68a097899be0f849d9aab4c0d210152386c9e66c640f0c0 netapp.patch -8ffd93a2f8f1461d3eabf3cbc67f04f13d18d02b969e110b1cf5f23845264d774a7a79658cdf389bc594780c633266ff29aacc81dae627dcb3efe63364b027bd samba.initd -4faf581ecef3ec38319e3c4ab6d3995c51fd7ba83180dc5553a2ff4dfb92efadb43030c543292130c4ed0c281dc0972c6973d52d48062c5edb39bb1c4bbb6dd6 samba.confd +27f12c8395be25d9806d232cc30334f2f7c7d175971d2d1944dd886d699e0381a6f222c17e3d7bc087cf7a29bfb3e98cf25ba98f414c4afe0297b9d134a28bd8 bind-9.12.patch +6e599cfbf1248a5e9949129aff5aab0140a3bbe615e0da8c42ac44174881fb5776c4ba77c74b8cd1e6f8c471e3c3189187ea34e0728888e0d279b1d2922bece0 samba.initd +9cf71d667509d94ea8d5c3329178f51d0c9aa1191ad0b940eddf5e9e77464fea137f15afbf82618976ffd8b1f5561944ade3223d157bc86c8f50e3708dcf5704 samba.confd 3458a4e1f8a8b44c966afb339b2dca51615be049f594c14911fc4d8203623deee416b6fe881436e246fc7d49c97a2b3bf9c5f33ba774302b24190a1103d6b67d samba.logrotate" diff --git a/main/samba/bind-9.12.patch b/main/samba/bind-9.12.patch new file mode 100644 index 0000000000..1a82231a06 --- /dev/null +++ b/main/samba/bind-9.12.patch @@ -0,0 +1,23 @@ +--- a/python/samba/provision/sambadns.py ++++ b/python/samba/provision/sambadns.py +@@ -943,7 +943,8 @@ + bind9_9 = '' + elif bind_info.upper().find('BIND 9.10') != -1: + bind9_10 = '' +- elif bind_info.upper().find('BIND 9.11') != -1: ++ elif bind_info.upper().find('BIND 9.11') != -1 \ ++ or bind_info.upper().find('BIND 9.12') != -1: + bind9_11 = '' + elif bind_info.upper().find('BIND 9.7') != -1: + raise ProvisioningError("DLZ option incompatible with BIND 9.7.") +--- a/source4/setup/named.conf.dlz ++++ b/source4/setup/named.conf.dlz +@@ -19,7 +19,7 @@ + # For BIND 9.10.x + ${BIND9_10} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_10.so"; + +- # For BIND 9.11.x ++ # For BIND 9.11.x, 9.12.x + ${BIND9_11} database "dlopen ${MODULESDIR}/bind9/dlz_bind9_11.so"; + }; + diff --git a/main/samba/samba.confd b/main/samba/samba.confd index 3788c3c173..c30cb0a2cc 100644 --- a/main/samba/samba.confd +++ b/main/samba/samba.confd @@ -1,6 +1,8 @@ # add "winbindd" to daemon_list if you want start winbind from here as well +# leave empty or unset for role based samba services (eg: dc) daemon_list="smbd nmbd" smbd_options="-D" nmbd_options="-D" #winbindd_options="" +#samba_options="" diff --git a/main/samba/samba.initd b/main/samba/samba.initd index 311d5f6bf4..baf920ac09 100644 --- a/main/samba/samba.initd +++ b/main/samba/samba.initd @@ -1,10 +1,14 @@ #!/sbin/openrc-run extra_started_commands="reload" +piddir=${piddir:-"/run/samba"} +daemon_list="${daemon_list//samba/}" DAEMON=${SVCNAME#samba.} if [ "$DAEMON" != "samba" ]; then daemon_list=$DAEMON +elif [ "${daemon_list// /}" == "" ] || [ -z '$daemon_list' ]; then + daemon_list="samba" fi depend() { @@ -12,13 +16,26 @@ depend() { after firewall } +start_pre() { + [ -d "$piddir" ] || mkdir -p "$piddir" +} + +start_samba() { + start-stop-daemon --start --quiet --exec /usr/sbin/samba -- \ + ${samba_options:-"-D"} +} + +stop_samba() { + start-stop-daemon --stop --quiet --pidfile "$piddir"/samba.pid +} + start_smbd() { start-stop-daemon --start --quiet --exec /usr/sbin/smbd -- \ ${smbd_options:-"-D"} } stop_smbd() { - start-stop-daemon --stop --quiet --pidfile /run/samba/smbd.pid + start-stop-daemon --stop --quiet --pidfile "$piddir"/smbd.pid } start_nmbd() { @@ -27,7 +44,7 @@ start_nmbd() { } stop_nmbd() { - start-stop-daemon --stop --quiet --pidfile /run/samba/nmbd.pid + start-stop-daemon --stop --quiet --pidfile "$piddir"/nmbd.pid } start_winbindd() { @@ -36,7 +53,7 @@ start_winbindd() { } stop_winbindd() { - start-stop-daemon --stop --quiet --pidfile /run/samba/winbindd.pid + start-stop-daemon --stop --quiet --pidfile "$piddir"/winbindd.pid } start() { diff --git a/main/samba/uclibc-xattr-create.patch b/main/samba/uclibc-xattr-create.patch deleted file mode 100644 index d4de15d2f2..0000000000 --- a/main/samba/uclibc-xattr-create.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- ./lib/replace/system/filesys.h.orig -+++ ./lib/replace/system/filesys.h -@@ -122,6 +122,12 @@ - #if HAVE_ATTR_XATTR_H - #include <attr/xattr.h> - #elif HAVE_SYS_XATTR_H -+#ifdef XATTR_CREATE -+#undef XATTR_CREATE -+#endif -+#ifdef XATTR_REPLACE -+#undef XATTR_REPLACE -+#endif - #include <sys/xattr.h> - #endif - |