Blame SOURCES/macros.scl-filesystem

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