void-packages/srcpkgs/samba/template
2015-02-23 17:14:18 +01:00

122 lines
3.8 KiB
Text

# Template file for 'samba'
pkgname=samba
version=3.6.25
revision=1
build_wrksrc=source3
build_style=gnu-configure
configure_args="--with-fhs --with-pam --with-pam_smbpass --with-ldap
--with-configdir=/etc/samba --with-lockdir=/var/samba --with-static-libs=libtevent
--with-cachedir=/var/samba --with-nmbdsocketdir=/run/samba/socket
--with-statedir=/var/samba --with-piddir=/run/samba --with-dnsupdate
--with-pammodulesdir=/usr/lib/security --with-automount --disable-swat
--with-syslog --enable-external-libtalloc --with-quotas --enable-cups
--enable-external-libtdb --disable-fam --with-ads --with-acl-support
--with-shared-modules=idmap_ad,idmap_adex,idmap_rid,idmap_hash,idmap_tdb2"
short_desc="SMB/CIFS file, print, and login server for Unix"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-3"
homepage="http://www.samba.org"
distfiles="http://us1.samba.org/samba/ftp/stable/$pkgname-$version.tar.gz"
checksum=8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751
lib32disabled=yes
replaces="runit-void<20141013_2"
build_options="systemd"
conf_files="/etc/pam.d/samba"
hostmakedepends="pkg-config perl python-devel"
makedepends="readline-devel>=6.3 libcap-devel popt-devel e2fsprogs-devel
mit-krb5-devel>=1.10.1 libldap-devel pam-devel acl-devel avahi-libs-devel
tdb-devel talloc-devel cups-devel"
if [ "$CROSS_BUILD" ]; then
configure_args+=" samba_cv_CC_NEGATIVE_ENUM_VALUES=yes
libreplace_cv_HAVE_GETADDRINFO=no
libreplace_cv_HAVE_GETIFADDRS=yes
ac_cv_file__proc_sys_kernel_core_pattern=yes
ac_cv_func_ext_krb5_free_keytab_entry_contents=yes
samba_cv_HAVE_WRFILE_KEYTAB=yes
smb_krb5_cv_enctype_to_string_takes_size_t_arg=yes
smb_krb5_cv_enctype_to_string_takes_krb5_context_arg=yes"
fi
pre_configure() {
sed -e 's,XFS_QUOTA_,FS_QUOTA_,g' -i lib/sysquotas_xfs.c
}
post_install() {
cd ${wrksrc}
# conf file
cat examples/smb.conf.default | \
sed 's|log file = .*$|log file = /var/log/samba/%m.log|g' > \
${DESTDIR}/etc/samba/smb.conf
# fix logrotate
sed -i -e 's|log.%m|%m.log|g' ${DESTDIR}/etc/samba/smb.conf
# fix spool directory
sed -i 's|/usr/spool/samba|/var/spool/samba|g' \
${DESTDIR}/etc/samba/smb.conf
# nsswitch libraries
vinstall nsswitch/libnss_wins.so 755 usr/lib
ln -s libnss_wins.so ${DESTDIR}/usr/lib/libnss_wins.so.2
vinstall nsswitch/libnss_winbind.so 755 usr/lib
ln -s libnss_winbind.so ${DESTDIR}/usr/lib/libnss_winbind.so.2
# winbind krb5 locator
vinstall source3/bin/winbind_krb5_locator.so 755 \
usr/lib/krb5/plugins/libkrb5
# Remove unused manpages
rm -f ${DESTDIR}/usr/share/man/man8/tdb*
rm -f ${DESTDIR}/usr/share/man/man8/swat*
rm -f ${DESTDIR}/usr/lib/libtevent*
rm -f ${DESTDIR}/usr/include/samba/tevent*
# systemd units
if [ "$build_option_systemd" ]; then
for f in ${FILESDIR}/*.{service,socket}; do
vinstall ${f} 644 usr/lib/systemd/system
done
# systemd tmpfiles
vinstall ${FILESDIR}/samba.tmpfiles 644 usr/lib/tmpfiles.d samba.conf
fi
vsv nmbd
vsv smbd
# PAM support
vinstall ${FILESDIR}/samba.pam 644 etc/pam.d samba
# Install pkg-config files.
vmkdir usr/lib/pkgconfig
install -m644 source3/pkgconfig/*.pc ${DESTDIR}/usr/lib/pkgconfig
}
smbclient_package() {
short_desc="Command-line SMB/CIFS clients for Unix"
conf_files="/etc/samba/smb.conf"
pkg_install() {
vmove etc/samba/smb.conf
vmove usr/bin
vmove usr/share/man/man1
}
}
libsmbclient_package() {
short_desc="Shared libraries for communication with SMB/CIFS servers"
pkg_install() {
vmove "usr/lib/libwbclient.so.*"
vmove "usr/lib/libsmbclient.so.*"
vmove usr/share/man/man7/libsmbclient.7
}
}
samba-devel_package() {
depends="libsmbclient>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove usr/lib/libwbclient.so
vmove usr/lib/libsmbclient.so
}
}