Blame SOURCES/macros.scl-filesystem

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