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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Apr 20 07:07:16 2015 UTC (3 years, 7 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Drop old; block new version

(Portage version: 2.2.18/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_p20141208.ebuild,v 1.1 2014/12/08 07:43:39 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=17
12 # highest supported version
13 KERN_MAX_VER=18
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 README_GENTOO_SUFFIX="-r1"
39
40 pkg_setup() {
41 CONFIG_CHECK+=" !AUFS_FS"
42 use inotify && CONFIG_CHECK+=" ~FSNOTIFY"
43 use nfs && CONFIG_CHECK+=" EXPORTFS"
44 use fuse && CONFIG_CHECK+=" ~FUSE_FS"
45 use hfs && CONFIG_CHECK+=" ~HFSPLUS_FS"
46 use pax_kernel && CONFIG_CHECK+=" PAX" && ERROR_PAX="Please use hardened sources"
47
48 # this is needed so merging a binpkg ${PN} is possible w/out a kernel unpacked on the system
49 [ -n "$PKG_SETUP_HAS_BEEN_RAN" ] && return
50
51 get_version
52 kernel_is lt 3 ${KERN_MIN_VER} 0 && die "the kernel version isn't supported by upstream anymore. Please upgrade."
53 kernel_is gt 3 ${KERN_MAX_VER} 99 && die "kernel too new"
54
55 linux-mod_pkg_setup
56
57 if [[ "${KV_MINOR}" -gt "${PATCH_MAX_VER}" ]]; then
58 PATCH_BRANCH="x-rcN"
59 elif [[ "${KV_MINOR}" == "10" ]] && [[ "${KV_PATCH}" -ge "28" ]]; then
60 PATCH_BRANCH="${KV_MINOR}".x
61 elif [[ "${KV_MINOR}" == "12" ]]; then
62 PATCH_BRANCH="${KV_MINOR}".x
63 elif [[ "${KV_MINOR}" == "12" ]] && [[ "${KV_PATCH}" -ge "31" ]]; then
64 PATCH_BRANCH="${KV_MINOR}".31+
65 elif [[ "${KV_MINOR}" == "14" ]] && [[ "${KV_PATCH}" -ge "21" ]]; then
66 PATCH_BRANCH="${KV_MINOR}".12+
67 else
68 PATCH_BRANCH="${KV_MINOR}"
69 fi
70
71 case ${KV_EXTRA} in
72 "")
73 elog "It seems you are using vanilla-sources with aufs3"
74 elog "Please use sys-kernel/aufs-sources with USE=vanilla"
75 elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
76 ;;
77 "-gentoo")
78 elog "It seems you are using gentoo-sources with aufs3"
79 elog "Please use sys-kernel/aufs-sources"
80 elog "This will save you the nasty reemerge of sys-fs/aufs3 on every kernel upgrade"
81 ;;
82 esac
83
84 pushd "${T}" &> /dev/null
85 unpack ${A}
86 cd ${PN}-standalone || die
87 local module_branch=origin/${PN}.${PATCH_BRANCH}
88 einfo "Using ${module_branch} as patch source"
89 git checkout -q -b local-${PN}.${PATCH_BRANCH} ${module_branch} || die
90 combinediff ${PN}-base.patch ${PN}-standalone.patch > "${T}"/combined-1.patch
91 combinediff "${T}"/combined-1.patch ${PN}-mmap.patch > ${PN}-standalone-base-mmap-combined.patch
92 if ! ( patch -p1 --dry-run --force -R -d ${KV_DIR} < ${PN}-standalone-base-mmap-combined.patch > /dev/null ); then
93 if use kernel-patch; then
94 cd ${KV_DIR}
95 ewarn "Patching your kernel..."
96 patch --no-backup-if-mismatch --force -p1 -R -d ${KV_DIR} < "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch >/dev/null
97 epatch "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
98 ewarn "You need to compile your kernel with the applied patch"
99 ewarn "to be able to load and use the aufs kernel module"
100 else
101 eerror "You need to apply a patch to your kernel to compile and run the ${PN} module"
102 eerror "Either enable the kernel-patch useflag to do it with this ebuild"
103 eerror "or apply "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch by hand"
104 die "missing kernel patch, please apply it first"
105 fi
106 fi
107 popd &> /dev/null
108 export PKG_SETUP_HAS_BEEN_RAN=1
109 }
110
111 set_config() {
112 for option in $*; do
113 grep -q "^CONFIG_AUFS_${option} =" config.mk || die "${option} is not a valid config option"
114 sed "/^CONFIG_AUFS_${option}/s:=:= y:g" -i config.mk || die
115 done
116 }
117
118 src_prepare() {
119 local module_branch=origin/${PN}.${PATCH_BRANCH}
120
121 einfo "Using for module creation branch ${module_branch}"
122 git checkout -q -b local-gentoo ${module_branch} || die
123
124 # All config options to off
125 sed "s:= y:=:g" -i config.mk || die
126
127 set_config RDU BRANCH_MAX_127 SBILIST
128
129 use debug && set_config DEBUG
130 use fuse && set_config BR_FUSE POLL
131 use hfs && set_config BR_HFSPLUS
132 use inotify && set_config HNOTIFY HFSNOTIFY
133 use nfs && set_config EXPORT
134 use nfs && ( use amd64 || use ppc64 ) && set_config INO_T_64
135 use ramfs && set_config BR_RAMFS
136
137 if use pax_kernel; then
138 if kernel_is ge 3 11; then
139 epatch "${FILESDIR}"/pax-3.11.patch
140 else
141 epatch "${FILESDIR}"/pax-3.patch
142 fi
143 fi
144
145 sed -i "s:aufs.ko usr/include/linux/aufs_type.h:aufs.ko:g" Makefile || die
146 }
147
148 src_compile() {
149 local ARCH=x86
150
151 emake \
152 CC=$(tc-getCC) \
153 LD=$(tc-getLD) \
154 LDFLAGS="$(raw-ldflags)" \
155 ARCH=$(tc-arch-kernel) \
156 CONFIG_AUFS_FS=m \
157 KDIR="${KV_OUT_DIR}"
158 }
159
160 src_install() {
161 linux-mod_src_install
162
163 insinto /usr/share/doc/${PF}
164
165 use doc && doins -r Documentation
166
167 use kernel-patch || doins "${T}"/${PN}-standalone/${PN}-standalone-base-mmap-combined.patch
168
169 dodoc Documentation/filesystems/aufs/README "${T}"/${PN}-standalone/{aufs3-loopback,vfs-ino,tmpfs-idr}.patch
170
171 readme.gentoo_create_doc
172 }
173
174 pkg_postinst() {
175 readme.gentoo_pkg_postinst
176 linux-mod_pkg_postinst
177 }

  ViewVC Help
Powered by ViewVC 1.1.20