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 validpgpkeys=('81F5E2832BD2545A1897B713AA99442FB680B620') #Samba Distribution Verification Key <samba-bugs@samba.org>
33 sha512sums=('31d52d3366e39048a02550ee53d4e0956eedfda0d7d8dcb8f1f23b2435852023eb0eb8c1252aa2780ce8e7dd81f402e84ab8c17156dd18fe80d8b763eb83ce79'
35 '2ba0691ded467e4d6e40821f6de58c00f8962209efe2e60284c0c87756ab471c22c3d63b77d506e48c90ed0d852a2a24e41be1d499cf74a73cb99da0b503c858'
36 '1e6183ab0eb812b3ef687ac2c26ce78f7cb30540f606d20023669ac00ba04075487fb72e4dc89cc05dab0269ff6aca98fc1167cc75669c225b88b592482fbf67'
37 'e46ee848baabb261e7468ecee43aba4d001a24f86f5322ae522abdb75030fd0ebd9063b9df0be3576c4d1654d81331f5e389aee16ec2fa138259ae4728e94efc')
38 ### UNINSTALL dmapi package before building!!!
41 # Use samba-pkg as a staging directory for the split packages
42 # (This is so RPATHS and symlinks are generated correctly via
43 # make install, but the otherwise unsplit pieces can be split)
44 _pkgsrc="${srcdir}"/samba-pkg
46 _samba4_idmap_modules=idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2
47 _samba4_pdb_modules=pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4
48 _samba4_auth_modules=auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4
50 ./configure --enable-fhs \
55 --libexecdir=/usr/lib/samba \
56 --localstatedir=/var \
57 --with-configdir=/etc/samba \
58 --with-lockdir=/var/cache/samba \
59 --with-sockets-dir=/run/samba \
66 --systemd-install-services \
68 --with-pammodulesdir=/usr/lib/security \
69 --bundled-libraries=!tdb,!talloc,!pytalloc-util,!tevent,!popt,!ldb,!pyldb-util \
70 --with-shared-modules=${_samba4_idmap_modules},${_samba4_pdb_modules},${_samba4_auth_modules},vfs_io_uring \
71 --disable-rpath-install \
74 # Add this to the options once it's working...
75 #--with-system-mitkrb5 /opt/heimdal
77 make DESTDIR="${_pkgsrc}/" install
79 # This gets skipped somehow
80 if [ ! -e "${_pkgsrc}"/usr/bin/smbtar ]; then
81 install -m755 "${srcdir}"/samba-${pkgver}/source3/script/smbtar "${_pkgsrc}"/usr/bin/
86 pkgdesc="Tools to access a server's filespace and printers via SMB"
87 depends=('popt' 'cifs-utils' 'tdb' 'ldb'
88 'tevent' 'libgcrypt' 'python' 'talloc' 'readline' 'gnutls'
89 'libbsd' 'libldap' 'libcups' 'libarchive' 'libnsl' 'jansson'
90 'libldb.so' 'libtdb.so' 'libtevent.so' 'libreadline.so' 'icu' 'libunwind')
91 replaces=('libwbclient')
92 provides=('libwbclient')
94 _smbclient_bins=('smbclient' 'rpcclient' 'smbspool'
95 'smbtree' 'smbcacls' 'smbcquotas' 'smbget' 'net'
97 # Use samba-pkg as a staging directory for the split packages
98 # (This is so RPATHS and symlinks are generated correctly via
99 # make install, but the otherwise unsplit pieces can be split)
100 _pkgsrc="${srcdir}"/samba-pkg
101 install -d -m755 "${pkgdir}"/usr/bin
102 for bin in ${_smbclient_bins[@]}; do
103 mv "${_pkgsrc}"/usr/bin/${bin} "${pkgdir}"/usr/bin/
106 # smbclient binaries link to the majority of the samba
107 # libs, so this is a shortcut instead of resolving the
108 # whole dependency tree by hand
109 install -d -m755 "${pkgdir}"/usr/lib
110 for lib in "${_pkgsrc}"/usr/lib/lib*.so*; do
111 mv ${lib} "${pkgdir}"/usr/lib/
114 install -d -m755 "${pkgdir}"/usr/lib/samba
115 for lib in "${_pkgsrc}"/usr/lib/samba/lib*.so*; do
116 mv ${lib} "${pkgdir}"/usr/lib/samba/
119 install -d -m755 "${pkgdir}"/usr/lib/pkgconfig
120 mv "${_pkgsrc}"/usr/lib/pkgconfig/smbclient.pc "${pkgdir}"/usr/lib/pkgconfig/
121 mv "${_pkgsrc}"/usr/lib/pkgconfig/netapi.pc "${pkgdir}"/usr/lib/pkgconfig/
122 mv "${_pkgsrc}"/usr/lib/pkgconfig/wbclient.pc "${pkgdir}"/usr/lib/pkgconfig/
124 install -d -m755 "${pkgdir}"/usr/share/man/man1
125 install -d -m755 "${pkgdir}"/usr/share/man/man7
126 install -d -m755 "${pkgdir}"/usr/share/man/man8
127 for bin in ${_smbclient_bins[@]}; do
128 if [ -e "${_pkgsrc}"/usr/share/man/man1/${bin}.1 ]; then
129 mv "${_pkgsrc}"/usr/share/man/man1/${bin}.1 "${pkgdir}"/usr/share/man/man1/
131 if [ -e "${_pkgsrc}"/usr/share/man/man8/${bin}.8 ]; then
132 mv "${_pkgsrc}"/usr/share/man/man8/${bin}.8 "${pkgdir}"/usr/share/man/man8/
135 mv "${_pkgsrc}"/usr/share/man/man7/libsmbclient.7 "${pkgdir}"/usr/share/man/man7/
137 install -d -m755 "${pkgdir}"/usr/include/samba-4.0
138 mv "${_pkgsrc}"/usr/include/samba-4.0/libsmbclient.h "${pkgdir}"/usr/include/samba-4.0/
139 mv "${_pkgsrc}"/usr/include/samba-4.0/netapi.h "${pkgdir}"/usr/include/samba-4.0/
140 mv "${_pkgsrc}"/usr/include/samba-4.0/wbclient.h "${pkgdir}"/usr/include/samba-4.0/
142 mkdir -p "${pkgdir}"/usr/lib/cups/backend
143 ln -sf /usr/bin/smbspool "${pkgdir}"/usr/lib/cups/backend/smb
147 pkgdesc="SMB Fileserver and AD Domain server"
148 depends=('db>=4.7' 'popt' 'libcups' 'libcap>=2.16' 'gnutls>=2.4.1'
149 'talloc' 'ldb' 'libbsd' 'python' 'iniparser' 'tdb' 'libaio' 'perl-parse-yapp' "smbclient>=$pkgver" 'gpgme'
150 'libldb.so' 'libtdb.so' 'libtevent.so' 'liburing' 'libunwind')
151 backup=(etc/logrotate.d/samba
154 install=samba.install
155 # Use samba-pkg as a staging directory for the split packages
156 # (This is so RPATHS and symlinks are generated correctly via
157 # make install, but the otherwise unsplit pieces can be split)
158 _pkgsrc="${srcdir}"/samba-pkg
159 # Everything that libwbclient and smbclient didn't install goes
160 # into the samba package...
161 mv "${_pkgsrc}"/* "${pkgdir}"
164 # Make admin scripts look in the right place for the samba python module
165 for script in bin/samba_dnsupdate bin/samba_kcc bin/samba_spnupdate \
166 bin/samba_upgradedns bin/samba-tool
168 sed -i "/^sys\.path\.insert/ a\
169 sys.path.insert(0, '/usr/lib/python${_pyver}/site-packages')" \
170 "${pkgdir}"/usr/${script}
173 # packaging/wscript_build to use /etc/conf.d
174 sed -i -e '/^EnvironmentFile/ s/sysconfig/conf.d/' "${pkgdir}"/usr/lib/systemd/system/*.service
175 install -d -m755 "${pkgdir}"/etc/conf.d
176 install -m644 "${srcdir}"/samba-${pkgver}/packaging/systemd/samba.sysconfig "${pkgdir}"/etc/conf.d/samba
178 # create ephemeral dirs via tmpfiles rather than shipping them in package
179 install -D -m644 "${srcdir}"/samba.conf "${pkgdir}"/usr/lib/tmpfiles.d/samba.conf
181 install -d -m755 "${pkgdir}"/etc/samba
183 mkdir -p "${pkgdir}"/etc/samba/private
184 chmod 700 "${pkgdir}"/etc/samba/private
186 install -D -m644 "${srcdir}"/samba.logrotate "${pkgdir}"/etc/logrotate.d/samba
187 install -D -m644 "${srcdir}"/samba.pam "${pkgdir}"/etc/pam.d/samba
190 install -d -m1777 "${pkgdir}"/var/spool/samba
192 rm -rf "${pkgdir}"/run
193 rm -rf "${pkgdir}"/var/run
194 rm -rf "${pkgdir}"/etc/sysconfig
197 install -D -m644 "${srcdir}"/samba-${pkgver}/examples/LDAP/samba.schema "${pkgdir}"/usr/share/doc/samba/examples/LDAP/samba.schema