diff --git a/README.md b/README.md index 85f208c..40f3f49 100644 --- a/README.md +++ b/README.md @@ -330,10 +330,21 @@ Bees can be installed by following one these instructions: Arch package ------------ -Bees is availabe Arch Linux AUR. Install with: +Bees is availabe in Arch Linux AUR. Install with: `$ pacaur -S bees-git` +Gentoo ebuild +------------- + +Bees is available as a Gentoo ebuild. Just copy `bees-9999.ebuild` from +`contrib/gentoo` including the `files` subdirectory to your local +overlay category `sys-fs`. + +You can copy the ebuild to match a Bees version number, and it will +build that tagged version. It is partly supported since v0.5, +previous versions won't work. + Build from source ----------------- diff --git a/contrib/gentoo/bees-9999.ebuild b/contrib/gentoo/bees-9999.ebuild new file mode 100644 index 0000000..d39b895 --- /dev/null +++ b/contrib/gentoo/bees-9999.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit git-r3 eutils multilib + +DESCRIPTION="Best-Effort Extent-Same, a btrfs dedup agent" +HOMEPAGE="https://github.com/Zygo/bees" + +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://github.com/kakra/bees.git" + EGIT_BRANCH="integration" +else + IUSE="" + + SRC_URI="https://github.com/Zygo/bees/archive/v${PV}.tar.gz -> bees-${PV}.tar.gz" +fi + +PATCHES=" + ${FILESDIR}/v0.5-gentoo_build.patch +" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="" +IUSE="" + +DEPEND=" + >=sys-apps/util-linux-2.30.2 + >=sys-devel/gcc-4.9 + >=sys-fs/btrfs-progs-4.1 +" +RDEPEND="${DEPEND}" + +DOCS="README.md COPYING" +HTML_DOCS="README.html" + +src_prepare() { + default + echo LIBDIR=$(get_libdir) >>${S}/localconf +} diff --git a/contrib/gentoo/files/v0.5-gentoo_build.patch b/contrib/gentoo/files/v0.5-gentoo_build.patch new file mode 100644 index 0000000..9f22cbc --- /dev/null +++ b/contrib/gentoo/files/v0.5-gentoo_build.patch @@ -0,0 +1,20 @@ +diff --git a/localconf b/localconf +new file mode 100644 +index 0000000..7705cbb +--- /dev/null ++++ b/localconf +@@ -0,0 +1,2 @@ ++PREFIX=/ ++LIBEXEC_PREFIX=/usr/libexec +diff --git a/makeflags b/makeflags +index f5983cb..0348623 100644 +--- a/makeflags ++++ b/makeflags +@@ -1,4 +1,3 @@ +-CCFLAGS = -Wall -Wextra -Werror -O3 -march=native -I../include -ggdb -D_FILE_OFFSET_BITS=64 +-# CCFLAGS = -Wall -Wextra -Werror -O0 -I../include -ggdb -fpic -D_FILE_OFFSET_BITS=64 +-CFLAGS = $(CCFLAGS) -std=c99 +-CXXFLAGS = $(CCFLAGS) -std=c++11 -Wold-style-cast ++CCFLAGS = -O3 -I../include -fpic -D_FILE_OFFSET_BITS=64 ++CFLAGS += $(CCFLAGS) -std=c99 ++CXXFLAGS += $(CCFLAGS) -std=c++11 -Wold-style-cast