File bundle-lang.spec.in of Package bundle-lang-gnome
#
# spec file for package bundle-lang-kde (Version 11.2)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
#!BuildIgnore: gimp-unstable
Name: bundle-lang-@SPEC@
BuildRequires: @PACKAGES@
BuildRequires: fdupes
License: license
Group: group
Version: 11.2
Release: 1
Summary: summary
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
Source0: bundle.sh
Source1: list_langs.sh
Source2: packages.txt
Source3: attributes
Source4: update_spec.pl
Source5: pre_checkin.sh
Source6: update-gnome-extras.sh
%description
summary
#LANGUAGES
%prep
%build
%install
mkdir -p $RPM_BUILD_ROOT
cp %SOURCE1 .
bash %SOURCE0 @PACKAGES@
if test @SPEC@ = kde; then
# pretty evil hack to keep the symlinks working
langs=`cd $RPM_BUILD_ROOT/usr/share/doc-bundle/kde/HTML && ls -1d *`
for lang in $langs; do
ln -s /usr/share/doc/kde/HTML/$lang/common $RPM_BUILD_ROOT/usr/share/doc-bundle/kde/HTML/$lang/common
echo /usr/share/doc-bundle/kde/HTML/$lang/common >> filelist.$lang
# we don't need the ../common symlinks (bnc#394343)
files=`cd $RPM_BUILD_ROOT && ls -1 /usr/share/doc-bundle/kde/HTML/$lang/*/common 2>/dev/null || true`
for f in $files; do
if test -L $RPM_BUILD_ROOT/$f; then
rm $RPM_BUILD_ROOT/$f
for i in filelist*; do
grep -v $f $i > $i.new || true
mv $i.new $i
done
fi
done
done
fi
taken_languages="@TAKEN_LANGUAGES@"
for suffix in CN TW; do
cat filelist.zh_$suffix >> filelist.zh
rm -f filelist.zh_$suffix
done
for lang in $taken_languages; do
echo "%defattr(-,root,root,755)" > taken.$lang
cat filelist.$lang >> taken.$lang
rm filelist.$lang
done
# special hack for a special problem (I hope)
if test -f $RPM_BUILD_ROOT/usr/share/gnome/help-bundle/dia/eu/graphics/line_props.png; then
rm $RPM_BUILD_ROOT/usr/share/gnome/help-bundle/dia/pl/graphics/line_props.png
cp $RPM_BUILD_ROOT/usr/share/gnome/help-bundle/dia/eu/graphics/line_props.png $RPM_BUILD_ROOT/usr/share/gnome/help-bundle/dia/pl/graphics/line_props.png
fi
for file in filelist.*; do
grep -v %dir $file | sed -e "s,.*lang[^ ]* ,,; s,%doc *,," | while read file; do rm -v $RPM_BUILD_ROOT$file; done
rm $file
done
for i in $RPM_BUILD_ROOT/*; do
%fdupes $i
done
for file in taken.*; do
changed=1
while test "$changed" = 1; do
changed=0
list=`grep %dir $file | sed -e "s,%dir,,; s,%lang[^ ]*,," | while read dir; do dirname "$dir"; done | sort -u`
for dir in $list; do
grep -q "$dir"\$ $file && continue
rpm -qf $dir && continue
changed=1
echo "%dir $dir" >> $file
done
done
done
%clean
rm -rf $RPM_BUILD_ROOT
#LANGUAGE_FILES
%changelog