Compare commits

...

2 Commits

Author SHA1 Message Date
Mike FABIAN
9048a218ad Changes in the wording of the locale sub-package descriptions according to Carlos' suggestions 2016-02-24 07:47:50 +01:00
Mike FABIAN
b079c8e8fc Package the locales and the translations into sub-packages
- We do not have an Esperanto locale. Therefore, the glibc-langpack-eo
  package contains only the translation.
- Add metapackage which requires all the locale/language sub-packages
2016-02-18 11:15:33 +01:00

View File

@ -1,6 +1,6 @@
%define glibcsrcdir glibc-2.22-719-g1233be7 %define glibcsrcdir glibc-2.22-719-g1233be7
%define glibcversion 2.22.90 %define glibcversion 2.22.90
%define glibcrelease 36%{?dist} %define glibcrelease 37%{?dist}
# Pre-release tarballs are pulled in from git using a command that is # Pre-release tarballs are pulled in from git using a command that is
# effectively: # effectively:
# #
@ -548,6 +548,244 @@ Group: System Environment/Base
The glibc-common package includes common binaries for the GNU libc The glibc-common package includes common binaries for the GNU libc
libraries, as well as national language (locale) support. libraries, as well as national language (locale) support.
%package locale-source
Summary: The sources for the locales
Requires: %{name} = %{version}-%{release}
Requires: %{name}-common = %{version}-%{release}
Group: System Environment/Base
%description locale-source
The sources for all locales provided in the language packs.
If you are building custom locales you will most likely use
these sources as the basis for your new locale.
%define lang_package()\
%package langpack-%{1}\
Summary: Locale data for %{1}\
Requires: %{name} = %{version}-%{release}\
Requires: %{name}-common = %{version}-%{release}\
Requires: tzdata >= 2003a\
%define supplements_list %(locale -a | grep ^%{1}_ | cut -d @ -f 1 | cut -d . -f 1 | sort -u | tr "\\\\n" " " | sed 's/ $//' | sed 's/ / or langpacks-/g' | sed 's/^/ or langpacks-/')\
Supplements: (glibc = %{version}-%{release} and (langpacks-%{1}%{supplements_list}))\
Group: System Environment/Base\
%description langpack-%{1}\
The glibc-langpack-%{1} package includes the basic information required\
to support the %{1} language in your applications.\
%ifnarch %{auxarches}\
%files -f langpack-%{1}.filelist langpack-%{1}\
%defattr(-,root,root)\
%endif\
%{nil}
%define language_list \
aa \
af \
ak \
am \
an \
anp \
ar \
as \
ast \
ayc \
az \
be \
bem \
ber \
bg \
bhb \
bho \
bn \
bo \
br \
brx \
bs \
byn \
ca \
ce \
cmn \
crh \
cs \
csb \
cv \
cy \
da \
de \
doi \
dv \
dz \
el \
en \
eo \
es \
et \
eu \
fa \
ff \
fi \
fil \
fo \
fr \
fur \
fy \
ga \
gd \
gez \
gl \
gu \
gv \
ha \
hak \
he \
hi \
hne \
hr \
hsb \
ht \
hu \
hy \
ia \
id \
ig \
ik \
is \
it \
iu \
iw \
ja \
ka \
kk \
kl \
km \
kn \
ko \
kok \
ks \
ku \
kw \
ky \
lb \
lg \
li \
lij \
lo \
lt \
lv \
lzh \
mag \
mai \
mg \
mhr \
mi \
mk \
ml \
mn \
mni \
mr \
ms \
mt \
my \
nan \
nb \
nds \
ne \
nhn \
niu \
nl \
nn \
nr \
nso \
oc \
om \
or \
os \
pa \
pap \
pl \
ps \
pt \
quz \
raj \
ro \
ru \
rw \
sa \
sat \
sc \
sd \
se \
shs \
si \
sid \
sk \
sl \
so \
sq \
sr \
ss \
st \
sv \
sw \
szl \
ta \
tcy \
te \
tg \
th \
the \
ti \
tig \
tk \
tl \
tn \
tr \
ts \
tt \
ug \
uk \
unm \
ur \
uz \
ve \
vi \
wa \
wae \
wal \
wo \
xh \
yi \
yo \
yue \
zh \
zu \
%{nil}
%define create_lang_packages()\
%{lua:\
local languages = rpm.expand("%1")\
string.gsub(languages, "(%a+)",\
function(i) print(rpm.expand("%lang_package "..i.."")) end)}\
%{nil}
%create_lang_packages %language_list
%define require_langpacks()\
%{lua:\
local languages = rpm.expand("%1")\
string.gsub(languages, "(%a+)",\
function(i) print(rpm.expand("Requires: %{name}-langpack-"..i.." = %{version}-%{release}\\n")) end)}\
%{nil}
%package all-langpacks
Summary: Meta package to require all langpacks
Group: System Environment/Base
%require_langpacks %language_list
%description all-langpacks
Meta package that requires all language packs.
%ifnarch %{auxarches}
%files all-langpacks
%endif
############################################################################## ##############################################################################
# glibc "nscd" sub-package # glibc "nscd" sub-package
############################################################################## ##############################################################################
@ -1099,26 +1337,34 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/libc.info*
%endif %endif
############################################################################## ##############################################################################
# Install locale files # Create locale sub-package file lists
############################################################################## ##############################################################################
# Create archive of locale files
%ifnarch %{auxarches} %ifnarch %{auxarches}
olddir=`pwd` olddir=`pwd`
pushd ${RPM_BUILD_ROOT}%{_prefix}/lib/locale pushd ${RPM_BUILD_ROOT}%{_prefix}/lib/locale
rm -f locale-archive rm -f locale-archive
# Intentionally we do not pass --alias-file=, aliases will be added # Create the file lists for the language specific sub-packages:
# by build-locale-archive. for i in *_*
$olddir/build-%{target}/elf/ld.so \ do
--library-path $olddir/build-%{target}/ \ lang=${i%%_*}
$olddir/build-%{target}/locale/localedef \ if [ ! -e langpack-${lang}.filelist ]; then
--prefix ${RPM_BUILD_ROOT} --add-to-archive \ echo "%dir %{_prefix}/lib/locale" >> langpack-${lang}.filelist
C.utf8 *_* fi
# Removes all locales except C.utf8 which remains as fallback in echo "%dir %{_prefix}/lib/locale/$i" >> langpack-${lang}.filelist
# the event the user cleans the locale-archive using localedef. echo "%{_prefix}/lib/locale/$i/*" >> langpack-${lang}.filelist
rm -rf *_* done
mv locale-archive{,.tmpl}
popd popd
pushd ${RPM_BUILD_ROOT}%{_prefix}/share/locale
for i in */LC_MESSAGES/libc.mo
do
locale=${i%%%%/*}
lang=${locale%%%%_*}
echo "%lang($lang) %{_prefix}/share/locale/${i}" \
>> ${RPM_BUILD_ROOT}%{_prefix}/lib/locale/langpack-${lang}.filelist
done
popd
mv ${RPM_BUILD_ROOT}%{_prefix}/lib/locale/*.filelist .
%endif %endif
############################################################################## ##############################################################################
@ -1195,7 +1441,8 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/*_p.a
############################################################################## ##############################################################################
# Build the file lists used for describing the package and subpackages. # Build the file lists used for describing the package and subpackages.
############################################################################## ##############################################################################
# There are 11 file lists: # There are 11 main file lists (and many more for
# the langpack sub-packages (langpack-${lang}.filelist)):
# * rpm.fileslist # * rpm.fileslist
# - Master file list. Eventually, after removing files from this list # - Master file list. Eventually, after removing files from this list
# we are left with the list of files for the glibc package. # we are left with the list of files for the glibc package.
@ -1243,10 +1490,10 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/*_p.a
# primary filelist # primary filelist
# Add %%lang entries for language-specific locale files. This allows users # remove the locale sources, they go into the sub-package "locale-source":
# to set %%_install_lang and not install the unnecessary locale files. I18N_LANG='\,.*/share/i18n/locales/.*,d'
I18N_LANG='s|.*/share/i18n/locales/\([a-z]\{2\}[a-z]\?\)_[A-Z]\{2\}.*|%lang(\1) &|' # Also remove the *.mo entries. We will add them to the
# Remove the *.mo entries. We will add that using %%find_lang # language specific sub-packages.
sed -e '\,.*/share/locale/\([^/_]\+\).*/LC_MESSAGES/.*\.mo,d' \ sed -e '\,.*/share/locale/\([^/_]\+\).*/LC_MESSAGES/.*\.mo,d' \
-e "$I18N_LANG" \ -e "$I18N_LANG" \
-e '\,/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\|rpc\|gai\.conf\),d' \ -e '\,/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\|rpc\|gai\.conf\),d' \
@ -1254,9 +1501,7 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/*_p.a
-e '\,bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d' -e '\,bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d'
} | sort > rpm.filelist } | sort > rpm.filelist
# Our *.mo files. Put them in glibc-common. touch common.filelist
%find_lang libc
mv libc.lang common.filelist
mkdir -p $RPM_BUILD_ROOT%{_libdir} mkdir -p $RPM_BUILD_ROOT%{_libdir}
mv -f $RPM_BUILD_ROOT/%{_lib}/lib{pcprofile,memusage}.so $RPM_BUILD_ROOT%{_libdir} mv -f $RPM_BUILD_ROOT/%{_lib}/lib{pcprofile,memusage}.so $RPM_BUILD_ROOT%{_libdir}
@ -1352,7 +1597,7 @@ sed -i -e '\|/%{_lib}/%{nosegneg_subdir}|d' rpm.filelist
# wish to clean that up at some point. # wish to clean that up at some point.
%endif %endif
# Add the binary to build localse to the common subpackage. # Add the binary to build locales to the common subpackage.
echo '%{_prefix}/sbin/build-locale-archive' >> common.filelist echo '%{_prefix}/sbin/build-locale-archive' >> common.filelist
# The nscd binary must go into the nscd subpackage. # The nscd binary must go into the nscd subpackage.
@ -1623,10 +1868,6 @@ touch $RPM_BUILD_ROOT/var/run/nscd/{socket,nscd.pid}
%endif # %{auxarches} %endif # %{auxarches}
%ifnarch %{auxarches}
truncate -s 0 $RPM_BUILD_ROOT/%{_prefix}/lib/locale/locale-archive
%endif
mkdir -p $RPM_BUILD_ROOT/var/cache/ldconfig mkdir -p $RPM_BUILD_ROOT/var/cache/ldconfig
truncate -s 0 $RPM_BUILD_ROOT/var/cache/ldconfig/aux-cache truncate -s 0 $RPM_BUILD_ROOT/var/cache/ldconfig/aux-cache
@ -1784,27 +2025,8 @@ end
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%triggerin common -p <lua> -- glibc
if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then
pid = posix.fork()
if pid == 0 then
posix.exec("%{_prefix}/sbin/build-locale-archive", "--install-langs", rpm.expand("%%{_install_langs}"))
elseif pid > 0 then
posix.wait(pid)
end
end
%post common -p <lua> %post common -p <lua>
if posix.access("/etc/ld.so.cache") then os.remove("%{_prefix}/lib/locale/locale-archive")
if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then
pid = posix.fork()
if pid == 0 then
posix.exec("%{_prefix}/sbin/build-locale-archive", "--install-langs", rpm.expand("%%{_install_langs}"))
elseif pid > 0 then
posix.wait(pid)
end
end
end
%if %{with docs} %if %{with docs}
%post devel %post devel
@ -1907,12 +2129,15 @@ rm -f *.filelist*
%dir %{_prefix}/lib/locale %dir %{_prefix}/lib/locale
%dir %{_prefix}/lib/locale/C.utf8 %dir %{_prefix}/lib/locale/C.utf8
%{_prefix}/lib/locale/C.utf8/* %{_prefix}/lib/locale/C.utf8/*
%attr(0644,root,root) %verify(not md5 size mtime) %{_prefix}/lib/locale/locale-archive.tmpl
%attr(0644,root,root) %verify(not md5 size mtime mode) %ghost %config(missingok,noreplace) %{_prefix}/lib/locale/locale-archive
%dir %attr(755,root,root) /etc/default %dir %attr(755,root,root) /etc/default
%verify(not md5 size mtime) %config(noreplace) /etc/default/nss %verify(not md5 size mtime) %config(noreplace) /etc/default/nss
%doc documentation/* %doc documentation/*
%files locale-source
%defattr(-,root,root)
%dir %{_prefix}/share/i18n/locales
%{_prefix}/share/i18n/locales/*
%files -f devel.filelist devel %files -f devel.filelist devel
%defattr(-,root,root) %defattr(-,root,root)
@ -1963,6 +2188,11 @@ rm -f *.filelist*
%endif %endif
%changelog %changelog
* Thu Feb 18 2016 Mike FABIAN <mfabian@redhat.com> - 2.22.90-37
- Package the locales and the translations into sub-packages and add
a meta-package which requires all the locale and language
specific sub-packages
* Tue Feb 16 2016 CArlos O'Donell <carlos@redhat.com> - 2.22.90-36 * Tue Feb 16 2016 CArlos O'Donell <carlos@redhat.com> - 2.22.90-36
- Fix CVE-2015-7547: getaddrinfo() stack-based buffer overflow (#1308943). - Fix CVE-2015-7547: getaddrinfo() stack-based buffer overflow (#1308943).