232 lines
9.6 KiB
Bash
232 lines
9.6 KiB
Bash
# Maintainer: Jesus E. <heckyel@riseup.net>
|
|
|
|
pkgbase=samba
|
|
pkgname=('libwbclient' 'smbclient' 'samba')
|
|
pkgver=4.13.13
|
|
_debver=$pkgver
|
|
_debrel=1
|
|
pkgrel=2
|
|
arch=(i686 x86_64)
|
|
url='https://www.samba.org'
|
|
license=('GPL-3')
|
|
makedepends=('python' 'docbook-xsl' 'pkg-config' 'libbsd' 'db' 'popt' 'libcups'
|
|
'readline' 'tevent' 'acl' 'libldap' 'libcap' 'ldb' 'krb5' 'gnutls'
|
|
'talloc' 'tdb' 'libaio' 'perl-parse-yapp' 'libnsl' 'libtirpc'
|
|
'rpcsvc-proto' 'jansson' 'waf' 'quilt')
|
|
source=(https://us1.samba.org/samba/ftp/stable/${pkgbase}-${pkgver}.tar.gz
|
|
https://us1.samba.org/samba/ftp/stable/${pkgbase}-${pkgver}.tar.asc
|
|
https://deb.debian.org/debian/pool/main/s/samba/samba_${_debver}+dfsg-${_debrel}~deb11u6.debian.tar.xz
|
|
samba.logrotate
|
|
samba.conf.d
|
|
smb.confd
|
|
smb.initd
|
|
smbd.run
|
|
nmbd.run)
|
|
sha512sums=('a3368f896b9e277994129a8ab7959df945f201a742b7cd852ab733160a38032556894a9b80a4a98095b86ca9f3710564a3fd6281af75cca05a019ae6935f6fd8'
|
|
'SKIP'
|
|
'd961f42943272b4543e5fdb8e3a3a1ce6f2ef540c82acfbeb71f593cd76ecac97626d599d09f32d7be4a48d5eab9fda8ed46ee73e2b2c7bd08a0ce31cb41c6f1'
|
|
'4b6f1dc466e67a1acb13798e885f89214054ed5ab351b9c36fa52877479aa549601898b41680a4793543fc794c28029deba304306cc5ebc5dfb490e94acb3791'
|
|
'4a58e5e73ea99c6cfab58a4c09c68f649c0a1fd0caf97e0aee6819a3749bdf33c4ece4cde13c5119194f05b6918967d2c99818a835b1fd0180518d6761b477cf'
|
|
'cef779ad494fc3ad67c7fafbcb16c7e489706e28f827f78e472f44954340904c6c5eb96ba03c29c474cb85498ff2617f8dee19027aba88e21c1e04c46fa55680'
|
|
'bf1df9608bb00ef4c8304330529072ec78403a1398d98d52004428b8f32637d478fef104e0bc5af4e655f099d457d685cb77f53c0097e9c683abb0eaa579292d'
|
|
'65787161c89e543b63dad6d2f1510d2ff94c01106536834bae5db3ba1f48698901275e509db7f2134c71f3dffe11c2832e3293ae25a36dff1ca9df988a20a746'
|
|
'57103e41c644becd6fe1ea8de539b1645b140fca7eee6951ee30f468f01b337678855aad7acdaaad46c61b0a3fe3cdad64f570370eaaa88386b9d6d74d8326ce')
|
|
validpgpkeys=('81F5E2832BD2545A1897B713AA99442FB680B620') #Samba Distribution Verification Key <samba-bugs@samba.org>
|
|
|
|
prepare() {
|
|
cd samba-${pkgver}
|
|
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
|
# Debian patches
|
|
export QUILT_PATCHES=debian/patches
|
|
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
|
export QUILT_DIFF_ARGS='--no-timestamps'
|
|
|
|
mv "$srcdir"/debian .
|
|
|
|
# Doesn't apply
|
|
rm -v debian/patches/README_nosmbldap-tools.patch || true
|
|
rm -v debian/patches/VERSION.patch || true
|
|
rm -v debian/patches/add-so-version-to-private-libraries || true
|
|
rm -v debian/patches/smbd.service-Run-update-apparmor-samba-profile-befor.patch || true
|
|
|
|
quilt push -av
|
|
fi
|
|
}
|
|
|
|
build() {
|
|
# Use samba-pkg as a staging directory for the split packages
|
|
# (This is so RPATHS and symlinks are generated correctly via
|
|
# make install, but the otherwise unsplit pieces can be split)
|
|
_pkgsrc=${srcdir}/samba-pkg
|
|
rm -rf ${_pkgsrc}
|
|
cd ${srcdir}/samba-${pkgver}
|
|
_samba4_idmap_modules=idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2
|
|
_samba4_pdb_modules=pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4
|
|
_samba4_auth_modules=auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4
|
|
_samba4_removed_modules=!vfs_snapper
|
|
cd ${srcdir}/samba-${pkgver}
|
|
./configure --enable-fhs \
|
|
--prefix=/usr \
|
|
--libdir=/usr/lib \
|
|
--localstatedir=/var \
|
|
--with-configdir=/etc/samba \
|
|
--with-lockdir=/var/cache/samba \
|
|
--with-sockets-dir=/var/run/samba \
|
|
--with-piddir=/var/run \
|
|
--with-ads \
|
|
--with-ldap \
|
|
--with-winbind \
|
|
--with-acl-support \
|
|
--without-pam \
|
|
--bundled-libraries=!tdb,!talloc,!pytalloc-util,!tevent,!popt,!ldb,!pyldb-util \
|
|
--with-shared-modules=${_samba4_idmap_modules},${_samba4_pdb_modules},${_samba4_auth_modules},${_samba4_removed_modules} \
|
|
--disable-rpath-install
|
|
|
|
make
|
|
make DESTDIR="${_pkgsrc}/" install
|
|
|
|
# This gets skipped somehow
|
|
if [ ! -e ${_pkgsrc}/usr/bin/smbtar ]; then
|
|
install -m755 ${srcdir}/samba-${pkgver}/source3/script/smbtar ${_pkgsrc}/usr/bin/
|
|
fi
|
|
}
|
|
|
|
package_libwbclient() {
|
|
pkgdesc="Samba winbind client library"
|
|
depends=('glibc' 'libbsd')
|
|
# Use samba-pkg as a staging directory for the split packages
|
|
# (This is so RPATHS and symlinks are generated correctly via
|
|
# make install, but the otherwise unsplit pieces can be split)
|
|
_pkgsrc=${srcdir}/samba-pkg
|
|
install -d -m755 ${pkgdir}/usr/lib
|
|
mv ${_pkgsrc}/usr/lib/libwbclient*.so* ${pkgdir}/usr/lib/
|
|
|
|
install -d -m755 ${pkgdir}/usr/lib/samba
|
|
mv ${_pkgsrc}/usr/lib/samba/libwinbind-client*.so* ${pkgdir}/usr/lib/samba/
|
|
mv ${_pkgsrc}/usr/lib/samba/libreplace-samba4.so* ${pkgdir}/usr/lib/samba/
|
|
|
|
install -d -m755 ${pkgdir}/usr/lib/pkgconfig
|
|
mv ${_pkgsrc}/usr/lib/pkgconfig/wbclient.pc ${pkgdir}/usr/lib/pkgconfig/
|
|
|
|
install -d -m755 ${pkgdir}/usr/include/samba-4.0
|
|
mv ${_pkgsrc}/usr/include/samba-4.0/wbclient.h ${pkgdir}/usr/include/samba-4.0/
|
|
|
|
install -Dm644 samba-${pkgver}/COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
|
|
}
|
|
|
|
package_smbclient() {
|
|
pkgdesc="Tools to access a server's filespace and printers via SMB"
|
|
depends=('popt' 'cifs-utils' 'tdb' "libwbclient>=$pkgver" 'ldb'
|
|
'tevent' 'libgcrypt' 'python' 'talloc' 'readline' 'gnutls'
|
|
'libbsd' 'libldap' 'libcups' 'libnsl' 'jansson')
|
|
_smbclient_bins=('smbclient' 'rpcclient' 'smbspool'
|
|
'smbtree' 'smbcacls' 'smbcquotas' 'smbget' 'net'
|
|
'nmblookup' 'smbtar')
|
|
# Use samba-pkg as a staging directory for the split packages
|
|
# (This is so RPATHS and symlinks are generated correctly via
|
|
# make install, but the otherwise unsplit pieces can be split)
|
|
_pkgsrc=${srcdir}/samba-pkg
|
|
install -d -m755 ${pkgdir}/usr/bin
|
|
for bin in ${_smbclient_bins[@]}; do
|
|
mv ${_pkgsrc}/usr/bin/${bin} ${pkgdir}/usr/bin/
|
|
done
|
|
|
|
# smbclient binaries link to the majority of the samba
|
|
# libs, so this is a shortcut instead of resolving the
|
|
# whole dependency tree by hand
|
|
install -d -m755 ${pkgdir}/usr/lib
|
|
for lib in ${_pkgsrc}/usr/lib/lib*.so*; do
|
|
mv ${lib} ${pkgdir}/usr/lib/
|
|
done
|
|
|
|
install -d -m755 ${pkgdir}/usr/lib/samba
|
|
for lib in ${_pkgsrc}/usr/lib/samba/lib*.so*; do
|
|
mv ${lib} ${pkgdir}/usr/lib/samba/
|
|
done
|
|
|
|
install -d -m755 ${pkgdir}/usr/lib/pkgconfig
|
|
mv ${_pkgsrc}/usr/lib/pkgconfig/smbclient.pc ${pkgdir}/usr/lib/pkgconfig/
|
|
mv ${_pkgsrc}/usr/lib/pkgconfig/netapi.pc ${pkgdir}/usr/lib/pkgconfig/
|
|
|
|
mv ${_pkgsrc}/usr/libexec ${pkgdir}/usr
|
|
|
|
install -d -m755 ${pkgdir}/usr/share/man/man1
|
|
install -d -m755 ${pkgdir}/usr/share/man/man7
|
|
install -d -m755 ${pkgdir}/usr/share/man/man8
|
|
for bin in ${_smbclient_bins[@]}; do
|
|
if [ -e ${_pkgsrc}/usr/share/man/man1/${bin}.1 ]; then
|
|
mv ${_pkgsrc}/usr/share/man/man1/${bin}.1 ${pkgdir}/usr/share/man/man1/
|
|
fi
|
|
if [ -e ${_pkgsrc}/usr/share/man/man8/${bin}.8 ]; then
|
|
mv ${_pkgsrc}/usr/share/man/man8/${bin}.8 ${pkgdir}/usr/share/man/man8/
|
|
fi
|
|
done
|
|
mv ${_pkgsrc}/usr/share/man/man7/libsmbclient.7 ${pkgdir}/usr/share/man/man7/
|
|
|
|
install -d -m755 ${pkgdir}/usr/include/samba-4.0
|
|
mv ${_pkgsrc}/usr/include/samba-4.0/libsmbclient.h ${pkgdir}/usr/include/samba-4.0/
|
|
mv ${_pkgsrc}/usr/include/samba-4.0/netapi.h ${pkgdir}/usr/include/samba-4.0/
|
|
|
|
mkdir -p ${pkgdir}/usr/libexec/cups/backend
|
|
ln -sf /usr/bin/smbspool ${pkgdir}/usr/libexec/cups/backend/smb
|
|
|
|
install -Dm644 samba-${pkgver}/COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
|
|
}
|
|
|
|
package_samba() {
|
|
pkgdesc="SMB Fileserver and AD Domain server"
|
|
depends=('db' 'popt' 'libcups' 'libcap' 'gnutls'
|
|
'talloc' 'ldb' 'libbsd' 'python' 'iniparser' 'tdb' 'libaio' 'perl-parse-yapp' "smbclient>=$pkgver")
|
|
backup=(etc/logrotate.d/samba
|
|
etc/conf.d/samba
|
|
etc/conf.d/smb)
|
|
install=samba.install
|
|
# Use samba-pkg as a staging directory for the split packages
|
|
# (This is so RPATHS and symlinks are generated correctly via
|
|
# make install, but the otherwise unsplit pieces can be split)
|
|
_pkgsrc=${srcdir}/samba-pkg
|
|
# Everything that libwbclient and smbclient didn't install goes
|
|
# into the samba package...
|
|
mv ${_pkgsrc}/* ${pkgdir}/
|
|
rmdir ${_pkgsrc}
|
|
|
|
install -Dm644 samba-${pkgver}/COPYING ${pkgdir}/usr/share/licenses/${pkgname}/COPYING
|
|
|
|
# Make admin scripts look in the right place for the samba python module
|
|
for script in bin/samba-tool sbin/samba_dnsupdate sbin/samba_kcc \
|
|
sbin/samba_spnupdate sbin/samba_upgradedns
|
|
do
|
|
sed -i "/^sys\.path\.insert/ a\
|
|
sys.path.insert(0, '/usr/lib/python${_pyver}/site-packages')" \
|
|
${pkgdir}/usr/${script}
|
|
done
|
|
|
|
# install OpenRC files
|
|
install -Dm644 ${srcdir}/smb.confd ${pkgdir}/etc/conf.d/smb
|
|
install -Dm755 ${srcdir}/smb.initd ${pkgdir}/etc/init.d/smb
|
|
|
|
# install Runit files
|
|
install -Dm755 "$srcdir/smbd.run" "$pkgdir/etc/sv/smbd/run"
|
|
install -Dm755 "$srcdir/nmbd.run" "$pkgdir/etc/sv/nmbd/run"
|
|
|
|
install -m644 ${srcdir}/samba.conf.d ${pkgdir}/etc/conf.d/samba
|
|
|
|
# create config dir
|
|
install -d -m755 "${pkgdir}"/etc/samba
|
|
|
|
mkdir -p ${pkgdir}/etc/samba/private
|
|
chmod 700 ${pkgdir}/etc/samba/private
|
|
|
|
install -D -m644 ${srcdir}/samba.logrotate ${pkgdir}/etc/logrotate.d/samba
|
|
|
|
# spool directory
|
|
install -d -m1777 ${pkgdir}/var/spool/samba
|
|
|
|
rm -rf ${pkgdir}/run
|
|
rm -rf ${pkgdir}/var/run
|
|
rm -rf ${pkgdir}/etc/sysconfig
|
|
|
|
# copy ldap example
|
|
install -D -m644 ${srcdir}/samba-${pkgver}/examples/LDAP/samba.schema ${pkgdir}/usr/share/doc/samba/examples/LDAP/samba.schema
|
|
}
|