/[gentoo-x86]/sys-fs/aufs3/aufs3-3_p20130318.ebuild
Gentoo

Contents of /sys-fs/aufs3/aufs3-3_p20130318.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat May 25 12:36:43 2013 UTC (5 years, 5 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
sys-fs/aufs3: Drop old, reintroduce the CONFIG_EXPERIMENTAL check conditionally

(Portage version: 2.2.0_alpha177/cvs/Linux x86_64, signed Manifest commit with key 8009D6F070EB7916)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-fs/aufs3/aufs3-3_p20130318.ebuild,v 1.2 2013/03/21 08:39:21 jlec Exp $
4
5 EAPI=5
6
7 inherit eutils flag-o-matic linux-info linux-mod multilib toolchain-funcs
8
9 AUFS_VERSION="${PV%%_p*}"
10 # highest branch version
11 PATCH_MAX_VER=8
12 # highest supported version
13 KERN_MAX_VER=9
14 # highest util branch version
15 UTIL_MAX_VER=0
16
17 DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
18 HOMEPAGE="http://aufs.sourceforge.net/"
19 SRC_URI="http://dev.gentoo.org/~jlec/distfiles/aufs3-standalone-${PV}.tar.xz"
20
21 LICENSE="GPL-2"
22 SLOT="0"
23 KEYWORDS="~amd64 ~x86"
24 IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
25
26 DEPEND="
27 dev-util/patchutils
28 dev-vcs/git"
29 RDEPEND="
30 sys-fs/aufs-util
31 !sys-fs/aufs
32 !sys-fs/aufs2"
33
34 S="${WORKDIR}"/${PN}-standalone
35
36 MODULE_NAMES="aufs(misc:${S})"
37
38 pkg_setup() {
39 CONFIG_CHECK+=" ~EXPERIMENTAL !AUFS_FS"
40 use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
41 use nfs && CONFIG_CHECK+=" EXPORTFS"
42 use fuse && CONFIG_CHECK+=" ~FUSE_FS"
43 use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
44 use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
45
46 # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
47 [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
48
49 get_version
50 kernel_is lt 3 0 0 && die "kernel too old, Please use sys-fs/aufs2"
51 kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
52
53 linux-mod_pkg_setup
54
55 if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
56 PATCH_BRANCH="x-rcN"
57 else
58 PATCH_BRANCH="${KV_MINOR}"
59 fi
60
61 if [[ "${PATCH_BRANCH}" == "x-rcN" ]]; then
62 UTIL_BRANCH="x-rcN"
63 elif [[ "${KV_MINOR}" -gt "${UTIL_MAX_VER}" ]]; then
64 UTIL_BRANCH="${UTIL_MAX_VER}"
65 else
66 UTIL_BRANCH="${KV_MINOR}"
67 fi
68
69 pushd "${T}" &> /dev/null
70 unpack ${A}
71 cd ${PN}-standalone || die
72 local module_branch=origin/${PN}.${PATCH_BRANCH}
73 git checkout -q -b local-gentoo ${module_branch} || die
74 combinediff ${PN}-base.patch ${PN}-standalone.patch > ${PN}-standalone-base-combined.patch
75 if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-combined.patch > /dev/null ); then
76 if use kernel-patch; then
77 cd ${KV_DIR}
78 ewarn "Patching your kernel..."
79 patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-combined.patch >/dev/null
80 epatch "${T}"/${PN}-standalone/${PN}-standalone-base-combined.patch
81 ewarn "You need to compile your kernel with the applied patch"
82 ewarn "to be able to load and use the aufs kernel module"
83 else
84 eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
85 eerror "Either enable the kernel-patch useflag to do it with this ebuild"
86 eerror "or apply ${EPRFIX}/usr/share/doc/${PF}/${PN}-standalone-base-combined.patch by hand"
87 die "missing kernel patch, please apply it first"
88 fi
89 fi
90 popd &> /dev/null
91 export PKG_SETUP_HAS_BEEN_RAN=1
92 }
93
94 set_config() {
95 for option in $*; do
96 grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
97 sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
98 done
99 }
100
101 src_prepare() {
102 local module_branch=origin/${PN}.${PATCH_BRANCH}
103 local util_branch=origin/${PN}.${UTIL_BRANCH}
104
105 einfo "Using for module creation branch ${module_branch}"
106 git checkout -q -b local-gentoo ${module_branch} || die
107
108 # All config options to off
109 sed "s:= y:=:g" -i config.mk || die
110
111 set_config RDU BRANCH_MAX_127 SBILIST
112
113 use debug && set_config DEBUG
114 use fuse && set_config BR_FUSE POLL
115 use hfs && set_config BR_HFSPLUS
116 use inotify && set_config HNOTIFY HFSNOTIFY
117 use nfs && set_config EXPORT
118 use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
119 use ramfs && set_config BR_RAMFS
120
121 use pax_kernel && epatch "${FILESDIR}"/pax-2.patch
122
123 sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
124 }
125
126 src_compile() {
127 local ARCH=x86
128
129 emake \
130 CC=$(tc-getCC) \
131 LD=$(tc-getLD) \
132 LDFLAGS="$(raw-ldflags)" \
133 ARCH=$(tc-arch-kernel) \
134 CONFIG_AUFS_FS=m \
135 KDIR="${KV_OUT_DIR}"
136 }
137
138 src_install() {
139 linux-mod_src_install
140
141 insinto /usr/share/doc/${PF}
142
143 use doc && doins -r Documentation
144
145 use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-combined.patch
146
147 dodoc Documentation/filesystems/aufs/README
148 }

  ViewVC Help
Powered by ViewVC 1.1.20