Albert Uchytil 1ae2c3f
%scl_files %{expand:
Albert Uchytil 1ae2c3f
%defattr(-,root,root,-)
Albert Uchytil 1ae2c3f
%dir %_scl_prefix
Albert Uchytil 1ae2c3f
%dir %attr(555,root,root) %{_scl_root}
Albert Uchytil 1ae2c3f
%dir %attr(555,root,root) %{_scl_scripts}
Albert Uchytil 1ae2c3f
%{_scl_scripts}/enable
Lubos Kardos 7794daf
%{_scl_scripts}/%{scl}
Lubos Kardos 7794daf
%{_root_sysconfdir}/scl/modulefiles/%{scl}
Albert Uchytil 1ae2c3f
%{_root_sysconfdir}/scl/prefixes/%scl
Albert Uchytil 1ae2c3f
%{_scl_root}/bin
Albert Uchytil 1ae2c3f
%attr(555,root,root) %{_scl_root}/boot
Albert Uchytil 1ae2c3f
%{_scl_root}/dev
2a2860f
%dir %{_sysconfdir}
2a2860f
%{_sysconfdir}/X11
2a2860f
%{_sysconfdir}/xdg
2a2860f
%{_sysconfdir}/opt
2a2860f
%{_sysconfdir}/pm
2a2860f
%{_sysconfdir}/xinetd.d
2a2860f
%{_sysconfdir}/skel
2a2860f
%{_sysconfdir}/sysconfig
2a2860f
%{_sysconfdir}/pki
Albert Uchytil 1ae2c3f
%{_scl_root}/home
Albert Uchytil 1ae2c3f
%{_scl_root}/lib
Albert Uchytil 1ae2c3f
%ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x
Albert Uchytil 1ae2c3f
%{_scl_root}/%{_lib}
Albert Uchytil 1ae2c3f
%endif
Albert Uchytil 1ae2c3f
%{_scl_root}/media
Albert Uchytil 1ae2c3f
%dir %{_scl_root}/mnt
Albert Uchytil 1ae2c3f
%dir %{_scl_root}/opt
Albert Uchytil 1ae2c3f
%attr(555,root,root) %{_scl_root}/proc
Albert Uchytil 1ae2c3f
%attr(550,root,root) %{_scl_root}/root
Albert Uchytil 1ae2c3f
%{_scl_root}/run
Albert Uchytil 1ae2c3f
%{_scl_root}/sbin
Albert Uchytil 1ae2c3f
%{_scl_root}/srv
Albert Uchytil 1ae2c3f
%{_scl_root}/sys
Albert Uchytil 1ae2c3f
%attr(1777,root,root) %{_scl_root}/tmp
Albert Uchytil 1ae2c3f
%dir %{_scl_root}/usr
Albert Uchytil 1ae2c3f
%attr(555,root,root) %{_scl_root}/usr/bin
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/etc
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/games
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/include
2a2860f
%dir %attr(555,root,root) %{_scl_root}/usr/lib
Albert Uchytil 1ae2c3f
%ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x
Albert Uchytil 1ae2c3f
%attr(555,root,root) %{_scl_root}/usr/%{_lib}
Albert Uchytil 1ae2c3f
%endif
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/libexec
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/local
Albert Uchytil 1ae2c3f
%attr(555,root,root) %{_scl_root}/usr/sbin
Albert Uchytil 1ae2c3f
%dir %{_scl_root}/usr/share
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/aclocal
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/applications
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/augeas
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/backgrounds
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/desktop-directories
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/dict
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/doc
Albert Uchytil 1ae2c3f
%attr(555,root,root) %dir %{_scl_root}/usr/share/empty
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/games
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/ghostscript
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/gnome
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/icons
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/idl
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/info
Albert Uchytil 1ae2c3f
%dir %{_scl_root}/usr/share/locale
Albert Uchytil 1ae2c3f
%dir %{_scl_root}/usr/share/man
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/mime-info
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/misc
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/omf
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/pixmaps
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/sounds
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/themes
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/xsessions
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/share/X11
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/src
Albert Uchytil 1ae2c3f
%{_scl_root}/usr/tmp
2a2860f
%dir %{_localstatedir}
2a2860f
%{_localstatedir}/adm
2a2860f
%{_localstatedir}/cache
2a2860f
%{_localstatedir}/db
2a2860f
%{_localstatedir}/empty
2a2860f
%{_localstatedir}/games
2a2860f
%{_localstatedir}/gopher
2a2860f
%{_localstatedir}/lib
2a2860f
%{_localstatedir}/local
2a2860f
%ghost %dir %attr(755,root,root) %{_localstatedir}/lock
2a2860f
%ghost %{_localstatedir}/lock/subsys
2a2860f
%{_localstatedir}/log
2a2860f
%{_localstatedir}/mail
2a2860f
%{_localstatedir}/nis
2a2860f
%{_localstatedir}/opt
2a2860f
%{_localstatedir}/preserve
2a2860f
%ghost %attr(755,root,root) %{_localstatedir}/run
2a2860f
%dir %{_localstatedir}/spool
2a2860f
%attr(755,root,root) %{_localstatedir}/spool/lpd
2a2860f
%attr(775,root,mail) %{_localstatedir}/spool/mail
2a2860f
%attr(1777,root,root) %{_localstatedir}/tmp
2a2860f
%{_localstatedir}/yp
Albert Uchytil 1ae2c3f
}
24d87f2
24d87f2
%scl_install %{expand:
24d87f2
# scl specific stuff
Lubos Kardos 7794daf
mkdir -p %{buildroot}%{_root_sysconfdir}/{rpm,scl/{prefixes,modulefiles}}
24d87f2
cat >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config << EOF
f06d1fc
%%%%scl %scl
f06d1fc
%{?nfsmountable:%%%%nfsmountable %{nfsmountable}}
f06d1fc
%{!?nfsmountable:%%%%undefine nfsmountable}
24d87f2
EOF
24d87f2
cat >> %{buildroot}%{_root_sysconfdir}/scl/prefixes/%{scl} << EOF
24d87f2
%_scl_prefix
24d87f2
EOF
Lubos Kardos 7794daf
ln -s %{_scl_scripts}/%{scl} %{buildroot}%{_root_sysconfdir}/scl/modulefiles/%{scl}
2a2860f
# filelist
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
2a2860f
mkdir -p %{buildroot}%{_localstatedir}
2a2860f
pushd  %{buildroot}%{_localstatedir}
2a2860f
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}
2a2860f
popd
2a2860f
mkdir -p %{buildroot}%{_sysconfdir}
2a2860f
pushd %{buildroot}%{_sysconfdir}
2a2860f
mkdir -p {X11/{applnk,fontpath.d},xdg/autostart,opt,pm/{config.d,power.d,sleep.d},xinetd.d,skel,sysconfig,pki}
2a2860f
popd
24d87f2
mkdir -p %{buildroot}%{_scl_root}
2a2860f
rm -f $RPM_BUILD_DIR/%{buildsubdir}/filelist
Albert Uchytil 1ae2c3f
rm -f $RPM_BUILD_DIR/%{buildsubdir}/filesystem
6fb2c21
pushd %{buildroot}%{_scl_root}
24d87f2
mkdir -p boot dev \\
24d87f2
        home media mnt opt proc root run/lock srv sys tmp \\
2a2860f
        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}
2515baf
%ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x
2515baf
mkdir -p usr/{%{_lib}/{games,sse2,tls,X11,pm-utils/{module.d,power.d,sleep.d}},local/%{_lib}}
2515baf
%endif
2a2860f
ln -snf %{_localstatedir}/tmp usr/tmp
2a2860f
ln -snf spool/mail %{buildroot}%{_localstatedir}/mail
24d87f2
ln -snf usr/bin bin
24d87f2
ln -snf usr/sbin sbin
24d87f2
ln -snf usr/lib lib
6fb2c21
%ifarch x86_64 ppc ppc64 sparc sparc64 s390 s390x
24d87f2
ln -snf usr/%{_lib} %{_lib}
6fb2c21
%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
2e50fdf
grep -av "^$" %{buildroot}/iso_639.tab | grep -av "^#" | 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
2a2860f
    echo "%lang(${locale})      %{_scl_root}/usr/share/locale/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
2a2860f
    echo "%lang(${locale}) %ghost %config(missingok) %{_scl_root}/usr/share/man/${locale}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
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
2a2860f
    echo "%lang(${locale})      %{_scl_root}/usr/share/locale/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
2a2860f
    echo "%lang(${locale})  %ghost %config(missingok) %{_scl_root}/usr/share/man/${loc}" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
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
2a2860f
cat $RPM_BUILD_DIR/%{buildsubdir}/filelist | grep "locale" | while read a b ; do
24d87f2
    mkdir -p -m 755 %{buildroot}/$b/LC_MESSAGES
24d87f2
done
2a2860f
cat $RPM_BUILD_DIR/%{buildsubdir}/filelist | 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
2a2860f
   echo "%{_scl_root}/usr/share/man/$i" >> $RPM_BUILD_DIR/%{buildsubdir}/filelist
24d87f2
done
2a2860f
ln -s $RPM_BUILD_DIR/%{buildsubdir}/filelist $RPM_BUILD_DIR/%{buildsubdir}/filesystem
24d87f2
set -x
6fb2c21
popd
24d87f2
}