2 # - don't use %{_*dir} macros for paths defined by FHS
3 # - do not add any dependencies to this pkg, FHS should be the first package being installed
4 # - do not use any other user/group than "root", as then we have to depend on "setup" package.
5 Summary: Basic FHS 2.3 filesystem layout
6 Summary(de.UTF-8): Grundlegende Dateisystemstruktur
7 Summary(fr.UTF-8): Arborescence de base du système de fichiers
8 Summary(pl.UTF-8): Podstawowy układ katalogów systemu Linux zgodny z FHS 2.3
9 Summary(tr.UTF-8): Temel dosya sistemi yapısı
15 URL: http://www.pathname.com/fhs/
18 BuildRequires: rpmbuild(macros) >= 1.213
19 Conflicts: setup < 2.7
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 # nothing to put there
23 %define _enable_debug_packages 0
25 # avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
26 %define __spec_clean_body %{nil}
28 %define _locmandir /usr/local/man
30 # doesn't contain any files, but we're not noarch package
31 %define no_install_post_strip 1
32 %define no_install_post_chrpath 1
33 %define no_install_post_compress_modules 1
35 # we have to use numeric uids/groups. see comment above
41 This package contains the basic directory layout for a Linux system,
42 including the proper permissions for the directories. This layout
43 conforms to the Filesystem Hierarchy Standard (FHS) 2.3.
45 %description -l de.UTF-8
46 Dieses Paket enthält die grundlegende Verzeichnisstruktur eines
47 Linux-Systems, einschließlich der entsprechenden Zugriffsrechte. Diese
48 Struktur entspricht dem Filesystem Hierarchy Standard (FHS) 2.3.
50 %description -l fr.UTF-8
51 Ce package contient l'arborescence type pour système Linux y compris
52 les permissions adéquates pour les répertoires. Cette arborescence est
53 conforme au standard "Filesystem Hierarchy Standard" (FHS) 2.3.
55 %description -l pl.UTF-8
56 Pakiet ten zawiera informacje o podstawowej strukturze katalogów
57 systemu i praw dostępu do nich. Struktura katalogów jest zgodna z FHS
60 %description -l tr.UTF-8
61 Bu paket GNU makro işleme dilini içerir. Mantıksal olarak
62 ayrıştırılabilen metin dosyaları yazımı için yararlıdır.
69 rm -rf $RPM_BUILD_ROOT
72 $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,srv} \
73 $RPM_BUILD_ROOT/etc/{X11,opt} \
74 $RPM_BUILD_ROOT/lib/modules \
75 $RPM_BUILD_ROOT/{mnt,media/{cdrom,floppy},proc,root/tmp,sbin,tmp} \
76 $RPM_BUILD_ROOT/usr/{bin,games,include,lib,sbin,share,src} \
77 $RPM_BUILD_ROOT/usr/share/{dict,doc,games,info,misc,tmac,xml} \
78 $RPM_BUILD_ROOT/usr/lib/games \
79 $RPM_BUILD_ROOT/usr/local/{bin,etc,games,include,lib,sbin,share/{doc,info},src} \
80 $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/misc,local,lock,log,mail,opt,run,spool,tmp,yp}
82 %if "%{_lib}" == "lib64"
83 install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
86 install -d $RPM_BUILD_ROOT/usr/share/man/man{1,2,3,4,5,6,7,8}
87 install -d $RPM_BUILD_ROOT%{_locmandir}/man{1,2,3,4,5,6,7,8}
89 # "/usr/local/share/man and /usr/local/man must be synonomous" per FHS 2.3
90 ln -sf ../man $RPM_BUILD_ROOT/usr/local/share/man
93 for mloc in $(cat locale-dirs); do
94 echo "%%lang($mloc) %dir /usr/share/man/${mloc}" >> %{name}.lang
95 for manp in man{1,2,3,4,5,6,7,8}; do
96 install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp}
97 echo "%%lang($mloc) %dir /usr/share/man/${mloc}/${manp}" >> %{name}.lang
104 check_filesystem_dirs() {
105 RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
107 find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort > $TMPFILE
109 # find finds also '.', so use option -B for diff
110 if rpm -qpl %{_rpmdir}/$RPMFILE | grep -v '^/$' | LC_ALL=C sort | diff -uB $TMPFILE - ; then
111 rm -rf $RPM_BUILD_ROOT
113 echo -e "\nNot so good, some directories are not included in package\n"
118 check_filesystem_dirs
120 # XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
122 posix.chown("/var/mail", 0, %{gid_mail})
123 posix.chown("/var/lock", 0, %{gid_uucp})
125 %files -f %{name}.lang
126 %defattr(644,root,root,755)
137 %dir %attr(775,root,root) /media
138 %dir %attr(775,root,root) %verify(not group) /media/floppy
139 %dir %attr(775,root,root) %verify(not group) /media/cdrom
142 %dir %attr(555,root,root) %verify(not group) /proc
143 %dir %attr(700,root,root) /root
144 %dir %attr(700,root,root) /root/tmp
146 %dir %attr(755,root,root) /srv
147 %dir %attr(1777,root,root) /tmp
158 %dir /usr/share/games
161 %dir /usr/share/man/man[1-8]
169 %dir /usr/local/games
170 %dir /usr/local/include
173 %dir /usr/local/share
174 %dir /usr/local/share/doc
175 %dir /usr/local/share/info
187 %dir %attr(1771,root,root) /var/lock
188 %dir %attr(751,root,root) /var/log
189 %dir %attr(2775,root,root) /var/mail
194 %dir %attr(1777,root,root) /var/tmp
195 %if "%{_lib}" == "lib64"
198 %dir /usr/lib64/games
199 %dir /usr/local/lib64