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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sat Sep 13 13:35:03 2014 UTC (3 years, 8 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
sys-fs/aufs3: Bump to latest aufs3; drop old

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

1 # Copyright 1999-2014 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_p20140609.ebuild,v 1.2 2014/06/14 09:12:06 jlec Exp $
4
5 EAPI=5
6
7 inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo toolchain-funcs
8
9 AUFS_VERSION="${PV%%_p*}"
10 # highest branch version
11 PATCH_MAX_VER=14
12 # highest supported version
13 KERN_MAX_VER=15
14 # lowest supported version
15 KERN_MIN_VER=10
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+=" !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 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
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 elif [[ "${KV_MINOR}" == "10" ]] && [[ "${KV_PATCH}" -ge "28" ]]; then
58 PATCH_BRANCH="${KV_MINOR}".x
59 elif [[ "${KV_MINOR}" == "12" ]]; then
60 PATCH_BRANCH="${KV_MINOR}".x
61 else
62 PATCH_BRANCH="${KV_MINOR}"
63 fi
64
65 case ${KV_EXTRA} in
66 "")
67 elog "It seems you are using vanilla-sources with aufs3"
68 elog "Please use sys-kernel/aufs-sources with USE=vanilla"
69 elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
70 ;;
71 "-gentoo")
72 elog "It seems you are using gentoo-sources with aufs3"
73 elog "Please use sys-kernel/aufs-sources"
74 elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
75 ;;
76 esac
77
78 pushd "${T}" &> /dev/null
79 unpack ${A}
80 cd ${PN}-standalone || die
81 local module_branch=origin/${PN}.${PATCH_BRANCH}
82 einfo "Using ${module_branch} as patch source"
83 git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
84 combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
85 combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
86 if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
87 if use kernel-patch; then
88 cd ${KV_DIR}
89 ewarn "Patching your kernel..."
90 patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
91 epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
92 ewarn "You need to compile your kernel with the applied patch"
93 ewarn "to be able to load and use the aufs kernel module"
94 else
95 eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
96 eerror "Either enable the kernel-patch useflag to do it with this ebuild"
97 eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
98 die "missing kernel patch, please apply it first"
99 fi
100 fi
101 popd &> /dev/null
102 export PKG_SETUP_HAS_BEEN_RAN=1
103 }
104
105 set_config() {
106 for option in $*; do
107 grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
108 sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
109 done
110 }
111
112 src_prepare() {
113 local module_branch=origin/${PN}.${PATCH_BRANCH}
114
115 einfo "Using for module creation branch ${module_branch}"
116 git checkout -q -b local-gentoo ${module_branch} || die
117
118 # All config options to off
119 sed "s:= y:=:g" -i config.mk || die
120
121 set_config RDU BRANCH_MAX_127 SBILIST
122
123 use debug && set_config DEBUG
124 use fuse && set_config BR_FUSE POLL
125 use hfs && set_config BR_HFSPLUS
126 use inotify && set_config HNOTIFY HFSNOTIFY
127 use nfs && set_config EXPORT
128 use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
129 use ramfs && set_config BR_RAMFS
130
131 if use pax_kernel; then
132 if kernel_is ge 3 11; then
133 epatch "${FILESDIR}"/pax-3.11.patch
134 else
135 epatch "${FILESDIR}"/pax-3.patch
136 fi
137 fi
138
139 sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
140 }
141
142 src_compile() {
143 local ARCH=x86
144
145 emake \
146 CC=$(tc-getCC) \
147 LD=$(tc-getLD) \
148 LDFLAGS="$(raw-ldflags)" \
149 ARCH=$(tc-arch-kernel) \
150 CONFIG_AUFS_FS=m \
151 KDIR="${KV_OUT_DIR}"
152 }
153
154 src_install() {
155 linux-mod_src_install
156
157 insinto /usr/share/doc/${PF}
158
159 use doc && doins -r Documentation
160
161 use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
162
163 dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
164
165 readme.gentoo_create_doc
166 }
167
168 pkg_postinst() {
169 readme.gentoo_pkg_postinst
170 linux-mod_pkg_postinst
171 }

  ViewVC Help
Powered by ViewVC 1.1.20