]> git.pld-linux.org Git - packages/FHS.git/blobdiff - FHS.spec
- %prep fix (still needs %files checked)
[packages/FHS.git] / FHS.spec
index 86f337ceb75e98947bfee1b17884b7563c590ed1..e31dfe6b719e75af0dbcbed9c0750eaf41289b7b 100644 (file)
--- a/FHS.spec
+++ b/FHS.spec
-Summary:       Basic FHS 2.1 filesystem layout
-Summary(de):   Grundlegende Dateisystemstruktur
-Summary(fr):   Arborescence de base du système de fichiers
-Summary(pl):   Podstawowy uk³ad katalogów systemu Linux zgodny z FHS 2.1
-Summary(tr):   Temel dosya sistemi yapýsý
+# NOTE
+# - don't use %{_*dir} macros for paths defined by FHS
+# - do not add any dependencies to this pkg, FHS should be the first package being installed
+# - do not use any other user/group than "root", as then we have to depend on "setup" package.
+Summary:       Basic FHS 2.3 filesystem layout
+Summary(de.UTF-8):     Grundlegende Dateisystemstruktur
+Summary(fr.UTF-8):     Arborescence de base du système de fichiers
+Summary(pl.UTF-8):     Podstawowy układ katalogów systemu Linux zgodny z FHS 2.3
+Summary(tr.UTF-8):     Temel dosya sistemi yapısı
 Name:          FHS
-Version:       2.1
-Release:       20
+Version:       2.3
+Release:       27
 License:       GPL
 Group:         Base
 URL:           http://www.pathname.com/fhs/
+Source0:       locale-dirs
+BuildRequires: mktemp
+BuildRequires: rpmbuild(macros) >= 1.213
+Conflicts:     setup < 2.7
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-BuildRequires: grep
-BuildRequires: textutils
-PreReq:                setup
-BuildArch:     noarch
-Provides:      filesystem
-Obsoletes:     filesystem
+
+# nothing to put there
+%define                _enable_debug_packages  0
+
+# avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
+%define                __spec_clean_body       %{nil}
 
 %define                _locmandir      /usr/local/man
-%define                _xmandir        /usr/X11R6/man
+
+# doesn't contain any files, but we're not noarch package
+%define        no_install_post_strip   1
+%define        no_install_post_chrpath 1
+%define        no_install_post_compress_modules        1
+
+# we have to use numeric uids/groups. see comment above
+
+%define                gid_uucp        14
+%define                gid_mail        12
 
 %description
 This package contains the basic directory layout for a Linux system,
 including the proper permissions for the directories. This layout
-conforms to the Filesystem Hierarchy Standard (FHS) 2.1.
+conforms to the Filesystem Hierarchy Standard (FHS) 2.3.
 
-%description -l de
-Dieses Paket enthält die grundlegende Verzeichnisstruktur eines
-Linux-Systems, einschließlich der entsprechenden Zugriffsrechte. Diese
-Struktur entspricht dem Filesystem Hierarchy Standard (FHS) 2.1.
+%description -l de.UTF-8
+Dieses Paket enthält die grundlegende Verzeichnisstruktur eines
+Linux-Systems, einschließlich der entsprechenden Zugriffsrechte. Diese
+Struktur entspricht dem Filesystem Hierarchy Standard (FHS) 2.3.
 
-%description -l fr
-Ce package contient l'arborescence type pour système Linux y compris
-les permissions adéquates pour les répertoires. Cette arborescence est
-conforme au standard \"Filesystem Hierarchy Standard\" (FHS) 2.1.
+%description -l fr.UTF-8
+Ce package contient l'arborescence type pour système Linux y compris
+les permissions adéquates pour les répertoires. Cette arborescence est
+conforme au standard "Filesystem Hierarchy Standard" (FHS) 2.3.
 
-%description -l pl
-Pakiet ten zawiera informacje o podstawowej strukturze katalogów
-systemu i praw dostêpu do nich. Struktura katalogów jest zgodna z FHS
-2.1.
+%description -l pl.UTF-8
+Pakiet ten zawiera informacje o podstawowej strukturze katalogów
+systemu i praw dostępu do nich. Struktura katalogów jest zgodna z FHS
+2.3.
 
-%description -l tr
-Bu paket GNU makro iþleme dilini içerir. Mantýksal olarak
-ayrýþtýrýlabilen metin dosyalarý yazýmý için yararlýdýr.
+%description -l tr.UTF-8
+Bu paket GNU makro işleme dilini içerir. Mantıksal olarak
+ayrıştırılabilen metin dosyaları yazımı için yararlıdır.
 
 %prep
+%setup -qcT
+cp -a %{SOURCE0} .
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
-install -d $RPM_BUILD_ROOT/{bin,boot,dev,etc,home/{users,services},opt} \
-       $RPM_BUILD_ROOT%{_sysconfdir}/{X11,opt,security} \
-       $RPM_BUILD_ROOT/lib/{modules,security} \
-       $RPM_BUILD_ROOT/{mnt/{cdrom,floppy},proc,root,sbin,tmp} \
-       $RPM_BUILD_ROOT%{_prefix}/{bin,games,include,lib,sbin,share,src/examples} \
-       $RPM_BUILD_ROOT%{_datadir}/{dict,doc,games,info,misc,tmac} \
-       $RPM_BUILD_ROOT%{_libdir}/games \
-       $RPM_BUILD_ROOT%{_prefix}/local/{bin,games,lib,sbin,share/{doc,info},src} \
-       $RPM_BUILD_ROOT/var/{lock/subsys,log,mail,run,spool} \
-       $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/misc,opt,tmp} \
-       $RPM_BUILD_ROOT/usr/X11R6/share/idl \
-       $RPM_BUILD_ROOT%{_fontsdir}/Type1/{afm,pfm}
+install -d \
+       $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,srv} \
+       $RPM_BUILD_ROOT/etc/{X11,opt} \
+       $RPM_BUILD_ROOT/lib/modules \
+       $RPM_BUILD_ROOT/{mnt,media/{cdrom,floppy},proc,root/tmp,sbin,tmp} \
+       $RPM_BUILD_ROOT/usr/{bin,games,include,lib,sbin,share,src} \
+       $RPM_BUILD_ROOT/usr/share/{dict,doc,games,info,misc,tmac,xml} \
+       $RPM_BUILD_ROOT/usr/lib/games \
+       $RPM_BUILD_ROOT/usr/local/{bin,etc,games,include,lib,sbin,share/{doc,info},src} \
+       $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/misc,local,lock,log,mail,opt,run,spool,tmp,yp}
+
+%if "%{_lib}" == "lib64"
+install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
+%endif
 
 for manp in man{1,2,3,4,5,6,7,8} ; do
-       install -d $RPM_BUILD_ROOT%{_mandir}/${manp}
+       install -d $RPM_BUILD_ROOT/usr/share/man/${manp}
        install -d $RPM_BUILD_ROOT%{_locmandir}/${manp}
-       install -d $RPM_BUILD_ROOT%{_xmandir}/${manp}
-       for mloc in bg cs da de es fi fr hr hu id it ja ko nl pl pt pt_BR ru sl sk sv ; do
-               install -d $RPM_BUILD_ROOT%{_mandir}/${mloc}/${manp}
-       done
-       for mloc in fr it ja ko pl ; do
-               install -d $RPM_BUILD_ROOT%{_xmandir}/${mloc}/${manp}
+       for mloc in $(cat locale-dirs); do
+               install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp}
        done
 done
-install -d $RPM_BUILD_ROOT%{_mandir}/mann
+
+# "/usr/local/share/man and /usr/local/man must be synonomous" per FHS 2.3
+ln -sf ../man $RPM_BUILD_ROOT/usr/local/share/man
 
 %clean
 cd $RPM_BUILD_ROOT
 
-# %{_rpmfilename} is not expanded, so use
-# %{name}-%{version}-%{release}.%{buildarch}.rpm
-RPMFILE=%{name}-%{version}-%{release}.%{buildarch}.rpm
-TMPFILE=%{name}-%{version}.tmp$$
-find . | sed -e 's|^\.||g' -e 's|^$||g' | sort | grep -v $TMPFILE > $TMPFILE
+check_filesystem_dirs() {
+       RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
+       TMPFILE=$(mktemp)
+       find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort > $TMPFILE
 
-# find finds also '.', so use option -B for diff
-if rpm -qpl %{_rpmdir}/$RPMFILE | grep -v '^/$' | sort | diff -uB $TMPFILE - ; then
-       rm -rf $RPM_BUILD_ROOT
-else
-       echo -e "\nNot so good, some directories are not included in package\n"
-       exit 1;
-fi
+       # find finds also '.', so use option -B for diff
+       if rpm -qpl %{_rpmdir}/$RPMFILE | grep -v '^/$' | LC_ALL=C sort | diff -uB $TMPFILE - ; then
+               rm -rf $RPM_BUILD_ROOT
+       else
+               echo -e "\nNot so good, some directories are not included in package\n"
+               exit 1
+       fi
+       rm -f $TMPFILE
+}
+check_filesystem_dirs
+
+# XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
+%post -p <lua>
+posix.chown("/var/mail", 0, %{gid_mail})
+posix.chown("/var/lock", 0, %{gid_uucp})
 
 %files
 %defattr(644,root,root,755)
 %dir /
-/bin
-/boot
-/dev
+%dir /bin
+%dir /boot
+%dir /dev
 %dir /etc
-%dir %{_sysconfdir}/X11
-%dir %{_sysconfdir}/opt
-%attr(751,root,root) %dir /etc/security
+%dir /etc/X11
+%dir /etc/opt
 %dir /home
-/home/users
-%attr(751,root,root) /home/services
-/lib
-/mnt
-/opt
-%attr(555,root,proc) %verify(not group) /proc
-%attr(700,root,root) /root
+%dir /lib
+%dir /lib/modules
+%dir %attr(775,root,root) /media
+%dir %attr(775,root,root) %verify(not group) /media/floppy
+%dir %attr(775,root,root) %verify(not group) /media/cdrom
+%dir /mnt
+%dir /opt
+%dir %attr(555,root,root) %verify(not group) /proc
+%dir %attr(700,root,root) /root
+%dir %attr(700,root,root) /root/tmp
 %dir /sbin
-%attr(1777,root,root) /tmp
-%dir %{_prefix}
-%{_prefix}/bin
-%{_prefix}/games
-%{_prefix}/include
-%{_prefix}/lib
-%{_prefix}/sbin
-%dir %{_prefix}/share
-%{_datadir}/dict
-%{_datadir}/doc
-%{_fontsdir}
-%{_datadir}/games
-%{_datadir}/info
-%dir %{_mandir}
-%dir %{_mandir}/man*
-%lang(bg) %{_mandir}/bg
-%lang(cs) %{_mandir}/cs
-%lang(da) %{_mandir}/da
-%lang(de) %{_mandir}/de
-%lang(es) %{_mandir}/es
-%lang(fi) %{_mandir}/fi
-%lang(fr) %{_mandir}/fr
-%lang(hr) %{_mandir}/hr
-%lang(hu) %{_mandir}/hu
-%lang(id) %{_mandir}/id
-%lang(it) %{_mandir}/it
-%lang(ja) %{_mandir}/ja
-%lang(ko) %{_mandir}/ko
-%lang(nl) %{_mandir}/nl
-%lang(pl) %{_mandir}/pl
-%lang(pt) %{_mandir}/pt
-%lang(pt_BR) %{_mandir}/pt_BR
-%lang(ru) %{_mandir}/ru
-%lang(sl) %{_mandir}/sl
-%lang(sk) %{_mandir}/sk
-%lang(sv) %{_mandir}/sv
-%{_datadir}/misc
-%{_datadir}/tmac
-%{_prefix}/src
-%dir %{_prefix}/local
-%{_prefix}/local/bin
-%{_prefix}/local/games
-%{_prefix}/local/lib
-%{_prefix}/local/sbin
-%dir %{_prefix}/local/share
-%{_prefix}/local/share/doc
-%{_prefix}/local/share/info
+%dir %attr(755,root,root) /srv
+%dir %attr(1777,root,root) /tmp
+%dir /usr
+%dir /usr/bin
+%dir /usr/games
+%dir /usr/include
+%dir /usr/lib
+%dir /usr/lib/games
+%dir /usr/sbin
+%dir /usr/share
+%dir /usr/share/dict
+%dir /usr/share/doc
+%dir /usr/share/games
+%dir /usr/share/info
+%dir /usr/share/man
+%dir /usr/share/man/man[1-8]
+%lang(bg) /usr/share/man/bg
+%lang(ca) /usr/share/man/ca
+%lang(cs) /usr/share/man/cs
+%lang(da) /usr/share/man/da
+%lang(de) /usr/share/man/de
+%lang(el) /usr/share/man/el
+%lang(eo) /usr/share/man/eo
+%lang(es) /usr/share/man/es
+%lang(fi) /usr/share/man/fi
+%lang(fr) /usr/share/man/fr
+%lang(gl) /usr/share/man/gl
+%lang(hr) /usr/share/man/hr
+%lang(hu) /usr/share/man/hu
+%lang(id) /usr/share/man/id
+%lang(it) /usr/share/man/it
+%lang(ja) /usr/share/man/ja
+%lang(ko) /usr/share/man/ko
+%lang(lt) /usr/share/man/lt
+%lang(nl) /usr/share/man/nl
+%lang(pl) /usr/share/man/pl
+%lang(pt) /usr/share/man/pt
+%lang(pt_BR) /usr/share/man/pt_BR
+%lang(ro) /usr/share/man/ro
+%lang(ru) /usr/share/man/ru
+%lang(sl) /usr/share/man/sl
+%lang(sk) /usr/share/man/sk
+%lang(sr) /usr/share/man/sr
+%lang(sv) /usr/share/man/sv
+%lang(tr) /usr/share/man/tr
+%lang(uk) /usr/share/man/uk
+%lang(zh_CN) /usr/share/man/zh_CN
+%lang(zh_TW) /usr/share/man/zh_TW
+%dir /usr/share/misc
+%dir /usr/share/tmac
+%dir /usr/share/xml
+%dir /usr/src
+%dir /usr/local
+%dir /usr/local/bin
+%dir /usr/local/etc
+%dir /usr/local/games
+%dir /usr/local/include
+%dir /usr/local/lib
+%dir /usr/local/sbin
+%dir /usr/local/share
+%dir /usr/local/share/doc
+%dir /usr/local/share/info
+/usr/local/share/man
 %{_locmandir}
-%{_prefix}/local/src
-%dir /usr/X11R6
-%dir %{_xmandir}
-%{_xmandir}/man*
-%lang(fr) %{_xmandir}/fr
-%dir /usr/X11R6/share
-/usr/X11R6/share/idl
-
+%dir /usr/local/src
 %dir /var
-/var/cache
+%dir /var/cache
 %dir /var/crash
 %dir /var/db
 %dir /var/games
 %dir /var/lib
 %dir /var/lib/misc
-/var/lock
-%attr(751,root,root) /var/log
-%attr(775,root,mail) /var/mail
+%dir /var/local
+%dir %attr(1771,root,root) /var/lock
+%dir %attr(751,root,root) /var/log
+%dir %attr(2775,root,root) /var/mail
 %dir /var/opt
 %dir /var/run
 %dir /var/spool
-%attr(1777,root,root) %dir /var/tmp
+%dir /var/yp
+%dir %attr(1777,root,root) /var/tmp
+%if "%{_lib}" == "lib64"
+%dir /lib64
+%dir /usr/lib64
+%dir /usr/lib64/games
+%dir /usr/local/lib64
+%endif
This page took 0.05018 seconds and 4 git commands to generate.