2 # Maintainer: Tobias Powalowski <tpowa@archlinux.org>
3 # Contributor: judd <jvinet@zeroflux.org>
4 # Contributor: Michael Hansen <zrax0111 gmail com>
5 # Contributor: Marco A Rojas <marquicus at gmail.com>
6 # Contributor: Netanel Shine <netanel at archlinux.org.il >
7 # Contributor: ngoonee <ngoonee.talk@gmail.com>
8 # Contributor: Adam Russell <adamlr6+arch@gmail.com>
9 # Contributor: Dhananjay Sathe <dhananjaysathe@gmail.com>
12 pkgname=('smbclient' 'samba')
16 url="https://www.samba.org"
18 makedepends=('python' 'python-markdown' 'python-dnspython' 'docbook-xsl' 'pkg-config' 'libbsd' 'db' 'popt' 'libcups'
19 'readline' 'tevent' 'acl' 'libldap' 'libcap' 'ldb' 'krb5' 'pam'
20 'systemd' 'gnutls' 'talloc' 'tdb' 'dbus' 'libaio'
21 'perl-parse-yapp' 'libnsl' 'libtirpc' 'rpcsvc-proto' 'jansson'
22 'liburing' 'perl-json' 'glusterfs')
24 'python-dnspython: samba_dnsupdate and samba_upgradedns in AD setup'
25 'python-markdown: for samba-tool domain schemeupgrade'
26 'glusterfs: for vfs_glusterfs support'
28 source=(https://us1.samba.org/samba/ftp/stable/${pkgbase}-${pkgver}.tar{.gz,.asc}
32 samba-glibc-2.36.patch)
33 validpgpkeys=('81F5E2832BD2545A1897B713AA99442FB680B620') #Samba Distribution Verification Key <samba-bugs@samba.org>
34 sha512sums=('9754275ace30755b75f747e201f8ad4550a823c8606e550c0ce6b3ccbaf048dd895bf2c21127271298304be7f80de9b6451091c4949ebe267ee1cf3ab497cd85'
36 '2ba0691ded467e4d6e40821f6de58c00f8962209efe2e60284c0c87756ab471c22c3d63b77d506e48c90ed0d852a2a24e41be1d499cf74a73cb99da0b503c858'
37 '1e6183ab0eb812b3ef687ac2c26ce78f7cb30540f606d20023669ac00ba04075487fb72e4dc89cc05dab0269ff6aca98fc1167cc75669c225b88b592482fbf67'
38 'e46ee848baabb261e7468ecee43aba4d001a24f86f5322ae522abdb75030fd0ebd9063b9df0be3576c4d1654d81331f5e389aee16ec2fa138259ae4728e94efc'
39 'a6404c4ecfa60ab38fb79c5cd6af2818762ff2fe787e512c0eee0af6459d7726e168e76724a3012d895a30a68c11723e7a3f1fdb027d56dda8e1fdcc9059b915')
40 ### UNINSTALL dmapi package before building!!!
44 patch -Np1 -i ../samba-glibc-2.36.patch
48 # Use samba-pkg as a staging directory for the split packages
49 # (This is so RPATHS and symlinks are generated correctly via
50 # make install, but the otherwise unsplit pieces can be split)
51 _pkgsrc="${srcdir}"/samba-pkg
53 _samba4_idmap_modules=idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2
54 _samba4_pdb_modules=pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4
55 _samba4_auth_modules=auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4
57 ./configure --enable-fhs \
62 --libexecdir=/usr/lib/samba \
63 --localstatedir=/var \
64 --with-configdir=/etc/samba \
65 --with-lockdir=/var/cache/samba \
66 --with-sockets-dir=/run/samba \
73 --systemd-install-services \
75 --with-pammodulesdir=/usr/lib/security \
76 --bundled-libraries=!tdb,!talloc,!pytalloc-util,!tevent,!popt,!ldb,!pyldb-util \
77 --with-shared-modules=${_samba4_idmap_modules},${_samba4_pdb_modules},${_samba4_auth_modules},vfs_io_uring \
78 --disable-rpath-install \
81 # Add this to the options once it's working...
82 #--with-system-mitkrb5 /opt/heimdal
84 make DESTDIR="${_pkgsrc}/" install
86 # This gets skipped somehow
87 if [ ! -e "${_pkgsrc}"/usr/bin/smbtar ]; then
88 install -m755 "${srcdir}"/samba-${pkgver}/source3/script/smbtar "${_pkgsrc}"/usr/bin/
93 pkgdesc="Tools to access a server's filespace and printers via SMB"
94 depends=('popt' 'cifs-utils' 'tdb' 'ldb'
95 'tevent' 'libgcrypt' 'python' 'talloc' 'readline' 'gnutls'
96 'libbsd' 'libldap' 'libcups' 'libarchive' 'libnsl' 'jansson'
97 'libldb.so' 'libtdb.so' 'libtevent.so' 'libreadline.so' 'icu' 'libunwind')
98 replaces=('libwbclient')
99 provides=('libwbclient')
101 _smbclient_bins=('smbclient' 'rpcclient' 'smbspool'
102 'smbtree' 'smbcacls' 'smbcquotas' 'smbget' 'net'
103 'nmblookup' 'smbtar')
104 # Use samba-pkg as a staging directory for the split packages
105 # (This is so RPATHS and symlinks are generated correctly via
106 # make install, but the otherwise unsplit pieces can be split)
107 _pkgsrc="${srcdir}"/samba-pkg
108 install -d -m755 "${pkgdir}"/usr/bin
109 for bin in ${_smbclient_bins[@]}; do
110 mv "${_pkgsrc}"/usr/bin/${bin} "${pkgdir}"/usr/bin/
113 # smbclient binaries link to the majority of the samba
114 # libs, so this is a shortcut instead of resolving the
115 # whole dependency tree by hand
116 install -d -m755 "${pkgdir}"/usr/lib
117 for lib in "${_pkgsrc}"/usr/lib/lib*.so*; do
118 mv ${lib} "${pkgdir}"/usr/lib/
121 install -d -m755 "${pkgdir}"/usr/lib/samba
122 for lib in "${_pkgsrc}"/usr/lib/samba/lib*.so*; do
123 mv ${lib} "${pkgdir}"/usr/lib/samba/
126 install -d -m755 "${pkgdir}"/usr/lib/pkgconfig
127 mv "${_pkgsrc}"/usr/lib/pkgconfig/smbclient.pc "${pkgdir}"/usr/lib/pkgconfig/
128 mv "${_pkgsrc}"/usr/lib/pkgconfig/netapi.pc "${pkgdir}"/usr/lib/pkgconfig/
129 mv "${_pkgsrc}"/usr/lib/pkgconfig/wbclient.pc "${pkgdir}"/usr/lib/pkgconfig/
131 install -d -m755 "${pkgdir}"/usr/share/man/man1
132 install -d -m755 "${pkgdir}"/usr/share/man/man7
133 install -d -m755 "${pkgdir}"/usr/share/man/man8
134 for bin in ${_smbclient_bins[@]}; do
135 if [ -e "${_pkgsrc}"/usr/share/man/man1/${bin}.1 ]; then
136 mv "${_pkgsrc}"/usr/share/man/man1/${bin}.1 "${pkgdir}"/usr/share/man/man1/
138 if [ -e "${_pkgsrc}"/usr/share/man/man8/${bin}.8 ]; then
139 mv "${_pkgsrc}"/usr/share/man/man8/${bin}.8 "${pkgdir}"/usr/share/man/man8/
142 mv "${_pkgsrc}"/usr/share/man/man7/libsmbclient.7 "${pkgdir}"/usr/share/man/man7/
144 install -d -m755 "${pkgdir}"/usr/include/samba-4.0
145 mv "${_pkgsrc}"/usr/include/samba-4.0/libsmbclient.h "${pkgdir}"/usr/include/samba-4.0/
146 mv "${_pkgsrc}"/usr/include/samba-4.0/netapi.h "${pkgdir}"/usr/include/samba-4.0/
147 mv "${_pkgsrc}"/usr/include/samba-4.0/wbclient.h "${pkgdir}"/usr/include/samba-4.0/
149 mkdir -p "${pkgdir}"/usr/lib/cups/backend
150 ln -sf /usr/bin/smbspool "${pkgdir}"/usr/lib/cups/backend/smb
154 pkgdesc="SMB Fileserver and AD Domain server"
155 depends=('db>=4.7' 'popt' 'libcups' 'libcap>=2.16' 'gnutls>=2.4.1'
156 'talloc' 'ldb' 'libbsd' 'python' 'iniparser' 'tdb' 'libaio' 'perl-parse-yapp' "smbclient>=$pkgver" 'gpgme'
157 'libldb.so' 'libtdb.so' 'libtevent.so' 'liburing' 'libunwind')
158 backup=(etc/logrotate.d/samba
161 install=samba.install
162 # Use samba-pkg as a staging directory for the split packages
163 # (This is so RPATHS and symlinks are generated correctly via
164 # make install, but the otherwise unsplit pieces can be split)
165 _pkgsrc="${srcdir}"/samba-pkg
166 # Everything that libwbclient and smbclient didn't install goes
167 # into the samba package...
168 mv "${_pkgsrc}"/* "${pkgdir}"
171 # Make admin scripts look in the right place for the samba python module
172 for script in bin/samba_dnsupdate bin/samba_kcc bin/samba_spnupdate \
173 bin/samba_upgradedns bin/samba-tool
175 sed -i "/^sys\.path\.insert/ a\
176 sys.path.insert(0, '/usr/lib/python${_pyver}/site-packages')" \
177 "${pkgdir}"/usr/${script}
180 # packaging/wscript_build to use /etc/conf.d
181 sed -i -e '/^EnvironmentFile/ s/sysconfig/conf.d/' "${pkgdir}"/usr/lib/systemd/system/*.service
182 install -d -m755 "${pkgdir}"/etc/conf.d
183 install -m644 "${srcdir}"/samba-${pkgver}/packaging/systemd/samba.sysconfig "${pkgdir}"/etc/conf.d/samba
185 # create ephemeral dirs via tmpfiles rather than shipping them in package
186 install -D -m644 "${srcdir}"/samba.conf "${pkgdir}"/usr/lib/tmpfiles.d/samba.conf
188 install -d -m755 "${pkgdir}"/etc/samba
190 mkdir -p "${pkgdir}"/etc/samba/private
191 chmod 700 "${pkgdir}"/etc/samba/private
193 install -D -m644 "${srcdir}"/samba.logrotate "${pkgdir}"/etc/logrotate.d/samba
194 install -D -m644 "${srcdir}"/samba.pam "${pkgdir}"/etc/pam.d/samba
197 install -d -m1777 "${pkgdir}"/var/spool/samba
199 rm -rf "${pkgdir}"/run
200 rm -rf "${pkgdir}"/var/run
201 rm -rf "${pkgdir}"/etc/sysconfig
204 install -D -m644 "${srcdir}"/samba-${pkgver}/examples/LDAP/samba.schema "${pkgdir}"/usr/share/doc/samba/examples/LDAP/samba.schema