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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Oct 13 15:18:51 2013 UTC (5 years, 2 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
sys-fs/aufs3: Drop old versions and add notification to aufs-sources

(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

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

  ViewVC Help
Powered by ViewVC 1.1.20