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