Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2016 Gentoo Foundation |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Id$ |
4 |
|
5 |
EAPI=6 |
6 |
inherit autotools eutils multilib-minimal toolchain-funcs |
7 |
|
8 |
DESCRIPTION="BSD tar command" |
9 |
HOMEPAGE="http://www.libarchive.org/" |
10 |
SRC_URI="http://www.libarchive.org/downloads/${P}.tar.gz" |
11 |
|
12 |
LICENSE="BSD BSD-2 BSD-4 public-domain" |
13 |
SLOT="0/13" |
14 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
15 |
IUSE="acl +bzip2 +e2fsprogs expat +iconv kernel_linux libressl lz4 +lzma lzo nettle static-libs xattr +zlib" |
16 |
|
17 |
RDEPEND=" |
18 |
acl? ( virtual/acl[${MULTILIB_USEDEP}] ) |
19 |
bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] ) |
20 |
expat? ( dev-libs/expat[${MULTILIB_USEDEP}] ) |
21 |
!expat? ( dev-libs/libxml2[${MULTILIB_USEDEP}] ) |
22 |
iconv? ( virtual/libiconv[${MULTILIB_USEDEP}] ) |
23 |
kernel_linux? ( |
24 |
xattr? ( sys-apps/attr[${MULTILIB_USEDEP}] ) |
25 |
) |
26 |
!libressl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] ) |
27 |
libressl? ( dev-libs/libressl:0=[${MULTILIB_USEDEP}] ) |
28 |
lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] ) |
29 |
lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] ) |
30 |
lzo? ( >=dev-libs/lzo-2[${MULTILIB_USEDEP}] ) |
31 |
nettle? ( dev-libs/nettle:0=[${MULTILIB_USEDEP}] ) |
32 |
zlib? ( sys-libs/zlib[${MULTILIB_USEDEP}] )" |
33 |
DEPEND="${RDEPEND} |
34 |
kernel_linux? ( |
35 |
virtual/os-headers |
36 |
e2fsprogs? ( sys-fs/e2fsprogs ) |
37 |
)" |
38 |
|
39 |
PATCHES=( |
40 |
"${FILESDIR}/${P}-fix-tests-gnu99.patch" |
41 |
"${FILESDIR}/${P}-osx-fix-acl.patch" #587890 |
42 |
) |
43 |
|
44 |
src_prepare() { |
45 |
default |
46 |
eautoreconf |
47 |
} |
48 |
|
49 |
multilib_src_configure() { |
50 |
export ac_cv_header_ext2fs_ext2_fs_h=$(usex e2fsprogs) #354923 |
51 |
|
52 |
local myconf=() |
53 |
myconf=( |
54 |
$(use_enable acl) |
55 |
$(use_enable static-libs static) |
56 |
$(use_enable xattr) |
57 |
$(use_with bzip2 bz2lib) |
58 |
$(use_with expat) |
59 |
$(use_with !expat xml2) |
60 |
$(use_with iconv) |
61 |
$(use_with lz4) |
62 |
$(use_with lzma) |
63 |
$(use_with lzo lzo2) |
64 |
$(use_with nettle) |
65 |
$(use_with zlib) |
66 |
) |
67 |
if multilib_is_native_abi ; then myconf+=( |
68 |
--enable-bsdcat=$(tc-is-static-only && echo static || echo shared) |
69 |
--enable-bsdcpio=$(tc-is-static-only && echo static || echo shared) |
70 |
--enable-bsdtar=$(tc-is-static-only && echo static || echo shared) |
71 |
); else myconf+=( |
72 |
--disable-bsdcat |
73 |
--disable-bsdcpio |
74 |
--disable-bsdtar |
75 |
); fi |
76 |
|
77 |
# We disable lzmadec because we support the newer liblzma from xz-utils |
78 |
# and not liblzmadec with this version. |
79 |
myconf+=( |
80 |
--without-lzmadec |
81 |
) |
82 |
|
83 |
ECONF_SOURCE="${S}" econf "${myconf[@]}" |
84 |
} |
85 |
|
86 |
multilib_src_compile() { |
87 |
if multilib_is_native_abi ; then |
88 |
emake |
89 |
else |
90 |
emake libarchive.la |
91 |
fi |
92 |
} |
93 |
|
94 |
multilib_src_test() { |
95 |
# Replace the default src_test so that it builds tests in parallel |
96 |
multilib_is_native_abi && emake check |
97 |
} |
98 |
|
99 |
multilib_src_install() { |
100 |
if multilib_is_native_abi ; then |
101 |
emake DESTDIR="${D}" install |
102 |
|
103 |
# Create symlinks for FreeBSD |
104 |
if ! use prefix && [[ ${CHOST} == *-freebsd* ]]; then |
105 |
for bin in cat cpio tar; do |
106 |
dosym bsd${bin} /usr/bin/${bin} |
107 |
echo '.so bsd${bin}.1' > "${T}"/${bin}.1 |
108 |
doman "${T}"/${bin}.1 |
109 |
done |
110 |
fi |
111 |
else |
112 |
emake DESTDIR="${D}" \ |
113 |
install-includeHEADERS \ |
114 |
install-libLTLIBRARIES \ |
115 |
install-pkgconfigDATA |
116 |
fi |
117 |
|
118 |
# Libs.private: should be used from libarchive.pc instead |
119 |
prune_libtool_files |
120 |
} |
121 |
|
122 |
multilib_src_install_all() { |
123 |
cd "${S}" || die |
124 |
einstalldocs |
125 |
} |