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