%define disable_docs_package 1 Summary: The basic directory layout for a Linux system Name: filesystem Version: 0.2 Release: 1 License: Public Domain URL: https://fedorahosted.org/filesystem Group: System/Base BuildArch: noarch Source1: lang-exceptions Source2: iso_639.sed Source3: iso_3166.sed Source1001: filesystem.manifest Requires(pre): setup BuildRequires: iso-codes %description The filesystem package is one of the basic packages that is installed on a Linux system. Filesystem contains the basic directory layout for a Linux operating system, including the correct permissions for the directories. %prep rm -f $RPM_BUILD_DIR/filelist %build cp %{SOURCE1001} . %install rm -rf %{buildroot} mkdir %{buildroot} install -p -c -m755 %SOURCE2 %{buildroot}/iso_639.sed install -p -c -m755 %SOURCE3 %{buildroot}/iso_3166.sed cd %{buildroot} mkdir -p bin boot dev run home \ mnt/{mntlib,moviefs,nfs,ums} \ opt/{home/{app,developer,root},dbspace,etc,lib,driver,storage/sdcard,share/applications} \ etc/{X11/{applnk,fontpath.d},xdg/autostart,opt,pm/{config.d,power.d,sleep.d},xinetd.d,skel,sysconfig,pki,rc.d/init.d} \ lib/modules %{_lib}/tls media proc sbin srv sys tmp \ usr/{bin,games,include,%{_lib}/{games,sse2,tls,X11,pm-utils/{module.d,power.d,sleep.d}},lib/{games,locale},libexec,local/{bin,games,lib,%{_lib},sbin,src,libexec,include,},sbin,share/{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} \ var/{lib/misc,local,lock/subsys,log,nis,preserve,run,spool/{mail,lpd},tmp,db,cache,opt,games} ln -snf ../var/tmp usr/tmp ln -snf spool/mail var/mail ln -snf rc.d/init.d etc/init.d ln -snf mnt/mmc sdcard ln -sf ../opt/home/app %{buildroot}/home/ ln -sf ../opt/home/developer %{buildroot}/home/ sed -n -f %{buildroot}/iso_639.sed /usr/share/xml/iso-codes/iso_639.xml \ >%{buildroot}/iso_639.tab sed -n -f %{buildroot}/iso_3166.sed /usr/share/xml/iso-codes/iso_3166.xml \ >%{buildroot}/iso_3166.tab grep -v "^$" %{buildroot}/iso_639.tab | grep -v "^#" | while read a b c d ; do [[ "$d" =~ "^Reserved" ]] && continue [[ "$d" =~ "^No linguistic" ]] && continue locale=$c if [ "$locale" = "XX" ]; then locale=$b fi echo "%lang(${locale}) /usr/share/locale/${locale}" >> $RPM_BUILD_DIR/filelist echo "%lang(${locale}) %ghost %config(missingok) /usr/share/man/${locale}" >>$RPM_BUILD_DIR/filelist done cat %{SOURCE1} | grep -v "^#" | grep -v "^$" | while read loc ; do locale=$loc locality= special= [[ "$locale" =~ "@" ]] && locale=${locale%%@*} [[ "$locale" =~ "_" ]] && locality=${locale##*_} [[ "$locality" =~ "." ]] && locality=${locality%%.*} [[ "$loc" =~ "_" ]] || [[ "$loc" =~ "@" ]] || special=$loc # If the locality is not official, skip it if [ -n "$locality" ]; then grep -q "^$locality" %{buildroot}/iso_3166.tab || continue fi # If the locale is not official and not special, skip it if [ -z "$special" ]; then egrep -q "[[:space:]]${locale%_*}[[:space:]]" \ %{buildroot}/iso_639.tab || continue fi echo "%lang(${locale}) /usr/share/locale/${loc}" >> $RPM_BUILD_DIR/filelist echo "%lang(${locale}) %ghost %config(missingok) /usr/share/man/${loc}" >> $RPM_BUILD_DIR/filelist done rm -f %{buildroot}/iso_639.tab rm -f %{buildroot}/iso_639.sed rm -f %{buildroot}/iso_3166.tab rm -f %{buildroot}/iso_3166.sed cat $RPM_BUILD_DIR/filelist | grep "locale" | while read a b ; do mkdir -p -m 755 %{buildroot}/$b/LC_MESSAGES done cat $RPM_BUILD_DIR/filelist | grep "/share/man" | while read a b c d; do 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} done for i in `echo man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p}`; do echo "/usr/share/man/$i" >>$RPM_BUILD_DIR/filelist done %clean rm -rf %{buildroot} %files -f filelist %manifest filesystem.manifest %defattr(0755,root,root,-) %dir %attr(555,root,root) / %attr(555,root,root) /bin %attr(555,root,root) /boot /dev /etc %attr(555,root,root) /lib %ifarch x86_64 %attr(555,root,root) /%{_lib} %endif /media %dir /mnt %dir /mnt/mntlib %dir /mnt/moviefs %dir /mnt/nfs %dir /mnt/ums /sdcard %dir /opt %dir /opt/dbspace %dir /home /home/app /home/developer %attr(550,root,root) /opt/home/root %attr(750,app,app) /opt/home/app %attr(750,developer,developer) /opt/home/developer %dir /opt/etc %dir /opt/lib %dir /opt/driver %dir /opt/storage %dir /opt/share/applications %dir /opt/storage/sdcard %attr(555,root,root) /proc %attr(555,root,root) /sbin /srv /sys %attr(1777,root,root) /tmp %dir /usr %attr(555,root,root) /usr/bin /usr/games /usr/include %attr(555,root,root) /usr/lib %ifarch x86_64 %attr(555,root,root) /usr/%{_lib} %endif /usr/libexec /usr/local %attr(555,root,root) /usr/sbin %dir /usr/share /usr/share/applications /usr/share/augeas /usr/share/backgrounds /usr/share/desktop-directories /usr/share/dict /usr/share/doc %attr(555,root,root) %dir /usr/share/empty /usr/share/games /usr/share/ghostscript /usr/share/gnome /usr/share/icons /usr/share/idl /usr/share/info %dir /usr/share/locale %dir /usr/share/man /usr/share/mime-info /usr/share/misc /usr/share/omf /usr/share/pixmaps /usr/share/sounds /usr/share/themes /usr/share/xsessions /usr/share/X11 /usr/src /usr/tmp %dir /var /var/db /var/games /var/lib /var/local %dir %attr(0775,root,lock) /var/lock %attr(755,root,root) /var/lock/subsys /var/cache /var/log /var/mail /var/nis /var/opt /var/preserve /var/run /run %dir /var/spool %attr(755,root,root) /var/spool/lpd %attr(775,root,mail) /var/spool/mail %attr(1777,root,root) /var/tmp %dev(c,5,1) /dev/console %dev(c,29,0) /dev/fb0 %dev(c,4,0) /dev/tty %dev(c,4,1) /dev/tty1 %dev(c,4,2) /dev/tty2