1 |
Robert Buchholz schrieb: |
2 |
> On Monday 30 March 2009, Thomas Sachau wrote: |
3 |
>> Ciaran McCreesh schrieb: |
4 |
>>> So far, we've got this, by agreement of the Council: |
5 |
>>> |
6 |
>>> * There will be a default src_install in EAPI 3 |
7 |
>>> * It will have a DOCS variable, or something along those lines. |
8 |
>>> |
9 |
>>> I'd like to suggest the following too: |
10 |
>>> |
11 |
>>> * If DOCS is explicitly specified, it is an error if anything in it |
12 |
>>> doesn't exist. |
13 |
>>> * If DOCS isn't explicitly specified, it isn't an error if anything |
14 |
>>> in its default, if it has one, doesn't exist. |
15 |
>>> |
16 |
>>> We don't have an implementation yet. So I'll start off with this: |
17 |
>>> |
18 |
>>> default_src_install() { |
19 |
>>> emake -j1 DESTDIR="${D}" install |
20 |
>> Why do you want to force -j1 here? |
21 |
>> |
22 |
>> And i had this proposal some months ago, which noone argued against |
23 |
>> any more (the default list may of course be extended): |
24 |
> ... |
25 |
> |
26 |
> What Ciaran added was a way to disable installation of default DOCS. The |
27 |
> implmenetation we discussed on the thread a while ago does not check |
28 |
> whether DOCS is declared but empty. |
29 |
> I believe the way the DOCS variable is handled in the first example of |
30 |
> the thread starter is good for a default_src_install although I don't |
31 |
> know if we really need arrays. But why not? :-) |
32 |
|
33 |
ok, so actually it is the following: |
34 |
|
35 |
first this part: |
36 |
|
37 |
default_src_install() { |
38 |
if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then |
39 |
emake DESTDIR="${D}" install || die "emake install failed" |
40 |
fi |
41 |
|
42 |
then there are 2 ideas from Ciaran: |
43 |
|
44 |
1.: |
45 |
|
46 |
local d |
47 |
if ! declare -p DOCS >/dev/null 2>&1 ; then |
48 |
for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \ |
49 |
THANKS BUGS FAQ CREDITS CHANGELOG ; do |
50 |
[[ -s "${d}" ]] && dodoc "${d}" |
51 |
done |
52 |
elif declare -p DOCS | grep -q '^declare -a ' ; then |
53 |
for d in "${DOCS[@]}" ; do |
54 |
dodoc "${d}" |
55 |
done |
56 |
else |
57 |
dodoc ${DOCS} |
58 |
fi |
59 |
} |
60 |
|
61 |
and 2.: |
62 |
|
63 |
emagicdocs |
64 |
|
65 |
emagicdocs() { |
66 |
done_docs= |
67 |
old_set=$(shopt | grep 'nocaseglob[[:space:]]*on') |
68 |
shopt -s nocaseglob |
69 |
for d in '' "${DEFAULT_SRC_INSTALL_EXTRA_SUBDIRS[@]}" ; do |
70 |
if [[ -n ${d} ]]; then |
71 |
[[ -d ${d} ]] || die "${d} is not a dir" |
72 |
pushd "${d}" > /dev/null || die "Failed to enter ${d}" |
73 |
local docdesttree="${DOCDESTTREE}" |
74 |
docinto "${d}" |
75 |
fi |
76 |
for f in README Change{,s,Log} AUTHORS NEWS TODO ABOUT THANKS {KNOWN_,}BUGS SUBMITTING \ |
77 |
HACKING FAQ CREDITS PKG-INFO HISTORY PACKAGING MAINTAINER{,S} CONTRIBUT{E,OR,ORS} |
78 |
RELEASE \ |
79 |
ANNOUNCE PORTING NOTES PROBLEMS NOTICE "${DEFAULT_SRC_INSTALL_EXTRA_DOCS[@]}"; do |
80 |
for p in "${DEFAULT_SRC_INSTALL_EXTRA_PREFIXES[@]}" '' ; do |
81 |
for doc in "${p}"*([[:digit:]])"${f}"{,+([._-])*} ; do |
82 |
if [[ -s "${doc}" ]] ; then |
83 |
for e in "${DEFAULT_SRC_INSTALL_EXCLUDE[@]}" ; do |
84 |
[[ ${doc} == ${e} ]] && continue 2 |
85 |
done |
86 |
done_docs="${done_docs} ${d%/}${d:+/}${doc}" |
87 |
dodoc "${doc}" |
88 |
fi |
89 |
done |
90 |
done |
91 |
done |
92 |
if [[ -n ${d} ]]; then |
93 |
docinto "${docdesttree}" |
94 |
popd > /dev/null || die "Failed to leave ${d}" |
95 |
fi |
96 |
done |
97 |
if [[ -n "${done_docs}" ]] ; then |
98 |
echo "Installed docs ${done_docs# }" |
99 |
else |
100 |
echo "Didn't find any docs to install" |
101 |
fi |
102 |
[[ -n ${old_set} ]] || shopt -u nocaseglob |
103 |
} |
104 |
|
105 |
Any more comments about this? |
106 |
|
107 |
> |
108 |
> |
109 |
>> So what about this funcion for the next EAPI and also implementation |
110 |
>> in base.eclass? |
111 |
> |
112 |
> Why would you want to implement it in base.eclass when it's in EAPI=3? I |
113 |
> can't think of a case where "inherit base" would make things easier |
114 |
> than bumping to EAPI=3. In both cases, you might need to change logic |
115 |
> within your ebuild and test it. |
116 |
|
117 |
That ideas was months ago, where EAPI-2 was just introduced and i had no idea when a default |
118 |
src_install with EAPI-3 could come in, so i suggested base.eclass as alternative, so it could be |
119 |
used earlier. |
120 |
|
121 |
-- |
122 |
Thomas Sachau |
123 |
|
124 |
Gentoo Linux Developer |