Skip to content

Instantly share code, notes, and snippets.

@yannleretaille
Created November 21, 2017 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yannleretaille/093c4b8bc6037eeaaacf3a8bf765b53b to your computer and use it in GitHub Desktop.
Save yannleretaille/093c4b8bc6037eeaaacf3a8bf765b53b to your computer and use it in GitHub Desktop.
lib32-smbclient
# Maintainer: Rafael Fontenelle <rafaelff@gnome.org>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
pkgbase=lib32-smbclient
pkgname=('lib32-libwbclient' 'lib32-smbclient')
pkgver=4.7.1
pkgrel=1
pkgdesc="Tools to access a server's filespace and printers via SMB"
arch=('x86_64')
url='http://www.samba.org'
license=('GPL3')
makedepends=('lib32-avahi' 'lib32-gnutls' 'lib32-libbsd' 'lib32-libcap'
'lib32-libcups' 'lib32-libgcrypt' 'lib32-pam' 'lib32-python2'
'lib32-systemd' 'lib32-talloc' 'lib32-tdb' 'lib32-popt'
'lib32-tevent' 'lib32-ldb' 'lib32-libarchive' 'lib32-libaio'
'perl-parse-yapp' 'lib32-jansson')
source=("https://www.samba.org/samba/samba/ftp/stable/samba-${pkgver}.tar.gz")
md5sums=('b351ab3bddb767a3930d9e186139f95f')
build() {
cd samba-${pkgver}
SAVEIFS=${IFS}
IFS=$(echo -en "\n\b")
PYTHON_CALLERS="$(find ${srcdir}/samba-${pkgver} -name '*.py')
$(find ${srcdir}/samba-${pkgver} -name 'wscript*')
$(find ${srcdir}/samba-${pkgver} -name 'configure.ac')
$(find ${srcdir}/samba-${pkgver} -name 'upgrade_from_s3')
$(find ${srcdir}/samba-${pkgver}/buildtools -type f)
$(find ${srcdir}/samba-${pkgver}/source4/scripting -type f)"
sed -i -e 's|/usr/bin/env python$|/usr/bin/env python2-32|' \
-e 's|python-config|python2-32-config|' \
-e 's|bin/python|bin/python2-32|' \
${PYTHON_CALLERS}
IFS=${SAVEIFS}
export CC='gcc -m32'
export CXX='g++ -m32'
export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'
export PYTHON='/usr/bin/python2-32'
export PYTHON_CONFIG='/usr/bin/python2-32-config'
_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'
./configure \
--prefix='/usr' \
--libdir='/usr/lib32' \
--libexecdir='/usr/lib32/samba' \
--localstatedir='/var' \
--sbindir='/usr/bin' \
--enable-fhs \
--enable-gnutls \
--disable-rpath-install \
--disable-glusterfs \
--with-configdir='/etc/samba' \
--with-lockdir='/var/cache/samba' \
--with-piddir='/var/run' \
--with-sockets-dir='/var/run/samba' \
--with-{ads,ldap,winbind,acl-support} \
--with-pam \
--with-pammodulesdir='/usr/lib32/security' \
--bundled-libraries='!tdb,!talloc,!pytalloc-util,!tevent,!popt,!ldb,!pyldb-util' \
--with-shared-modules="${_samba4_idmap_modules},${_samba4_pdb_modules},${_samba4_auth_modules}"
make
make DESTDIR="${srcdir}/staging" install
}
package_lib32-libwbclient() {
pkgdesc='Samba winbind client library'
depends=('lib32-libbsd' 'libwbclient')
cd staging
install -dm 755 "${pkgdir}"/usr/lib32/{pkgconfig,samba}
mv usr/lib32/libwbclient*.so* "${pkgdir}"/usr/lib32/
mv usr/lib32/samba/libwinbind-client*.so* "${pkgdir}"/usr/lib32/samba/
mv usr/lib32/samba/libreplace*.so* "${pkgdir}"/usr/lib32/samba/
mv usr/lib32/pkgconfig/wbclient.pc "${pkgdir}"/usr/lib32/pkgconfig/
}
package_lib32-smbclient() {
depends=('lib32-avahi' 'lib32-gnutls' 'lib32-libcap' 'lib32-libcups'
'lib32-libgcrypt' 'lib32-libwbclient' 'lib32-pam' 'lib32-systemd'
'lib32-talloc' 'lib32-tdb' 'lib32-ldb' 'lib32-python2' 'lib32-jansson'
'lib32-libaio' 'perl-parse-yapp' 'smbclient')
cd staging
install -dm 755 "${pkgdir}"/usr/lib32/{pkgconfig,samba}
for lib in usr/lib32/lib*.so*; do
mv ${lib} "${pkgdir}"/usr/lib32/
done
for lib in usr/lib32/samba/lib*.so*; do
mv ${lib} "${pkgdir}"/usr/lib32/samba/
done
}
# vim: ts=2 sw=2 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment