Skip to content

Commit

Permalink
Let vendors handle their own locale-archive generation
Browse files Browse the repository at this point in the history
All files needed to generate all locales are already installed by glibc-common.
Just run for example: localedef --replace -i en_GB -f UTF-8 en_GB.utf8

Signed-off-by: Islam Amer <islam.amer@jollamobile.com>
  • Loading branch information
Islam Amer committed Dec 21, 2014
1 parent 6bb2273 commit 7b76db8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 38 deletions.
4 changes: 4 additions & 0 deletions glibc.changes
@@ -1,3 +1,7 @@
* Sun Dec 21 2014 Islam Amer <islam.amer@jolla.com> - 2.19
- Remove locale-archive.tmpl generation during build time to save ~100Mb disk space
- Remove build-locale-archive invocation in %post to save a lot of time and disk burn

* Sat Dec 13 2014 Carsten Munk <carsten.munk@jolla.com> - 2.19
- Disable special -march=i486 for glibc
- Use correct release. Release is mungled on OBS
Expand Down
40 changes: 2 additions & 38 deletions glibc.spec
Expand Up @@ -328,11 +328,6 @@ GCC=`cat Gcc`
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
make -j1 install_root=$RPM_BUILD_ROOT install -C build-%{nptl_target_cpu}-linuxnptl PARALLELMFLAGS=
%ifnarch %{auxarches}
cd build-%{nptl_target_cpu}-linuxnptl && \
make %{?_smp_mflags} install_root=$RPM_BUILD_ROOT install-locales -C ../localedata objdir=`pwd` && \
cd ..
%endif

librtso=`basename $RPM_BUILD_ROOT/%{_lib}/librt.so.*`

Expand Down Expand Up @@ -390,37 +385,13 @@ for i in *.a; do
done
popd

# Hardlink identical locale files together
%ifnarch %{auxarches}
#From 2.11, removed hardlink
olddir=`pwd`
pushd ${RPM_BUILD_ROOT}%{_prefix}/lib/locale
rm locale-archive || :
# Intentionally we do not pass --alias-file=, aliases will be added
# by build-locale-archive.
# note that due to qemu-arm emulation behaviour, we need to break this up into multiple invocations.
# see BMC 10526.

localedef_bin="$olddir/build-%{nptl_target_cpu}-linuxnptl/elf/ld.so --library-path $olddir/build-%{nptl_target_cpu}-linuxnptl/ $olddir/build-%{nptl_target_cpu}-linuxnptl/locale/localedef"

%if 0%{?qemu_user_space_build}
if [ -f /usr/bin/localedef ]; then
localedef_bin=/usr/bin/localedef
fi
%endif

find . -name '*_*' -maxdepth 1 | xargs -r -n10 -P1 --verbose $localedef_bin --prefix ${RPM_BUILD_ROOT} --add-to-archive

rm -rf *_*
mv locale-archive{,.tmpl}
popd
%endif
mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib/locale/
> $RPM_BUILD_ROOT/%{_prefix}/lib/locale/locale-archive

%ifarch armv7hl armv7tnhl armv7nhl
ln -s /lib/ld-linux-armhf.so.3 ${RPM_BUILD_ROOT}/lib/ld-linux.so.3
%endif


rm -f ${RPM_BUILD_ROOT}/%{_lib}/libnss1-*
rm -f ${RPM_BUILD_ROOT}/%{_lib}/libnss-*.so.1

Expand Down Expand Up @@ -594,10 +565,6 @@ touch $RPM_BUILD_ROOT/var/{db,run}/nscd/{passwd,group,hosts,services}
touch $RPM_BUILD_ROOT/var/run/nscd/{socket,nscd.pid}
%endif

%ifnarch %{auxarches}
> $RPM_BUILD_ROOT/%{_prefix}/lib/locale/locale-archive
%endif

install -m 700 build-locale-archive $RPM_BUILD_ROOT/usr/sbin/build-locale-archive

mkdir -p $RPM_BUILD_ROOT/var/cache/ldconfig
Expand All @@ -615,8 +582,6 @@ fi

%postun utils -p /sbin/ldconfig

%post common -p /usr/sbin/build-locale-archive

%pre -n nscd
/usr/sbin/useradd -M -o -r -d / -s /sbin/nologin \
-c "NSCD Daemon" -u 28 nscd > /dev/null 2>&1 || :
Expand Down Expand Up @@ -653,7 +618,6 @@ fi
%files -f common.filelist common
%defattr(-,root,root)
%dir %{_prefix}/lib/locale
%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
Expand Down

0 comments on commit 7b76db8

Please sign in to comment.