Blame SOURCES/macros.scl-filesystem

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