Gentoo Archives: gentoo-commits

From: "Stefaan De Roeck (stefaan)" <stefaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-fs/openafs: openafs-1.4.8_pre2.ebuild
Date: Wed, 08 Oct 2008 21:59:05
Message-Id: E1Knh3e-0007bW-OI@stork.gentoo.org
1 stefaan 08/10/08 21:59:02
2
3 Added: openafs-1.4.8_pre2.ebuild
4 Log:
5 Version bump to 1.4.8_pre2
6 (Portage version: 2.2_rc11/cvs/Linux 2.6.26-gentoo x86_64)
7
8 Revision Changes Path
9 1.1 net-fs/openafs/openafs-1.4.8_pre2.ebuild
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-fs/openafs/openafs-1.4.8_pre2.ebuild?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-fs/openafs/openafs-1.4.8_pre2.ebuild?rev=1.1&content-type=text/plain
13
14 Index: openafs-1.4.8_pre2.ebuild
15 ===================================================================
16 # Copyright 1999-2008 Gentoo Foundation
17 # Distributed under the terms of the GNU General Public License v2
18 # $Header: /var/cvsroot/gentoo-x86/net-fs/openafs/openafs-1.4.8_pre2.ebuild,v 1.1 2008/10/08 21:59:02 stefaan Exp $
19
20 inherit flag-o-matic eutils toolchain-funcs versionator pam
21
22 PATCHVER=0.15
23 MY_PV=${PV/_pre/pre}
24 MY_P=${PN}-${MY_PV}
25 S=${WORKDIR}/${MY_P}
26 DESCRIPTION="The OpenAFS distributed file system"
27 HOMEPAGE="http://www.openafs.org/"
28 SRC_URI="http://openafs.org/dl/candidate/${MY_PV}/${MY_P}-src.tar.bz2
29 doc? ( http://openafs.org/dl/candidate/${MY_PV}/${MY_P}-doc.tar.bz2 )
30 mirror://gentoo/${PN}-gentoo-${PATCHVER}.tar.bz2"
31
32 LICENSE="IBM openafs-krb5 openafs-krb5-a APSL-2 sun-rpc"
33 SLOT="0"
34 KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
35 IUSE="debug kerberos pam doc"
36
37 RDEPEND="~net-fs/openafs-kernel-${PV}
38 pam? ( sys-libs/pam )
39 kerberos? ( virtual/krb5 )"
40
41 PATCHDIR=${WORKDIR}/gentoo/patches/$(get_version_component_range 1-2)
42 CONFDIR=${WORKDIR}/gentoo/configs
43 SCRIPTDIR=${WORKDIR}/gentoo/scripts
44
45 src_unpack() {
46 unpack ${A}; cd "${S}"
47
48 # Apply patches to apply chosen compiler settings, fix the hardcoded paths
49 # to be more FHS friendly, and the fix the incorrect typecasts for va_arg
50 EPATCH_SUFFIX="patch" epatch ${PATCHDIR}
51
52 # disable XCFLAGS override
53 sed -i 's/^[ \t]*XCFLAGS.*/:/' src/cf/osconf.m4
54 # disable compiler choice override
55 sed -i 's/^[ \t]\+\(CC\|CCOBJ\|MT_CC\)="[^ ]*\(.*\)"/\1="${CC}\2"/' src/cf/osconf.m4
56
57 # fix autoconf cludge (bug #218234)
58 sed -i 's/^AC_\(AIX\|MINIX\)$//' acinclude.m4
59
60 ./regen.sh || die "Failed: regenerating configure script"
61 }
62
63 src_compile() {
64 # cannot use "use_with" macro, as --without-krb5-config crashes the econf
65 local myconf=""
66 if use kerberos; then
67 myconf="--with-krb5-conf=$(type -p krb5-config)"
68 fi
69
70 # AFS_SYSKVERS: fix linux version at 2.6
71 AFS_SYSKVERS=26 \
72 XCFLAGS="${CFLAGS}" \
73 econf \
74 $(use_enable pam) \
75 $(use_enable debug) \
76 --enable-largefile-fileserver \
77 --enable-supergroups \
78 --disable-kernel-module \
79 ${myconf} || die econf
80
81 emake -j1 all_nolibafs || die "Build failed"
82 }
83
84 src_install() {
85 make DESTDIR="${D}" install_nolibafs || die "Installing failed"
86
87 # pam_afs and pam_afs.krb have been installed in irregular locations, fix
88 if use pam; then
89 dopammod "${D}"/usr/$(get_libdir)/pam_afs*
90 rm -f "${D}"/usr/$(get_libdir)/pam_afs*
91 fi
92
93 # compile_et collides with com_err. Remove it from this package.
94 rm "${D}"/usr/bin/compile_et
95
96 # avoid collision with mit_krb5's version of kpasswd
97 (cd "${D}"/usr/bin; mv kpasswd kpasswd_afs)
98 use doc && (cd "${D}"/usr/share/man/man1; mv kpasswd.1 kpasswd_afs.1)
99
100 # minimal documentation
101 dodoc ${CONFDIR}/README ${CONFDIR}/CellServDB
102
103 # documentation package
104 if use doc; then
105 use pam && doman src/pam/pam_afs.5
106
107 cp -pPR doc/* "${D}"/usr/share/doc/${PF}
108 fi
109
110 # Gentoo related scripts
111 newconfd ${CONFDIR}/openafs-client openafs-client
112 newconfd ${CONFDIR}/openafs-server openafs-server
113 newinitd ${SCRIPTDIR}/openafs-client openafs-client
114 newinitd ${SCRIPTDIR}/openafs-server openafs-server
115
116 # used directories: client
117 keepdir /etc/openafs
118 keepdir /var/cache/openafs
119
120 # used directories: server
121 keepdir /etc/openafs/server
122 diropts -m0700
123 keepdir /var/lib/openafs
124 keepdir /var/lib/openafs/db
125 diropts -m0755
126 keepdir /var/lib/openafs/logs
127
128 # link logfiles to /var/log
129 dosym ../lib/openafs/logs /var/log/openafs
130 }
131
132 pkg_preinst() {
133 ## Somewhat intelligently install default configuration files
134 ## (when they are not present)
135 # CellServDB
136 if [ ! -e "${ROOT}"etc/openafs/CellServDB ] \
137 || grep "GCO Public CellServDB" "${ROOT}"etc/openafs/CellServDB &> /dev/null
138 then
139 cp ${CONFDIR}/CellServDB "${D}"etc/openafs
140 fi
141 # cacheinfo: use a default location cache, 200 megabyte in size
142 # (should be safe for about any root partition, the user can increase
143 # the size as required)
144 if [ ! -e "${ROOT}"etc/openafs/cacheinfo ]; then
145 echo "/afs:/var/cache/openafs:200000" > "${D}"etc/openafs/cacheinfo
146 fi
147 # ThisCell: default to "openafs.org"
148 if [ ! -e "${ROOT}"etc/openafs/ThisCell ]; then
149 echo "openafs.org" > "${D}"etc/openafs/ThisCell
150 fi
151 }
152
153 pkg_postinst() {
154 elog
155 elog "This installation should work out of the box (at least the"
156 elog "client part doing global afs-cell browsing, unless you had"
157 elog "a previous and different configuration). If you want to"
158 elog "set up your own cell or modify the standard config,"
159 elog "please have a look at the Gentoo OpenAFS documentation"
160 elog "(warning: it is not yet up to date wrt the new file locations)"
161 elog
162 elog "The documentation can be found at:"
163 elog " http://www.gentoo.org/doc/en/openafs.xml"
164 }