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

Contents of /sys-fs/aufs3/aufs3-3_p20121015-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Mon Jan 14 08:55:06 2013 UTC (20 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
sys-fs/aufs3: Drop old and refactor patching procedure to reduce size of FILESDIR, #450800 and reliability, #368385 & #451970

(Portage version: 2.2.0_alpha151/cvs/Linux x86_64, signed Manifest commit with key 70EB7916)

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

  ViewVC Help
Powered by ViewVC 1.1.20