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