Compare commits

...

8 Commits

Author SHA1 Message Date
Mike FABIAN
3a86157fdc The rpm macro expansion bug is fixed, remove the workaround
https://bugzilla.redhat.com/show_bug.cgi?id=1303034#c5
2016-02-08 16:18:50 +01:00
Mike FABIAN
d9bc2196b1 Add macros to use the same language list for the langpack-subpackages and the requirements of the meta-package to require them all 2016-01-27 08:35:59 +01:00
Mike FABIAN
c48b18fcb8 Generate Supplements for all locales 2016-01-26 09:04:58 +01:00
Mike FABIAN
2e31fd77e3 Add metapackage which requires all the locale sub-packages
<vpodzime> for the installation images it would be really helpful if you could
           create some metapackage with all the langpacks as dependencies (so
           that we don't have to list them all)
2016-01-21 07:38:24 +01:00
Mike FABIAN
789ef853aa Weak dependency should be on langpacks-.. (with "s")
<jsilhan> hi, there is the example:
<jsilhan> https://fedoraproject.org/wiki/PackagingDrafts/Langpack
<jsilhan> it shoudl be Supplements: (glibc = %{version}-%{release} and
          langpacks-%{1}
<jsilhan> and the package name is `glibc-cs`
2016-01-21 07:34:20 +01:00
Mike FABIAN
9b23c6f379 Fix typo in Supplements tag 2016-01-20 16:55:55 +01:00
Mike FABIAN
198e8e2a37 Package the translations into the glibc-langpack-<..> sub-packages as well
We do not have an Esperanto locale. Therefore, the glibc-langpack-eo
package contains only the translation.
2016-01-19 13:23:03 +01:00
Mike FABIAN
88f9f1ef83 work on locale-subpackaging 2016-01-18 21:51:56 +01:00

View File

@ -1,6 +1,6 @@
%define glibcsrcdir glibc-2.22-621-g90c400b
%define glibcversion 2.22.90
%define glibcrelease 29%{?dist}
%define glibcrelease 52%{?dist}
# Pre-release tarballs are pulled in from git using a command that is
# effectively:
#
@ -541,6 +541,241 @@ Group: System Environment/Base
The glibc-common package includes common binaries for the GNU libc
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 the locales
%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 locale data for %{1}.\
%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 to require all langpacks
%ifnarch %{auxarches}
%files all-langpacks
%endif
##############################################################################
# glibc "nscd" sub-package
##############################################################################
@ -1081,26 +1316,34 @@ rm -f $RPM_BUILD_ROOT%{_infodir}/libc.info*
%endif
##############################################################################
# Install locale files
# Create locale sub-package file lists
##############################################################################
# Create archive of locale files
%ifnarch %{auxarches}
olddir=`pwd`
pushd ${RPM_BUILD_ROOT}%{_prefix}/lib/locale
rm -f locale-archive
# Intentionally we do not pass --alias-file=, aliases will be added
# by build-locale-archive.
$olddir/build-%{target}/elf/ld.so \
--library-path $olddir/build-%{target}/ \
$olddir/build-%{target}/locale/localedef \
--prefix ${RPM_BUILD_ROOT} --add-to-archive \
C.utf8 *_*
# Removes all locales except C.utf8 which remains as fallback in
# the event the user cleans the locale-archive using localedef.
rm -rf *_*
mv locale-archive{,.tmpl}
# Create the file lists for the language specific sub-packages:
for i in *_*
do
lang=${i%%_*}
if [ ! -e langpack-${lang}.filelist ]; then
echo "%dir %{_prefix}/lib/locale" >> langpack-${lang}.filelist
fi
echo "%dir %{_prefix}/lib/locale/$i" >> langpack-${lang}.filelist
echo "%{_prefix}/lib/locale/$i/*" >> langpack-${lang}.filelist
done
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
##############################################################################
@ -1177,7 +1420,8 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/*_p.a
##############################################################################
# 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
# - Master file list. Eventually, after removing files from this list
# we are left with the list of files for the glibc package.
@ -1225,10 +1469,10 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/*_p.a
# primary filelist
# Add %%lang entries for language-specific locale files. This allows users
# to set %%_install_lang and not install the unnecessary locale files.
I18N_LANG='s|.*/share/i18n/locales/\([a-z]\{2\}[a-z]\?\)_[A-Z]\{2\}.*|%lang(\1) &|'
# Remove the *.mo entries. We will add that using %%find_lang
# remove the locale sources, they go into the sub-package "locale-source":
I18N_LANG='\,.*/share/i18n/locales/.*,d'
# Also remove the *.mo entries. We will add them to the
# language specific sub-packages.
sed -e '\,.*/share/locale/\([^/_]\+\).*/LC_MESSAGES/.*\.mo,d' \
-e "$I18N_LANG" \
-e '\,/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\|rpc\|gai\.conf\),d' \
@ -1236,9 +1480,7 @@ rm -f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/*_p.a
-e '\,bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d'
} | sort > rpm.filelist
# Our *.mo files. Put them in glibc-common.
%find_lang libc
mv libc.lang common.filelist
touch common.filelist
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mv -f $RPM_BUILD_ROOT/%{_lib}/lib{pcprofile,memusage}.so $RPM_BUILD_ROOT%{_libdir}
@ -1334,7 +1576,7 @@ sed -i -e '\|/%{_lib}/%{nosegneg_subdir}|d' rpm.filelist
# wish to clean that up at some point.
%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
# The nscd binary must go into the nscd subpackage.
@ -1605,10 +1847,6 @@ touch $RPM_BUILD_ROOT/var/run/nscd/{socket,nscd.pid}
%endif # %{auxarches}
%ifnarch %{auxarches}
truncate -s 0 $RPM_BUILD_ROOT/%{_prefix}/lib/locale/locale-archive
%endif
mkdir -p $RPM_BUILD_ROOT/var/cache/ldconfig
truncate -s 0 $RPM_BUILD_ROOT/var/cache/ldconfig/aux-cache
@ -1766,27 +2004,9 @@ end
%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>
if posix.access("/etc/ld.so.cache") then
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
%post common
# remove old archive file:
rm -f %{_prefix}/lib/locale/locale-archive
%if %{with docs}
%post devel
@ -1889,12 +2109,15 @@ rm -f *.filelist*
%dir %{_prefix}/lib/locale
%dir %{_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
%verify(not md5 size mtime) %config(noreplace) /etc/default/nss
%doc documentation/*
%files locale-source
%defattr(-,root,root)
%dir %{_prefix}/share/i18n/locales
%{_prefix}/share/i18n/locales/*
%files -f devel.filelist devel
%defattr(-,root,root)
@ -1945,6 +2168,9 @@ rm -f *.filelist*
%endif
%changelog
* Sun Jan 17 2016 Mike FABIAN <mfabian@redhat.com> - 2.22.90-52
- Testing 55
* Wed Jan 13 2016 Carlos O'Donell <carlos@redhat.com> - 2.22.90-29
- New pthread_barrier algorithm with improved standards compliance.