Blame SOURCES/macros.scl-filesystem

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