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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20