Blame SOURCES/macros.scl-filesystem

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