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

Contents of /sys-fs/aufs3/aufs3-3_p20120813-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Thu Oct 18 20:31:21 2012 UTC (22 months ago) by jlec
Branch: MAIN
Changes since 1.3: +2 -2 lines
sys-fs/aufs3: Change las KV_DIR to KV_OUT_DIR

(Portage version: 2.2.0_alpha141/cvs/Linux x86_64, signed Manifest commit with key 70EB7916)

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

  ViewVC Help
Powered by ViewVC 1.1.20