db-move: moved django from [testing] to [extra] (any)
[arch-packages.git] / samba / trunk / PKGBUILD
blob5bfde1d13ad557b44525e0e0a489e0c42edfb4ce
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>
11 pkgbase=samba
12 pkgname=('smbclient' 'samba')
13 pkgver=4.17.2
14 pkgrel=1
15 arch=(x86_64)
16 url="https://www.samba.org"
17 license=('GPL3')
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')
23 optdepends=(
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}
29         samba.logrotate
30         samba.pam
31         samba.conf)
32 validpgpkeys=('81F5E2832BD2545A1897B713AA99442FB680B620') #Samba Distribution Verification Key <samba-bugs@samba.org>
33 sha512sums=('31d52d3366e39048a02550ee53d4e0956eedfda0d7d8dcb8f1f23b2435852023eb0eb8c1252aa2780ce8e7dd81f402e84ab8c17156dd18fe80d8b763eb83ce79'
34             'SKIP'
35             '2ba0691ded467e4d6e40821f6de58c00f8962209efe2e60284c0c87756ab471c22c3d63b77d506e48c90ed0d852a2a24e41be1d499cf74a73cb99da0b503c858'
36             '1e6183ab0eb812b3ef687ac2c26ce78f7cb30540f606d20023669ac00ba04075487fb72e4dc89cc05dab0269ff6aca98fc1167cc75669c225b88b592482fbf67'
37             'e46ee848baabb261e7468ecee43aba4d001a24f86f5322ae522abdb75030fd0ebd9063b9df0be3576c4d1654d81331f5e389aee16ec2fa138259ae4728e94efc')
38 ### UNINSTALL dmapi package before building!!!
40 build() {
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
45   rm -rf ${_pkgsrc}
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
49   cd samba-${pkgver}
50   ./configure --enable-fhs \
51               --prefix=/usr \
52               --sysconfdir=/etc \
53               --sbindir=/usr/bin \
54               --libdir=/usr/lib \
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 \
60               --with-piddir=/run \
61               --with-ads \
62               --with-ldap \
63               --with-winbind \
64               --with-acl-support \
65               --with-systemd \
66               --systemd-install-services \
67               --with-pam \
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 \
72               --with-profiling-data
74               # Add this to the options once it's working...
75                #--with-system-mitkrb5 /opt/heimdal
76   make
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/
82   fi
85 package_smbclient() {
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'
96                      'nmblookup' 'smbtar')
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/
104     done
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/
112     done
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/
117     done
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/
130         fi
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/
133         fi
134     done
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
146 package_samba() {
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
152         etc/pam.d/samba
153         etc/conf.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}"
162     rmdir "${_pkgsrc}"
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
167     do
168         sed -i "/^sys\.path\.insert/ a\
169 sys.path.insert(0, '/usr/lib/python${_pyver}/site-packages')" \
170                "${pkgdir}"/usr/${script}
171     done
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
180   # create config dir
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 
188   
189   # spool directory
190   install -d -m1777 "${pkgdir}"/var/spool/samba
191   
192   rm -rf "${pkgdir}"/run
193   rm -rf "${pkgdir}"/var/run
194   rm -rf "${pkgdir}"/etc/sysconfig
195   
196   # copy ldap example
197   install -D -m644 "${srcdir}"/samba-${pkgver}/examples/LDAP/samba.schema "${pkgdir}"/usr/share/doc/samba/examples/LDAP/samba.schema
200 # vim: ts=2 sw=2 et: