upgpkg: sbcl 2.2.4-1
[arch-packages.git] / samba / trunk / PKGBUILD
blobb75a81258efdba8e6fbd8888f3fb76d0fd62b9c5
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.16.0
14 pkgrel=6
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              'ceph-libs' '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         34771e1931587807d0395c7ac7f4be18654997f4.patch)
33 validpgpkeys=('81F5E2832BD2545A1897B713AA99442FB680B620') #Samba Distribution Verification Key <samba-bugs@samba.org>
34 sha512sums=('cea6bab64021779d217669e58612d192b907c2c481ef30e40e449bc6b8f8993a9b7b7b5bfcfebe54d8f70b8f720893cfa77a9d674ef8e07dd45a55a0fbc673e2'
35             'SKIP'
36             '2ba0691ded467e4d6e40821f6de58c00f8962209efe2e60284c0c87756ab471c22c3d63b77d506e48c90ed0d852a2a24e41be1d499cf74a73cb99da0b503c858'
37             '1e6183ab0eb812b3ef687ac2c26ce78f7cb30540f606d20023669ac00ba04075487fb72e4dc89cc05dab0269ff6aca98fc1167cc75669c225b88b592482fbf67'
38             'e46ee848baabb261e7468ecee43aba4d001a24f86f5322ae522abdb75030fd0ebd9063b9df0be3576c4d1654d81331f5e389aee16ec2fa138259ae4728e94efc'
39             'ee60e1d16241698fa4e66fbb97d4a08c6ccf8f03a1ce17b855bd0ca47b546747d67a01c89330072833949ec1ab8d7fd713c7370613b24e777f158c141195cd53')
40 ### UNINSTALL dmapi package before building!!!
42 prepare () {
43   # Fix 74259
44   cd samba-${pkgver}
45   patch -Rp1 -i ../34771e1931587807d0395c7ac7f4be18654997f4.patch
48 build() {
49   # Use samba-pkg as a staging directory for the split packages
50   # (This is so RPATHS and symlinks are generated correctly via
51   # make install, but the otherwise unsplit pieces can be split)
52   _pkgsrc="${srcdir}"/samba-pkg
53   rm -rf ${_pkgsrc}
54   _samba4_idmap_modules=idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2
55   _samba4_pdb_modules=pdb_tdbsam,pdb_ldap,pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4
56   _samba4_auth_modules=auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4
57   cd samba-${pkgver}
58   ./configure --enable-fhs \
59               --prefix=/usr \
60               --sysconfdir=/etc \
61               --sbindir=/usr/bin \
62               --libdir=/usr/lib \
63               --libexecdir=/usr/lib/samba \
64               --localstatedir=/var \
65               --with-configdir=/etc/samba \
66               --with-lockdir=/var/cache/samba \
67               --with-sockets-dir=/run/samba \
68               --with-piddir=/run \
69               --with-ads \
70               --with-ldap \
71               --with-winbind \
72               --with-acl-support \
73               --with-systemd \
74               --systemd-install-services \
75               --with-pam \
76               --with-pammodulesdir=/usr/lib/security \
77               --bundled-libraries=!tdb,!talloc,!pytalloc-util,!tevent,!popt,!ldb,!pyldb-util \
78               --with-shared-modules=${_samba4_idmap_modules},${_samba4_pdb_modules},${_samba4_auth_modules},vfs_io_uring \
79               --disable-rpath-install \
80               --with-cluster-support \
81               --with-profiling-data
83               # Add this to the options once it's working...
84                #--with-system-mitkrb5 /opt/heimdal
85   make
86   make DESTDIR="${_pkgsrc}/" install
88   # This gets skipped somehow
89   if [ ! -e "${_pkgsrc}"/usr/bin/smbtar ]; then
90       install -m755 "${srcdir}"/samba-${pkgver}/source3/script/smbtar "${_pkgsrc}"/usr/bin/
91   fi
94 package_smbclient() {
95 pkgdesc="Tools to access a server's filespace and printers via SMB"
96 depends=('popt' 'cifs-utils' 'tdb' 'ldb'
97          'tevent' 'libgcrypt' 'python' 'talloc' 'readline' 'gnutls'
98          'libbsd' 'libldap' 'libcups' 'libarchive' 'libnsl' 'jansson'
99          'libldb.so' 'libtdb.so' 'libtevent.so' 'libreadline.so' 'icu')
100 replaces=('libwbclient')
101 provides=('libwbclient')
103     _smbclient_bins=('smbclient' 'rpcclient' 'smbspool'
104                      'smbtree' 'smbcacls' 'smbcquotas' 'smbget' 'net'
105                      'nmblookup' 'smbtar')
106     # Use samba-pkg as a staging directory for the split packages
107     # (This is so RPATHS and symlinks are generated correctly via
108     # make install, but the otherwise unsplit pieces can be split)
109     _pkgsrc="${srcdir}"/samba-pkg
110     install -d -m755 "${pkgdir}"/usr/bin
111     for bin in ${_smbclient_bins[@]}; do
112         mv "${_pkgsrc}"/usr/bin/${bin} "${pkgdir}"/usr/bin/
113     done
115     # smbclient binaries link to the majority of the samba
116     # libs, so this is a shortcut instead of resolving the
117     # whole dependency tree by hand
118     install -d -m755 "${pkgdir}"/usr/lib
119     for lib in "${_pkgsrc}"/usr/lib/lib*.so*; do
120         mv ${lib} "${pkgdir}"/usr/lib/
121     done
123     install -d -m755 "${pkgdir}"/usr/lib/samba
124     for lib in "${_pkgsrc}"/usr/lib/samba/lib*.so*; do
125         mv ${lib} "${pkgdir}"/usr/lib/samba/
126     done
128     install -d -m755 "${pkgdir}"/usr/lib/pkgconfig
129     mv "${_pkgsrc}"/usr/lib/pkgconfig/smbclient.pc "${pkgdir}"/usr/lib/pkgconfig/
130     mv "${_pkgsrc}"/usr/lib/pkgconfig/netapi.pc "${pkgdir}"/usr/lib/pkgconfig/
131     mv "${_pkgsrc}"/usr/lib/pkgconfig/wbclient.pc "${pkgdir}"/usr/lib/pkgconfig/
133     install -d -m755 "${pkgdir}"/usr/share/man/man1
134     install -d -m755 "${pkgdir}"/usr/share/man/man7
135     install -d -m755 "${pkgdir}"/usr/share/man/man8
136     for bin in ${_smbclient_bins[@]}; do
137         if [ -e "${_pkgsrc}"/usr/share/man/man1/${bin}.1 ]; then
138             mv "${_pkgsrc}"/usr/share/man/man1/${bin}.1 "${pkgdir}"/usr/share/man/man1/
139         fi
140         if [ -e "${_pkgsrc}"/usr/share/man/man8/${bin}.8 ]; then
141             mv "${_pkgsrc}"/usr/share/man/man8/${bin}.8 "${pkgdir}"/usr/share/man/man8/
142         fi
143     done
144     mv "${_pkgsrc}"/usr/share/man/man7/libsmbclient.7 "${pkgdir}"/usr/share/man/man7/
146     install -d -m755 "${pkgdir}"/usr/include/samba-4.0
147     mv "${_pkgsrc}"/usr/include/samba-4.0/libsmbclient.h "${pkgdir}"/usr/include/samba-4.0/
148     mv "${_pkgsrc}"/usr/include/samba-4.0/netapi.h "${pkgdir}"/usr/include/samba-4.0/
149     mv "${_pkgsrc}"/usr/include/samba-4.0/wbclient.h "${pkgdir}"/usr/include/samba-4.0/
151     mkdir -p "${pkgdir}"/usr/lib/cups/backend
152     ln -sf /usr/bin/smbspool "${pkgdir}"/usr/lib/cups/backend/smb
155 package_samba() {
156 pkgdesc="SMB Fileserver and AD Domain server"
157 depends=('db>=4.7' 'popt' 'libcups' 'libcap>=2.16' 'gnutls>=2.4.1'
158          'talloc' 'ldb' 'libbsd' 'python' 'iniparser' 'tdb' 'libaio' 'perl-parse-yapp' "smbclient>=$pkgver" 'gpgme'
159          'ceph-libs' 'libldb.so' 'libtdb.so' 'libtevent.so' 'liburing')
160 backup=(etc/logrotate.d/samba
161         etc/pam.d/samba
162         etc/conf.d/samba)
163 install=samba.install
164     # Use samba-pkg as a staging directory for the split packages
165     # (This is so RPATHS and symlinks are generated correctly via
166     # make install, but the otherwise unsplit pieces can be split)
167     _pkgsrc="${srcdir}"/samba-pkg
168     # Everything that libwbclient and smbclient didn't install goes
169     # into the samba package...
170     mv "${_pkgsrc}"/* "${pkgdir}"
171     rmdir "${_pkgsrc}"
173     # Make admin scripts look in the right place for the samba python module
174     for script in bin/samba_dnsupdate bin/samba_kcc bin/samba_spnupdate \
175                   bin/samba_upgradedns bin/samba-tool
176     do
177         sed -i "/^sys\.path\.insert/ a\
178 sys.path.insert(0, '/usr/lib/python${_pyver}/site-packages')" \
179                "${pkgdir}"/usr/${script}
180     done
182   # packaging/wscript_build to use /etc/conf.d
183   sed -i -e '/^EnvironmentFile/ s/sysconfig/conf.d/' "${pkgdir}"/usr/lib/systemd/system/*.service
184   install -d -m755  "${pkgdir}"/etc/conf.d
185   install -m644 "${srcdir}"/samba-${pkgver}/packaging/systemd/samba.sysconfig "${pkgdir}"/etc/conf.d/samba
187   # create ephemeral dirs via tmpfiles rather than shipping them in package
188   install -D -m644 "${srcdir}"/samba.conf "${pkgdir}"/usr/lib/tmpfiles.d/samba.conf
189   # create config dir
190   install -d -m755 "${pkgdir}"/etc/samba
192   mkdir -p "${pkgdir}"/etc/samba/private
193   chmod 700 "${pkgdir}"/etc/samba/private
195   install -D -m644 "${srcdir}"/samba.logrotate "${pkgdir}"/etc/logrotate.d/samba
196   install -D -m644 "${srcdir}"/samba.pam "${pkgdir}"/etc/pam.d/samba 
197   
198   # spool directory
199   install -d -m1777 "${pkgdir}"/var/spool/samba
200   
201   rm -rf "${pkgdir}"/run
202   rm -rf "${pkgdir}"/var/run
203   rm -rf "${pkgdir}"/etc/sysconfig
204   
205   # copy ldap example
206   install -D -m644 "${srcdir}"/samba-${pkgver}/examples/LDAP/samba.schema "${pkgdir}"/usr/share/doc/samba/examples/LDAP/samba.schema
208   # Fix waf installing the wrong permissions for sudoers.d
209   chmod 750 ${pkgdir}/etc/sudoers.d
210   chmod 440 ${pkgdir}/etc/sudoers.d/ctdb
211   # install ctdb service
212   install -D -m644 "${srcdir}"/samba-${pkgver}/ctdb/config/ctdb.service  ${pkgdir}/usr/lib/systemd/system/ctdb.service
215 # vim: ts=2 sw=2 et: