comparison net-fs/samba/samba-3.3.1.ebuild @ 104:97770c47a699

bump samba to 3.3.1
author holger@hoho.dyndns.org
date Tue, 24 Feb 2009 17:57:37 +0100
parents net-fs/samba/samba-3.3.0.ebuild@8b40b47c23e5
children ef3299334bd6
comparison
equal deleted inserted replaced
103:17d134ab73d6 104:97770c47a699
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.2.0_rc2.ebuild,v 1.1 2008/06/12 12:10:25 dev-zero Exp $
4
5 inherit eutils pam multilib versionator confutils
6
7 MY_P=${PN}-${PV/_/}
8
9 DESCRIPTION="A suite of SMB and CIFS client/server programs for UNIX"
10 HOMEPAGE="http://www.samba.org/"
11 SRC_URI="mirror://samba/${MY_P}.tar.gz"
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 IUSE_LINGUAS="linguas_ja linguas_pl"
16 IUSE="${IUSE_LINGUAS} acl ads async automount caps cups doc examples ipv6 kernel_linux ldap fam
17 pam quotas readline selinux swat syslog winbind"
18
19 RDEPEND="dev-libs/popt
20 dev-libs/iniparser
21 virtual/libiconv
22 acl? ( kernel_linux? ( sys-apps/acl ) )
23 cups? ( net-print/cups )
24 ipv6? ( sys-apps/xinetd )
25 ads? ( virtual/krb5 sys-fs/e2fsprogs )
26 ldap? ( net-nds/openldap )
27 pam? ( virtual/pam )
28 readline? ( sys-libs/readline )
29 selinux? ( sec-policy/selinux-samba )
30 swat? ( sys-apps/xinetd )
31 syslog? ( virtual/logger )
32 fam? ( virtual/fam )
33 caps? ( sys-libs/libcap )"
34 DEPEND="${RDEPEND}"
35
36 S="${WORKDIR}/${MY_P}"
37 CONFDIR="${FILESDIR}/config-3.3"
38 PRIVATE_DST=/var/lib/samba/private
39
40 # Tests are currently broken due to hardcoded paths (due to --with-fhs)
41 # The problem is that --without-fhs lets samba use lockdir (which can be changed in smb.conf)
42 # which is wrong as well.
43 RESTRICT="test"
44
45 pkg_setup() {
46 confutils_use_depend_all ads ldap
47 }
48
49 src_unpack() {
50 unpack ${A}
51 cd "${S}/source"
52
53 # Ok, agreed, this is ugly. But it avoids a patch we
54 # need for every samba version and we don't need autotools
55 sed -i \
56 -e 's|"lib32" ||' \
57 -e 's|if test -d "$i/$l" ;|if test -d "$i/$l" -o -L "$i/$l";|' \
58 configure || die "sed failed"
59
60 rm "${S}/docs/manpages"/{mount,umount}.cifs.8
61
62 sed -i \
63 -e 's|tdbsam|tdbsam:${PRIVATEDIR}/passdb.tdb|' \
64 "${S}/source/script/tests/selftest.sh" || die "sed failed"
65 }
66
67 src_compile() {
68 cd "${S}/source"
69
70 local myconf
71 local mylangs
72 local mymod_shared
73
74 mylangs="--with-manpages-langs=en"
75 use linguas_ja && mylangs="${mylangs},ja"
76 use linguas_pl && mylangs="${mylangs},pl"
77
78 use winbind && mymod_shared="--with-shared-modules=idmap_rid"
79 if use ldap ; then
80 myconf="${myconf} $(use_with ads)"
81 use winbind && mymod_shared="${mymod_shared},idmap_ad"
82 fi
83
84 [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie"
85 use hppa && myconf="${myconf} --disable-pie"
86
87 use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
88
89 # Otherwise we get the whole swat stuff installed
90 if ! use swat ; then
91 sed -i \
92 -e 's/^\(install:.*\)installswat \(.*\)/\1\2/' \
93 Makefile.in || die "sed failed"
94 fi
95
96 econf \
97 --with-fhs \
98 --sysconfdir=/etc/samba \
99 --localstatedir=/var \
100 --with-configdir=/etc/samba \
101 --with-libdir=/usr/$(get_libdir)/samba \
102 --with-pammodulesdir=$(getpam_mod_dir) \
103 --with-swatdir=/usr/share/doc/${PF}/swat \
104 --with-piddir=/var/run/samba \
105 --with-lockdir=/var/cache/samba \
106 --with-logfilebase=/var/log/samba \
107 --with-privatedir=${PRIVATE_DST} \
108 --with-libsmbclient \
109 --without-spinlocks \
110 --enable-socket-wrapper \
111 --enable-nss-wrapper \
112 --with-cifsmount=no \
113 $(use_with acl acl-support) \
114 $(use_with async aio-support) \
115 $(use_with automount) \
116 $(use_enable cups) \
117 $(use_enable fam) \
118 $(use_with ads krb5) \
119 $(use_with ads dnsupdate) \
120 $(use_with ldap) \
121 $(use_with pam) $(use_with pam pam_smbpass) \
122 $(use_with quotas) $(use_with quotas sys-quotas) \
123 $(use_with readline) \
124 $(use_with syslog) \
125 $(use_with winbind) \
126 ${myconf} ${mylangs} ${mymod_shared} || die "econf failed"
127
128 emake proto || die "emake proto failed"
129 emake everything || die "emake everything failed"
130
131 }
132
133 src_test() {
134 cd "${S}/source"
135 emake test || die "tests failed"
136 }
137
138 src_install() {
139 cd "${S}/source"
140
141 emake DESTDIR="${D}" install-everything || die "emake install-everything failed"
142
143 # Extra rpctorture progs
144 local extra_bins="rpctorture"
145 for i in ${extra_bins} ; do
146 [[ -x "${S}/bin/${i}" ]] && dobin "${S}/bin/${i}"
147 done
148
149 # remove .old stuff from /usr/bin:
150 rm -f "${D}"/usr/bin/*.old
151
152 # Removing executable bits from header-files
153 fperms 644 /usr/include/libsmbclient.h
154
155 # Nsswitch extensions. Make link for wins and winbind resolvers
156 if use winbind ; then
157 dolib.so nsswitch/libnss_wins.so
158 dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
159 dolib.so nsswitch/libnss_winbind.so
160 dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
161 fi
162
163 # make the smb backend symlink for cups printing support (bug #133133)
164 if use cups ; then
165 dodir $(cups-config --serverbin)/backend
166 dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
167 fi
168
169 cd "${S}/source"
170
171 # General config files
172 insinto /etc/samba
173 doins "${CONFDIR}"/{smbusers,lmhosts}
174 newins "${CONFDIR}/smb.conf.example-samba3" smb.conf.example
175
176 newpamd "${CONFDIR}/samba.pam" samba
177 use winbind && dopamd "${CONFDIR}/system-auth-winbind"
178 if use swat ; then
179 insinto /etc/xinetd.d
180 newins "${CONFDIR}/swat.xinetd" swat
181 else
182 rm -f "${D}/usr/sbin/swat"
183 rm -f "${D}/usr/share/man/man8/swat.8"
184 fi
185
186 newinitd "${FILESDIR}/samba-init" samba
187 newconfd "${FILESDIR}/samba-conf" samba
188
189 if use ldap ; then
190 insinto /etc/openldap/schema
191 doins "${S}/examples/LDAP/samba.schema"
192 fi
193
194 if use ipv6 ; then
195 insinto /etc/xinetd.d
196 newins "${FILESDIR}/samba-xinetd" smb
197 fi
198
199 # dirs
200 diropts -m0700 ; keepdir "${PRIVATE_DST}"
201 diropts -m1777 ; keepdir /var/spool/samba
202
203 diropts -m0755
204 keepdir /var/{log,run,cache}/samba
205 keepdir /var/lib/samba/{netlogon,profiles}
206 keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
207 keepdir /usr/$(get_libdir)/samba/{rpc,idmap,auth}
208
209 # docs
210 dodoc "${FILESDIR}/README.gentoo"
211 dodoc "${S}"/{MAINTAINERS,README,Roadmap,WHATSNEW.txt}
212 dodoc "${CONFDIR}/nsswitch.conf-wins"
213 use winbind && dodoc "${CONFDIR}/nsswitch.conf-winbind"
214
215 if use examples ; then
216 insinto /usr/share/doc/${PF}
217 doins -r "${S}/examples/"
218 find "${D}/usr/share/doc/${PF}" -type d -print0 | xargs -0 chmod 755
219 find "${D}/usr/share/doc/${PF}/examples" ! -type d -print0 | xargs -0 chmod 644
220 fi
221
222 if ! use doc ; then
223 if ! use swat ; then
224 rm -rf "${D}/usr/share/doc/${PF}/swat"
225 else
226 rm -rf "${D}/usr/share/doc/${PF}/swat/help"/{guide,howto,devel}
227 rm -rf "${D}/usr/share/doc/${PF}/swat/using_samba"
228 fi
229 fi
230
231 }
232
233 pkg_preinst() {
234 local PRIVATE_SRC=/etc/samba/private
235 if [[ ! -r "${ROOT}/${PRIVATE_DST}/secrets.tdb" \
236 && -r "${ROOT}/${PRIVATE_SRC}/secrets.tdb" ]] ; then
237 ebegin "Copying ${ROOT}/${PRIVATE_SRC}/* to ${ROOT}/${PRIVATE_DST}/"
238 mkdir -p "${D}/${PRIVATE_DST}"
239 cp -pPRf "${ROOT}/${PRIVATE_SRC}"/* "${D}/${PRIVATE_DST}/"
240 eend $?
241 fi
242
243 if [[ ! -f "${ROOT}/etc/samba/smb.conf" ]] ; then
244 touch "${D}/etc/samba/smb.conf"
245 fi
246 }
247
248 pkg_postinst() {
249 if use swat ; then
250 einfo "swat must be enabled by xinetd:"
251 einfo " change the /etc/xinetd.d/swat configuration"
252 fi
253
254 if use ipv6 ; then
255 einfo "ipv6 support must be enabled by xinetd:"
256 einfo " change the /etc/xinetd.d/smb configuration"
257 fi
258
259 elog "It is possible to start/stop daemons separately:"
260 elog " Create a symlink from /etc/init.d/samba.{smbd,nmbd,winbind} to"
261 elog " /etc/init.d/samba. Calling /etc/init.d/samba directly will start"
262 elog " the daemons configured in /etc/conf.d/samba"
263
264 elog "The mount/umount.cifs helper applications are not included anymore."
265 elog "Please install net-fs/mount-cifs instead."
266
267 ewarn "If you're upgrading from 3.0.24 or earlier, please make sure to"
268 ewarn "restart your clients to clear any cached information about the server."
269 ewarn "Otherwise they might not be able to connect to the volumes."
270 }