Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/aufs4/
Date: Tue, 23 Feb 2016 12:08:18
Message-Id: 1456229267.5e80f12f5b688a9a6a022cdc27d88e8af58670cd.jlec@gentoo
1 commit: 5e80f12f5b688a9a6a022cdc27d88e8af58670cd
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 23 09:29:10 2016 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 23 12:07:47 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e80f12f
7
8 sys-fs/aufs4: Bump to latest aufs release
9
10 Package-Manager: portage-2.2.27
11 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
12
13 sys-fs/aufs4/Manifest | 1 +
14 sys-fs/aufs4/aufs4-0_pre20160223.ebuild | 183 ++++++++++++++++++++++++++++++++
15 2 files changed, 184 insertions(+)
16
17 diff --git a/sys-fs/aufs4/Manifest b/sys-fs/aufs4/Manifest
18 index e8b933e..13c7471 100644
19 --- a/sys-fs/aufs4/Manifest
20 +++ b/sys-fs/aufs4/Manifest
21 @@ -1 +1,2 @@
22 DIST aufs4-standalone-0_pre20160219.tar.xz 1049884 SHA256 22d0f723ff52190670da0e3dc4a3f0b81ba0b3b6f287484cf81165c6cd4b2040 SHA512 95999199ac0d430a6ab2dbda75f34d9640179865d5be3b1db119c1e613f5bd167193dd7cf662ebcea9d81ad8008d9dbd8dd835d5a7a297456f8587364e7f16b1 WHIRLPOOL a8b7a9c80c7715d0f75c9ee15e78bfbef2db11d4d9fea6ac1e8163f86b735c57b7e6a5612ac269fbcc2c483537a06c1e7704b9c3db2c7dff09b08d228ba607a1
23 +DIST aufs4-standalone-0_pre20160223.tar.xz 1072092 SHA256 46c9e0bb68902fb92028a435fab9d31a6193407af8c29d8ce0cdefd2e841b723 SHA512 adafd18416a43af076292ea216db73f0569f25ce34d03ebde5aea049745c47979cc4778eef8f671d48a5f7d7ac5751f788d286f467a106c6660412e88442b18e WHIRLPOOL c41763b4abb78afb291a4fbe7e1010ffc6c82a62a9d8b8b0cd23ecff65ae8f6142265f7de9f4e5ee260e0f98ca04f08881778ad7035ecde6e0c910d8a38e3be7
24
25 diff --git a/sys-fs/aufs4/aufs4-0_pre20160223.ebuild b/sys-fs/aufs4/aufs4-0_pre20160223.ebuild
26 new file mode 100644
27 index 0000000..391d3e9
28 --- /dev/null
29 +++ b/sys-fs/aufs4/aufs4-0_pre20160223.ebuild
30 @@ -0,0 +1,183 @@
31 +# Copyright 1999-2016 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +# $Id$
34 +
35 +EAPI=6
36 +
37 +inherit eutils flag-o-matic linux-info linux-mod multilib readme.gentoo-r1 toolchain-funcs
38 +
39 +AUFS_VERSION="${PV%%_p*}"
40 +# highest branch version
41 +PATCH_MAX_VER=4
42 +# highest supported version
43 +KERN_MAX_VER=5
44 +# lowest supported version
45 +KERN_MIN_VER=0
46 +
47 +DESCRIPTION="An entirely re-designed and re-implemented Unionfs"
48 +HOMEPAGE="http://aufs.sourceforge.net/"
49 +SRC_URI="https://dev.gentoo.org/~jlec/distfiles/aufs4-standalone-${PV}.tar.xz"
50 +
51 +LICENSE="GPL-2"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~x86"
54 +IUSE="debug doc fuse hfs inotify kernel-patch nfs pax_kernel ramfs"
55 +
56 +DEPEND="
57 + dev-util/patchutils
58 + dev-vcs/git"
59 +RDEPEND="
60 + sys-fs/aufs-util
61 + !sys-fs/aufs
62 + !sys-fs/aufs2
63 + !sys-fs/aufs3"
64 +
65 +S="${WORKDIR}"/${PN}-standalone
66 +
67 +MODULE_NAMES="aufs(misc:${S})"
68 +
69 +pkg_setup() {
70 + CONFIG_CHECK+=" !AUFS_FS"
71 + use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
72 + use nfs && CONFIG_CHECK+=" EXPORTFS"
73 + use fuse && CONFIG_CHECK+=" ~FUSE_FS"
74 + use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
75 + use pax_kernel && CONFIG_CHECK+=" PAX" \
76 + && ERROR_PAX="Please use hardened sources"
77 +
78 + # this is needed so merging a binpkg ${PN} is
79 + # possible w/out a kernel unpacked on the system
80 + [[ -n "$PKG_SETUP_HAS_BEEN_RAN" ]] && return
81 +
82 + get_version
83 + kernel_is lt 4 ${KERN_MIN_VER} 0 && \
84 + die "the kernel version isn't supported by upstream anymore. Please upgrade."
85 + kernel_is gt 4 ${KERN_MAX_VER} 99 && die "kernel too new"
86 +
87 + linux-mod_pkg_setup
88 +
89 + if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
90 + PATCH_BRANCH="x-rcN"
91 + elif [[ "${KV_MINOR}" == "1" ]] && [[ "${KV_PATCH}" -ge "13" ]]; then
92 + PATCH_BRANCH="${KV_MINOR}".13+
93 + else
94 + PATCH_BRANCH="${KV_MINOR}"
95 + fi
96 +
97 + case ${KV_EXTRA} in
98 + "")
99 + elog "It seems you are using vanilla-sources with aufs4"
100 + elog "Please use sys-kernel/aufs-sources with USE=vanilla"
101 + elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
102 + ;;
103 + "-gentoo")
104 + elog "It seems you are using gentoo-sources with aufs4"
105 + elog "Please use sys-kernel/aufs-sources"
106 + elog "This will save you the nasty reemerge of sys-fs/aufs4 on every kernel upgrade"
107 + ;;
108 + esac
109 +
110 + pushd "${T}" &> /dev/null || die
111 + unpack ${A}
112 +
113 + cd ${PN}-standalone || die
114 +
115 + local module_branch=origin/${PN}.${PATCH_BRANCH}
116 +
117 + einfo "Using ${module_branch} as patch source"
118 + git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
119 +
120 + combinediff \
121 + ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
122 + combinediff \
123 + "${T}"/combined-1.patch ${PN}-mmap.patch \
124 + > ${PN}-standalone-base-mmap-combined.patch
125 +
126 + if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
127 + if use kernel-patch; then
128 + cd ${KV_DIR}
129 + ewarn "Patching your kernel..."
130 + patch \
131 + --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} \
132 + < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch \
133 + > /dev/null
134 + epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
135 + ewarn "You need to compile your kernel with the applied patch"
136 + ewarn "to be able to load and use the aufs kernel module"
137 + else
138 + eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
139 + eerror "Either enable the kernel-patch useflag to do it with this ebuild"
140 + eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
141 + die "missing kernel patch, please apply it first"
142 + fi
143 + fi
144 +
145 + popd &> /dev/null
146 + export PKG_SETUP_HAS_BEEN_RAN=1
147 +}
148 +
149 +set_config() {
150 + for option in $*; do
151 + grep -q "^CONFIG_AUFS_${option} =" config.mk || \
152 + die "${option} is not a valid config option"
153 + sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
154 + done
155 +}
156 +
157 +src_prepare() {
158 + local module_branch=origin/${PN}.${PATCH_BRANCH}
159 +
160 + einfo "Using for module creation branch ${module_branch}"
161 + git checkout -q -b local-gentoo ${module_branch} || die
162 +
163 + # All config options to off
164 + sed "s:= y:=:g" -i config.mk || die
165 +
166 + set_config RDU BRANCH_MAX_127 SBILIST
167 +
168 + use debug && set_config DEBUG
169 + use fuse && set_config BR_FUSE POLL
170 + use hfs && set_config BR_HFSPLUS
171 + use inotify && set_config HNOTIFY HFSNOTIFY
172 + use nfs && set_config EXPORT
173 + use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
174 + use ramfs && set_config BR_RAMFS
175 +
176 + use pax_kernel && epatch "${FILESDIR}"/pax-4.patch
177 +
178 + sed \
179 + -e "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" \
180 + -i Makefile || die
181 +}
182 +
183 +src_compile() {
184 + local ARCH=x86
185 +
186 + emake \
187 + CC=$(tc-getCC) \
188 + LD=$(tc-getLD) \
189 + LDFLAGS="$(raw-ldflags)" \
190 + ARCH=$(tc-arch-kernel) \
191 + CONFIG_AUFS_FS=m \
192 + KDIR="${KV_OUT_DIR}"
193 +}
194 +
195 +src_install() {
196 + linux-mod_src_install
197 +
198 + use doc && dodoc -r Documentation
199 +
200 + use kernel-patch || \
201 + doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
202 +
203 + dodoc \
204 + Documentation/filesystems/aufs/README \
205 + "${T}"/${PN}-standalone/{aufs4-loopback,vfs-ino,tmpfs-idr}.patch
206 +
207 + readme.gentoo_create_doc
208 +}
209 +
210 +pkg_postinst() {
211 + readme.gentoo_print_elog
212 + linux-mod_pkg_postinst
213 +}