[Bug 279869] New: Extending yast2-devtools - create-spec
https://bugzilla.novell.com/show_bug.cgi?id=279869 Summary: Extending yast2-devtools - create-spec Product: openSUSE 10.3 Version: Alpha 4plus Platform: Other OS/Version: Other Status: NEW Severity: Enhancement Priority: P5 - None Component: YaST2 AssignedTo: mvidner@novell.com ReportedBy: ke@novell.com QAContact: jsrain@novell.com CC: coolo@novell.com [Adding to bugzilla to make sure we do not forget about it.] Ahoj Martin, I once again need an extension to create-spec. coolo wants me to add a language tag to the %files list. In the end, it must look as follows: %files .. %lang($LL) /usr/share/YaST2/locale .. Since I am not familiar with perl, I can only propose a sed hack (the tricky part is to throw away the country code). I hope my assumption is right that only yast2-trans packages use @localedir@: Index: create-spec =================================================================== --- create-spec (revision 36673) +++ create-spec (working copy) @@ -47,7 +47,8 @@ $provides_locale = ""; if ($RPMNAME =~ /^yast2-trans-(.*)/) { - $provides_locale = "Provides:\tlocale(yast2:$1)\n" + $provides_locale = "Provides:\tlocale(yast2:$1)\n"; + $my_iso639 = `echo -n $1 | sed -e 's/_.*//'`; } if ($#ARGV > 0) @@ -204,7 +205,7 @@ "\@ydatadir\@" => "${yast2dir}/data", "\@imagedir\@" => "${yast2dir}/images", "\@themedir\@" => "${yast2dir}/theme", - "\@localedir\@" => "${yast2dir}/locale", + "\@localedir\@" => "%lang($my_iso639) ${yast2dir}/locale", "\@clientdir\@" => "${yast2dir}/clients", "\@moduledir\@" => "${yast2dir}/modules", "\@yncludedir\@" => "${yast2dir}/include", -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=279869 mvidner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|mvidner@novell.com |ke@novell.com ------- Comment #1 from mvidner@novell.com 2007-06-01 06:46 MST -------
I hope my assumption is right that only yast2-trans packages use @localedir@:
unfortunately not: mvidner@valkyrie:yt$ grep localedir */*.spec.in yast2/yast2.spec.in:mkdir -p "$RPM_BUILD_ROOT"@localedir@ yast2/yast2.spec.in:%dir @localedir@ As you have to resubmit the packages anyway, I think it is better to apply the change to all the yast2-trans*.spec.in files in SVN. Something like this (untested!) for f in */yast2-trans*.spec.in; do ll=$f{#*/yast-trans-} ll=${ll%.spec.in} ll=${ll%_*} sed -i "s/^@localedir@"/%lang($ll) @localedir@" $f done -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=279869 ke@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |mvidner@novell.com ------- Comment #2 from ke@novell.com 2007-06-01 07:16 MST ------- Thanks for checking and advise. I'd like to avoid hardcoding the language info in *.spec.in. I think we better add it to the y2autoconf layer and I will change existing *spec.in accordingly (not sure, whether I got it right): Index: skeletons/trans/yast2-trans-XXpkgXX.spec.in =================================================================== --- skeletons/trans/yast2-trans-XXpkgXX.spec.in (revision 38224) +++ skeletons/trans/yast2-trans-XXpkgXX.spec.in (working copy) @@ -22,4 +22,5 @@ %files %defattr(-,root,root) %doc @docdir@ -@localedir@ +%dir @localedir@ +%lang(@ISO639@) @localedir@/@ISO639@ Index: bin/y2autoconf =================================================================== --- bin/y2autoconf (revision 38224) +++ bin/y2autoconf (working copy) @@ -185,6 +185,8 @@ '@YAST2-INIT-PO@' => 'LL=${RPMNAME##*-} AC_SUBST(LL) +ISO639=${LL%_*} +AC_SUBST(ISO639) AC_ARG_WITH(own_compendium, AS_HELP_STRING([--with-own_compendium=FILE], -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=279869 ------- Comment #3 from ke@novell.com 2007-06-01 07:18 MST ------- Replace +%lang(@ISO639@) @localedir@/@ISO639@ with +%lang(@ISO639@) @localedir@/@LL@ -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=279869 ------- Comment #4 from ke@novell.com 2007-06-01 08:13 MST ------- It probably won't hurt adding this to y2autoconf, but we also must change create-spec; something as follows might work: Index: create-spec =================================================================== --- create-spec (revision 38224) +++ create-spec (working copy) @@ -47,7 +47,9 @@ $provides_locale = ""; if ($RPMNAME =~ /^yast2-trans-(.*)/) { - $provides_locale = "Provides:\tlocale(yast2:$1)\n" + $provides_locale = "Provides:\tlocale(yast2:$1)\n"; + $LL = "$1"; + $ISO639 = `echo -n $1 | sed -e 's/_.*//'`; } if ($#ARGV > 0) @@ -212,6 +214,10 @@ "\@scrconfdir\@" => "${yast2dir}/scrconf", "\@desktopdir\@" => "%{prefix}/share/applications/YaST2", '@fillupdir@' => '/var/adm/fillup-templates', + + "\@LL\@" => "$LL", + "\@ISO639\@" => "$ISO639", + ); # The main program -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=279869
Andreas Jaeger
https://bugzilla.novell.com/show_bug.cgi?id=279869#c5
Martin Vidner
participants (1)
-
bugzilla_noreply@novell.com