2 oe_runmake install_root=${D} install
4 h=`echo $r|sed -e's,\.x$,.h,'`
5 install -m 0644 ${S}/sunrpc/rpcsvc/$h ${D}/${includedir}/rpcsvc/
7 install -m 0644 ${WORKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/
8 install -d ${D}${libdir}/locale
9 make -f ${WORKDIR}/generate-supported.mk IN="${S}/localedata/SUPPORTED" OUT="${WORKDIR}/SUPPORTED"
13 TMP_LOCALE="/tmp/locale/${libdir}/locale"
15 locale_base_postinst() {
18 if [ "x$D" != "x" ]; then
23 mkdir -p ${TMP_LOCALE}
24 if [ -f ${libdir}/locale/locale-archive ]; then
25 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/
27 localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s
28 mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
32 locale_base_postrm() {
36 mkdir -p ${TMP_LOCALE}
37 if [ -f ${libdir}/locale/locale-archive ]; then
38 cp ${libdir}/locale/locale-archive ${TMP_LOCALE}/
40 localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s
41 mv ${TMP_LOCALE}/locale-archive ${libdir}/locale/
45 python package_do_split_gconvs () {
47 if (oe.data.getVar('PACKAGE_NO_GCONV', d, 1) == '1'):
48 oe.note("package requested not splitting gconvs")
51 if not oe.data.getVar('PACKAGES', d, 1):
54 libdir = oe.data.getVar('libdir', d, 1)
56 oe.error("libdir not defined")
58 datadir = oe.data.getVar('datadir', d, 1)
60 oe.error("datadir not defined")
63 gconv_libdir = os.path.join(libdir, "gconv")
64 charmap_dir = os.path.join(datadir, "i18n", "charmaps")
65 locales_dir = os.path.join(datadir, "i18n", "locales")
67 do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern='glibc-gconv-%s', description='gconv module for character set %s', extra_depends='glibc-gconv')
69 do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern='glibc-charmap-%s', description='character map for %s encoding', extra_depends='')
71 def calc_locale_deps(fn, pkg, file_regex, output_pattern, group):
74 c_re = re.compile('^copy "(.*)"')
75 i_re = re.compile('^include "(\w+)".*')
76 for l in f.readlines():
77 m = c_re.match(l) or i_re.match(l)
79 dp = legitimize_package_name('glibc-localedata-%s' % m.group(1))
84 oe.data.setVar('RDEPENDS_%s' % pkg, " ".join(deps), d)
86 do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern='glibc-localedata-%s', description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
87 oe.data.setVar('PACKAGES', oe.data.getVar('PACKAGES', d) + ' glibc-gconv', d)
89 f = open(os.path.join(oe.data.getVar('WORKDIR', d, 1), "SUPPORTED"), "r")
90 supported = f.readlines()
93 dot_re = re.compile("(.*)\.(.*)")
95 # Collate the locales by base and encoding
99 (locale, charset) = l.split(" ")
100 m = dot_re.match(locale)
103 if not encodings.has_key(locale):
104 encodings[locale] = []
105 encodings[locale].append(charset)
107 def output_locale(name, locale, encoding):
108 pkgname = 'locale-base-' + legitimize_package_name(name)
110 oe.data.setVar('RDEPENDS_%s' % pkgname, 'localedef glibc-localedata-%s glibc-charmap-%s' % (legitimize_package_name(locale), legitimize_package_name(encoding)), d)
111 rprovides = 'virtual-locale-%s' % legitimize_package_name(name)
112 m = re.match("(.*)_(.*)", name)
114 rprovides += ' virtual-locale-%s' % m.group(1)
115 oe.data.setVar('RPROVIDES_%s' % pkgname, rprovides, d)
116 oe.data.setVar('PACKAGES', '%s %s' % (pkgname, oe.data.getVar('PACKAGES', d, 1)), d)
117 oe.data.setVar('ALLOW_EMPTY_%s' % pkgname, '1', d)
118 oe.data.setVar('pkg_postinst_%s' % pkgname, oe.data.getVar('locale_base_postinst', d, 1) % (locale, encoding, locale), d)
119 oe.data.setVar('pkg_postrm_%s' % pkgname, oe.data.getVar('locale_base_postrm', d, 1) % (locale, encoding, locale), d)
121 # Reshuffle names so that UTF-8 is preferred over other encodings
122 for l in encodings.keys():
123 if len(encodings[l]) == 1:
124 output_locale(l, l, encodings[l][0])
126 if "UTF-8" in encodings[l]:
127 output_locale(l, l, "UTF-8")
128 encodings[l].remove("UTF-8")
129 for e in encodings[l]:
130 output_locale('%s-%s' % (l, e), l, e)
133 # We want to do this indirection so that we can safely 'return'
134 # from the called function even though we're prepending
135 python populate_packages_prepend () {
136 if oe.data.getVar('DEBIAN_NAMES', d, 1):
137 oe.data.setVar('PKG_glibc', 'libc6', d)
138 oe.data.setVar('PKG_glibc-dev', 'libc6-dev', d)
139 oe.build.exec_func('package_do_split_gconvs', d)