2 # - revise and update to 3.0:
3 # - https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
4 # - http://www.linuxfoundation.org/collaborate/workgroups/lsb/fhs
6 # - don't use %{_*dir} macros for paths defined by FHS
7 # - do not add any dependencies to this pkg, FHS should be the first package being installed
8 # - do not use any other user/group than "root", as then we have to depend on "setup" package.
9 Summary: Basic FHS 2.3 filesystem layout
10 Summary(de.UTF-8): Grundlegende Dateisystemstruktur
11 Summary(fr.UTF-8): Arborescence de base du système de fichiers
12 Summary(pl.UTF-8): Podstawowy układ katalogów systemu Linux zgodny z FHS 2.3
13 Summary(tr.UTF-8): Temel dosya sistemi yapısı
19 URL: http://www.pathname.com/fhs/
22 BuildRequires: rpmbuild(macros) >= 1.213
23 Conflicts: setup < 2.7
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 # nothing to put there
27 %define _enable_debug_packages 0
29 %if "%{_lib}" == "lib64"
32 %if "%{_lib}" == "libx32"
37 # x32 as additional ABI
42 # avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
43 %define __spec_clean_body %{nil}
45 %define _locmandir /usr/local/man
47 # doesn't contain any files, but we're not noarch package
48 %define no_install_post_strip 1
49 %define no_install_post_chrpath 1
50 %define no_install_post_compress_modules 1
52 # we have to use numeric uids/groups. see comment above
58 This package contains the basic directory layout for a Linux system,
59 including the proper permissions for the directories. This layout
60 conforms to the Filesystem Hierarchy Standard (FHS) 2.3.
62 %description -l de.UTF-8
63 Dieses Paket enthält die grundlegende Verzeichnisstruktur eines
64 Linux-Systems, einschließlich der entsprechenden Zugriffsrechte. Diese
65 Struktur entspricht dem Filesystem Hierarchy Standard (FHS) 2.3.
67 %description -l fr.UTF-8
68 Ce package contient l'arborescence type pour système Linux y compris
69 les permissions adéquates pour les répertoires. Cette arborescence est
70 conforme au standard "Filesystem Hierarchy Standard" (FHS) 2.3.
72 %description -l pl.UTF-8
73 Pakiet ten zawiera informacje o podstawowej strukturze katalogów
74 systemu i praw dostępu do nich. Struktura katalogów jest zgodna z FHS
82 rm -rf $RPM_BUILD_ROOT
85 $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,srv} \
86 $RPM_BUILD_ROOT/etc/{X11,opt} \
87 $RPM_BUILD_ROOT/lib/modules \
88 $RPM_BUILD_ROOT/{mnt,media,proc,root/tmp,sbin,tmp} \
89 $RPM_BUILD_ROOT/usr/{bin,games,include,lib,sbin,share,src} \
90 $RPM_BUILD_ROOT/usr/share/{dict,doc,games,info,misc,tmac,xml} \
91 $RPM_BUILD_ROOT/usr/lib/games \
92 $RPM_BUILD_ROOT/usr/local/{bin,etc,games,include,lib,sbin,share/{doc,info},src} \
93 $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/misc,local,lock,log,mail,opt,run,spool,tmp,yp}
96 install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
99 install -d $RPM_BUILD_ROOT{/libx32,/usr/libx32/games,/usr/local/libx32}
102 install -d $RPM_BUILD_ROOT/usr/share/man/man{1,2,3,4,5,6,7,8}
103 install -d $RPM_BUILD_ROOT%{_locmandir}/man{1,2,3,4,5,6,7,8}
105 # "/usr/local/share/man and /usr/local/man must be synonomous" per FHS 2.3
106 ln -sf ../man $RPM_BUILD_ROOT/usr/local/share/man
109 for mloc in $(cat locale-dirs); do
110 echo "%%lang($mloc) %dir /usr/share/man/${mloc}" >> %{name}.lang
111 for manp in man{1,2,3,4,5,6,7,8}; do
112 install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp}
113 echo "%%lang($mloc) %dir /usr/share/man/${mloc}/${manp}" >> %{name}.lang
120 check_filesystem_dirs() {
121 RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
123 find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort > $TMPFILE
125 # find finds also '.', so use option -B for diff
126 if rpm -qpl %{_rpmdir}/$RPMFILE | grep -v '^/$' | LC_ALL=C sort | diff -uB $TMPFILE - ; then
127 rm -rf $RPM_BUILD_ROOT
129 echo -e "\nNot so good, some directories are not included in package\n"
134 check_filesystem_dirs
136 # XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
138 posix.chown("/var/mail", 0, %{gid_mail})
139 posix.chown("/var/lock", 0, %{gid_uucp})
141 %files -f %{name}.lang
142 %defattr(644,root,root,755)
156 %dir %attr(555,root,root) %verify(not group) /proc
157 %dir %attr(700,root,root) /root
158 %dir %attr(700,root,root) /root/tmp
160 %dir %attr(755,root,root) /srv
161 %dir %attr(1777,root,root) /tmp
172 %dir /usr/share/games
175 %dir /usr/share/man/man[1-8]
183 %dir /usr/local/games
184 %dir /usr/local/include
187 %dir /usr/local/share
188 %dir /usr/local/share/doc
189 %dir /usr/local/share/info
201 %dir %attr(1771,root,root) /var/lock
202 %dir %attr(751,root,root) /var/log
203 %dir %attr(2775,root,root) /var/mail
208 %dir %attr(1777,root,root) /var/tmp
212 %dir /usr/lib64/games
213 %dir /usr/local/lib64
218 %dir /usr/libx32/games
219 %dir /usr/local/libx32