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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Jan 8 13:31:17 2012 UTC (6 years, 9 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Restructure patching, #398139

(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20