Albert Uchytil 5a7f4ad
%scl_files %{expand:
Albert Uchytil 5a7f4ad
%defattr(-,root,root,-)
Albert Uchytil 5a7f4ad
%dir %_scl_prefix
Albert Uchytil 5a7f4ad
%dir %attr(555,root,root) %{_scl_root}
Albert Uchytil 5a7f4ad
%dir %attr(555,root,root) %{_scl_scripts}
Albert Uchytil 5a7f4ad
%{_scl_scripts}/enable
Albert Uchytil 5a7f4ad
%{_root_sysconfdir}/scl/prefixes/%scl
Albert Uchytil 5a7f4ad
%{_scl_root}/bin
Albert Uchytil 5a7f4ad
%attr(555,root,root) %{_scl_root}/boot
Albert Uchytil 5a7f4ad
%{_scl_root}/dev
Albert Uchytil 5a7f4ad
%dir %{_scl_root}/etc
Albert Uchytil 5a7f4ad
%{_scl_root}/etc/X11
Albert Uchytil 5a7f4ad
%{_scl_root}/etc/xdg
Albert Uchytil 5a7f4ad
%{_scl_root}/etc/opt
Albert Uchytil 5a7f4ad
%{_scl_root}/etc/pm
Albert Uchytil 5a7f4ad
%{_scl_root}/etc/xinetd.d
Albert Uchytil 5a7f4ad
%{_scl_root}/etc/skel
Albert Uchytil 5a7f4ad
%{_scl_root}/etc/sysconfig
Albert Uchytil 5a7f4ad
%{_scl_root}/etc/pki
Albert Uchytil 5a7f4ad
%{_scl_root}/home
Albert Uchytil 5a7f4ad
%{_scl_root}/lib
Albert Uchytil 5a7f4ad
%ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x
Albert Uchytil 5a7f4ad
%{_scl_root}/%{_lib}
Albert Uchytil 5a7f4ad
%endif
Albert Uchytil 5a7f4ad
%{_scl_root}/media
Albert Uchytil 5a7f4ad
%dir %{_scl_root}/mnt
Albert Uchytil 5a7f4ad
%dir %{_scl_root}/opt
Albert Uchytil 5a7f4ad
%attr(555,root,root) %{_scl_root}/proc
Albert Uchytil 5a7f4ad
%attr(550,root,root) %{_scl_root}/root
Albert Uchytil 5a7f4ad
%{_scl_root}/run
Albert Uchytil 5a7f4ad
%{_scl_root}/sbin
Albert Uchytil 5a7f4ad
%{_scl_root}/srv
Albert Uchytil 5a7f4ad
%{_scl_root}/sys
Albert Uchytil 5a7f4ad
%attr(1777,root,root) %{_scl_root}/tmp
Albert Uchytil 5a7f4ad
%dir %{_scl_root}/usr
Albert Uchytil 5a7f4ad
%attr(555,root,root) %{_scl_root}/usr/bin
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/etc
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/games
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/include
Albert Uchytil 5a7f4ad
%attr(555,root,root) %{_scl_root}/usr/lib
Albert Uchytil 5a7f4ad
%ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x
Albert Uchytil 5a7f4ad
%attr(555,root,root) %{_scl_root}/usr/%{_lib}
Albert Uchytil 5a7f4ad
%endif
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/libexec
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/local
Albert Uchytil 5a7f4ad
%attr(555,root,root) %{_scl_root}/usr/sbin
Albert Uchytil 5a7f4ad
%dir %{_scl_root}/usr/share
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/aclocal
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/applications
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/augeas
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/backgrounds
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/desktop-directories
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/dict
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/doc
Albert Uchytil 5a7f4ad
%attr(555,root,root) %dir %{_scl_root}/usr/share/empty
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/games
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/ghostscript
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/gnome
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/icons
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/idl
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/info
Albert Uchytil 5a7f4ad
%dir %{_scl_root}/usr/share/locale
Albert Uchytil 5a7f4ad
%dir %{_scl_root}/usr/share/man
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/mime-info
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/misc
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/omf
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/pixmaps
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/sounds
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/themes
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/xsessions
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/share/X11
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/src
Albert Uchytil 5a7f4ad
%{_scl_root}/usr/tmp
Albert Uchytil 5a7f4ad
%dir %{_scl_root}/var
Albert Uchytil 5a7f4ad
%{_scl_root}/var/adm
Albert Uchytil 5a7f4ad
%{_scl_root}/var/cache
Albert Uchytil 5a7f4ad
%{_scl_root}/var/db
Albert Uchytil 5a7f4ad
%{_scl_root}/var/empty
Albert Uchytil 5a7f4ad
%{_scl_root}/var/games
Albert Uchytil 5a7f4ad
%{_scl_root}/var/gopher
Albert Uchytil 5a7f4ad
%{_scl_root}/var/lib
Albert Uchytil 5a7f4ad
%{_scl_root}/var/local
Albert Uchytil 5a7f4ad
%ghost %dir %attr(755,root,root) %{_scl_root}/var/lock
Albert Uchytil 5a7f4ad
%ghost %{_scl_root}/var/lock/subsys
Albert Uchytil 5a7f4ad
%{_scl_root}/var/log
Albert Uchytil 5a7f4ad
%{_scl_root}/var/mail
Albert Uchytil 5a7f4ad
%{_scl_root}/var/nis
Albert Uchytil 5a7f4ad
%{_scl_root}/var/opt
Albert Uchytil 5a7f4ad
%{_scl_root}/var/preserve
Albert Uchytil 5a7f4ad
%ghost %attr(755,root,root) %{_scl_root}/var/run
Albert Uchytil 5a7f4ad
%dir %{_scl_root}/var/spool
Albert Uchytil 5a7f4ad
%attr(755,root,root) %{_scl_root}/var/spool/lpd
Albert Uchytil 5a7f4ad
%attr(775,root,mail) %{_scl_root}/var/spool/mail
Albert Uchytil 5a7f4ad
%attr(755,uucp,uucp) %{_scl_root}/var/spool/uucp
Albert Uchytil 5a7f4ad
%attr(1777,root,root) %{_scl_root}/var/tmp
Albert Uchytil 5a7f4ad
%{_scl_root}/var/yp
Albert Uchytil 5a7f4ad
}
24d87f2
24d87f2
%scl_install %{expand:
24d87f2
# scl specific stuff
24d87f2
mkdir -p %{buildroot}%{_root_sysconfdir}/{rpm,scl/prefixes}
24d87f2
echo -n '%' > %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
24d87f2
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF
24d87f2
scl %scl
24d87f2
EOF
Albert Uchytil 5fe18e7
echo -n '%' >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config
Albert Uchytil 5fe18e7
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF
Albert Uchytil 5fe18e7
scl_vendor %{scl_vendor}
Albert Uchytil 5fe18e7
EOF
24d87f2
cat >> %{buildroot}%{_root_sysconfdir}/scl/prefixes/%{scl} << EOF
24d87f2
%_scl_prefix
24d87f2
EOF
Albert Uchytil 5a7f4ad
# filesystem
24d87f2
set +x
24d87f2
cat >> %{buildroot}/lang-exceptions << EOF
24d87f2
af_ZA
24d87f2
am_ET
24d87f2
ast_ES
24d87f2
az_IR
24d87f2
bg_BG
24d87f2
bn_IN
24d87f2
ca@valencia
24d87f2
ca_ES
24d87f2
ca_ES@valencian
24d87f2
cs_CZ
24d87f2
de_AT
24d87f2
de_CH
24d87f2
de_DE
24d87f2
default
24d87f2
el_GR
24d87f2
en_AU
24d87f2
en_CA
24d87f2
en_GB
24d87f2
en_US
24d87f2
en_NZ
24d87f2
es_AR
24d87f2
es_CL
24d87f2
es_CO
24d87f2
es_CR
24d87f2
es_DO
24d87f2
es_EC
24d87f2
es_ES
24d87f2
es_GT
24d87f2
es_HN
24d87f2
es_MX
24d87f2
es_NI
24d87f2
es_PA
24d87f2
es_PE
24d87f2
es_PR
24d87f2
es_SV
24d87f2
es_UY
24d87f2
es_VE
24d87f2
et_EE
24d87f2
eu_ES
24d87f2
fa_IR
24d87f2
fi_FI
24d87f2
fr_BE
24d87f2
fr_CA
24d87f2
fr_CH
24d87f2
fr_FR
24d87f2
gl_ES
24d87f2
he_IL
24d87f2
hr_HR
24d87f2
hu_HU
24d87f2
it_CH
24d87f2
it_IT
24d87f2
ja_JP
24d87f2
ko_KR
24d87f2
ks@devanagari
24d87f2
lv_LV
24d87f2
ms_MY
24d87f2
my_MM
24d87f2
nb_NO
24d87f2
nds_DE
24d87f2
nl_BE
24d87f2
nl_NL
24d87f2
pl_PL
24d87f2
pt_BR
24d87f2
pt_PT
24d87f2
ru_RU
24d87f2
sl_SI
24d87f2
sq_AL
24d87f2
sr_RS
24d87f2
sv_SE
24d87f2
uk_UA
24d87f2
ur_PK
24d87f2
zh_CN
24d87f2
zh_CN.GB2312
24d87f2
zh_HK
24d87f2
zh_TW
24d87f2
zh_TW.Big5
24d87f2
en@boldquot
24d87f2
en@quot
24d87f2
nds@NFE
24d87f2
sr@ije
24d87f2
sr@ijekavian
24d87f2
sr@ijekavianlatin
24d87f2
sr@latin
24d87f2
sr@Latn
24d87f2
uz@cyrillic
24d87f2
uz@Latn
24d87f2
be@latin
24d87f2
en@shaw
24d87f2
brx
24d87f2
brx_IN
24d87f2
EOF
24d87f2
cat >> %{buildroot}/iso_639.sed << EOF
24d87f2
1,/
24d87f2
# on each new iso-code process the current one
24d87f2
\\!\\(<iso_639_entry\\|</iso_639_entries>\\)!{
24d87f2
    x
24d87f2
    s/^$//
24d87f2
    # we are on the first iso-code--nothing to process here
24d87f2
    t
24d87f2
    # process and write to output
24d87f2
    s/\\s\\+/ /g
24d87f2
    s/
24d87f2
    s!/\\s*>!!
24d87f2
    # use '%' as a separator of parsed and unparsed input
24d87f2
    s/\\(.*\\)iso_639_2T_code="\\([^"]\\+\\)"\\(.*\\)/\\2 % \\1 \\3/
24d87f2
    s/\\([^%]\\+\\)%\\(.*\\)iso_639_2B_code="\\([^"]\\+\\)"\\(.*\\)/\\1\\t\\3 % \\2 \\4/
24d87f2
    #  clear subst. memory for the next t
24d87f2
    t clear
24d87f2
    :clear
24d87f2
    s/\\([^%]\\+\\)%\\(.*\\)iso_639_1_code="\\([^"]\\+\\)"\\(.*\\)/\\1\\t\\3 % \\2 \\4/
24d87f2
    t name
24d87f2
    # no 639-1 code--write xx
24d87f2
    s/%/\\tXX %/
24d87f2
    :name
24d87f2
    s/\\([^%]\\+\\)%\\(.*\\)name="\\([^"]\\+\\)"\\(.*\\)/\\1\\t\\3/
24d87f2
    s/ \\t/\\t/g
24d87f2
    p
24d87f2
    b
24d87f2
    :noout
24d87f2
}
24d87f2
H
24d87f2
EOF
24d87f2
cat >> %{buildroot}/iso_3166.sed << EOF
24d87f2
1,/
24d87f2
# on each new iso-code process the current one
24d87f2
\\!\\(<iso_3166_entry\\|</iso_3166_entries>\\)!{
24d87f2
    x
24d87f2
    s/^$//
24d87f2
    # we are on the first iso-code--nothing to process here
24d87f2
    t
24d87f2
    # process and write to output
24d87f2
    s/\\s\\+/ /g
24d87f2
    s/
24d87f2
    s!/\\s*>!!
24d87f2
    # use '%' as a separator of parsed and unparsed input
24d87f2
    s/\\(.*\\)alpha_2_code="\\([^"]\\+\\)"\\(.*\\)/\\2 % \\1 \\3/
24d87f2
    s/\\([^%]\\+\\)%\\(.*\\)alpha_3_code="\\([^"]\\+\\)"\\(.*\\)/\\1% \\2 \\4/
24d87f2
    #  clear subst. memory for the next t
24d87f2
    t clear
24d87f2
    :clear
24d87f2
    s/\\([^%]\\+\\)%\\(.*\\)numeric_code="\\([^"]\\+\\)"\\(.*\\)/\\1% \\2 \\4/
24d87f2
    t name
24d87f2
    # no 3166 code--write xx
24d87f2
    s/%/\\tXX %/
24d87f2
    :name
24d87f2
    s/\\([^%]\\+\\)%\\(.*\\)name="\\([^"]\\+\\)"\\(.*\\)/\\1\\t\\3/
24d87f2
    s/ \\t/\\t/g
24d87f2
    p
24d87f2
    b
24d87f2
    :noout
24d87f2
}
24d87f2
H
24d87f2
EOF
24d87f2
mkdir -p %{buildroot}%{_scl_root}
Albert Uchytil 5a7f4ad
rm -f $RPM_BUILD_DIR/%{buildsubdir}/filesystem
9905f5b
pushd %{buildroot}%{_scl_root}
24d87f2
mkdir -p boot dev \\
24d87f2
        etc/{X11/{applnk,fontpath.d},xdg/autostart,opt,pm/{config.d,power.d,sleep.d},xinetd.d,skel,sysconfig,pki} \\
24d87f2
        home media mnt opt proc root run/lock srv sys tmp \\
fd68fa6
        usr/{bin,etc,games,include,lib/{games,locale,modules,sse2},libexec,local/{bin,etc,games,lib,sbin,src,share/{applications,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x},info},libexec,include,},sbin,share/{aclocal,applications,augeas/lenses,backgrounds,desktop-directories,dict,doc,empty,games,ghostscript/conf.d,gnome,icons,idl,info,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p},mime-info,misc,omf,pixmaps,sounds,themes,xsessions,X11},src,src/kernels,src/debug} \\
24d87f2
        var/{adm,empty,gopher,lib/{games,misc,rpm-state},local,lock/subsys,log,nis,preserve,run,spool/{mail,lpd,uucp},tmp,db,cache,opt,games,yp}
fd68fa6
%ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x
fd68fa6
mkdir -p usr/{%{_lib}/{games,sse2,tls,X11,pm-utils/{module.d,power.d,sleep.d}},local/%{_lib}}
fd68fa6
%endif
24d87f2
ln -snf ../var/tmp usr/tmp
24d87f2
ln -snf spool/mail var/mail
24d87f2
ln -snf usr/bin bin
24d87f2
ln -snf usr/sbin sbin
24d87f2
ln -snf usr/lib lib
9905f5b
%ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x
24d87f2
ln -snf usr/%{_lib} %{_lib}
9905f5b
%endif
24d87f2
sed -n -f %{buildroot}/iso_639.sed /usr/share/xml/iso-codes/iso_639.xml >%{buildroot}/iso_639.tab
24d87f2
sed -n -f %{buildroot}/iso_3166.sed /usr/share/xml/iso-codes/iso_3166.xml >%{buildroot}/iso_3166.tab
24d87f2
grep -v "^$" %{buildroot}/iso_639.tab | grep -v "^#" | while read a b c d ; do
24d87f2
    [[ "$d" =~ "^Reserved" ]] && continue
24d87f2
    [[ "$d" =~ "^No linguistic" ]] && continue
24d87f2
    locale=$c
24d87f2
    if [ "$locale" = "XX" ]; then
24d87f2
        locale=$b
24d87f2
    fi
Albert Uchytil 5a7f4ad
    echo "%lang(${locale})      %{_scl_root}/usr/share/locale/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem
Albert Uchytil 5a7f4ad
    echo "%lang(${locale}) %ghost %config(missingok) %{_scl_root}/usr/share/man/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem
24d87f2
done
24d87f2
cat %{buildroot}/lang-exceptions | grep -v "^#" | grep -v "^$" | while read loc ; do
24d87f2
    locale=$loc
24d87f2
    locality=
24d87f2
    special=
24d87f2
    [[ "$locale" =~ "@" ]] && locale=${locale%%%%@*}
24d87f2
    [[ "$locale" =~ "_" ]] && locality=${locale##*_}
24d87f2
    [[ "$locality" =~ "." ]] && locality=${locality%%%%.*}
24d87f2
    [[ "$loc" =~ "_" ]] || [[ "$loc" =~ "@" ]] || special=$loc
24d87f2
    # If the locality is not official, skip it
24d87f2
    if [ -n "$locality" ]; then
24d87f2
        grep -q "^$locality" %{buildroot}/iso_3166.tab || continue
24d87f2
    fi
24d87f2
    # If the locale is not official and not special, skip it
24d87f2
    if [ -z "$special" ]; then
24d87f2
        egrep -q "[[:space:]]${locale%%_*}[[:space:]]" \\
24d87f2
           %{buildroot}/iso_639.tab || continue
24d87f2
    fi
Albert Uchytil 5a7f4ad
    echo "%lang(${locale})      %{_scl_root}/usr/share/locale/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem
Albert Uchytil 5a7f4ad
    echo "%lang(${locale})  %ghost %config(missingok) %{_scl_root}/usr/share/man/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem
24d87f2
done
24d87f2
rm -f %{buildroot}/iso_639.tab
24d87f2
rm -f %{buildroot}/iso_639.sed
24d87f2
rm -f %{buildroot}/iso_3166.tab
24d87f2
rm -f %{buildroot}/iso_3166.sed
24d87f2
rm -f %{buildroot}/lang-exceptions
Albert Uchytil 5a7f4ad
cat $RPM_BUILD_DIR/%{buildsubdir}/filesystem | grep "locale" | while read a b ; do
24d87f2
    mkdir -p -m 755 %{buildroot}/$b/LC_MESSAGES
24d87f2
done
Albert Uchytil 5a7f4ad
cat $RPM_BUILD_DIR/%{buildsubdir}/filesystem | grep "/share/man" | while read a b c d; do
24d87f2
    mkdir -p -m 755 %{buildroot}/$d/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p}
24d87f2
done
24d87f2
for i in man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p}; do
Albert Uchytil 5a7f4ad
   echo "%{_scl_root}/usr/share/man/$i" >> $RPM_BUILD_DIR/%{buildsubdir}/filesystem
24d87f2
done
24d87f2
set -x
9905f5b
popd
24d87f2
}