3

I wanted to write a ebuild for some binary package , it contains a folder for different languages , its structure is:

ls /path/po:

de  fr  ja  zh_CN  zh_TW

I think it's easy to do it , but the document provided by Gentoo is really limited , how can i filter the unnecessary language files ? I shouldn't be copying all those to /usr/share/locale.

==========================================================

@Updates:

I discovered a simple method , which examines ${LANGUAS} variable , like the following code:

insinto /usr/share/locale
for x in "${LANGUAS}";do
  if [[ -d "po/${x}" ]];then
    doins "po/${x}"
  else
    einfo "LANGUAGE $x is not supported by this app"
  fi
done

Just wondering if it's official approach.

4

1 回答 1

1

没有官方方法,因为它非常依赖包。例如,某些包可能需要将其他参数传递给 ./configure,而其他包(例如您的包)则需要更手动的方法。

至于你上面的例子,我相信它是完全可以接受的。您还没有提供整个 ebuild,所以请记住您需要将可接受的语言添加到 IUSE var 中。

例如

LANGS="de fr ja zh_CN zh_TW"
for X in ${LANGS} ; do
    IUSE="${IUSE} linguas_${X}"
done

对于更复杂的示例,您可以查看openoffice-bin ebuild

于 2011-09-07T23:31:52.250 回答