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/
17 BuildRequires: rpmbuild(macros) >= 1.213
18 Conflicts: setup < 2.7
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 # nothing to put there
22 %define _enable_debug_packages 0
24 # avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
25 %define __spec_clean_body %{nil}
27 %define _locmandir /usr/local/man
29 # doesn't contain any files, but we're not noarch package
30 %define no_install_post_strip 1
31 %define no_install_post_chrpath 1
32 %define no_install_post_compress_modules 1
34 # we have to use numeric uids/groups. see comment above
40 This package contains the basic directory layout for a Linux system,
41 including the proper permissions for the directories. This layout
42 conforms to the Filesystem Hierarchy Standard (FHS) 2.3.
44 %description -l de.UTF-8
45 Dieses Paket enthält die grundlegende Verzeichnisstruktur eines
46 Linux-Systems, einschließlich der entsprechenden Zugriffsrechte. Diese
47 Struktur entspricht dem Filesystem Hierarchy Standard (FHS) 2.3.
49 %description -l fr.UTF-8
50 Ce package contient l'arborescence type pour système Linux y compris
51 les permissions adéquates pour les répertoires. Cette arborescence est
52 conforme au standard "Filesystem Hierarchy Standard" (FHS) 2.3.
54 %description -l pl.UTF-8
55 Pakiet ten zawiera informacje o podstawowej strukturze katalogów
56 systemu i praw dostępu do nich. Struktura katalogów jest zgodna z FHS
59 %description -l tr.UTF-8
60 Bu paket GNU makro işleme dilini içerir. Mantıksal olarak
61 ayrıştırılabilen metin dosyaları yazımı için yararlıdır.
66 rm -rf $RPM_BUILD_ROOT
69 $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,srv} \
70 $RPM_BUILD_ROOT/etc/{X11,opt} \
71 $RPM_BUILD_ROOT/lib/modules \
72 $RPM_BUILD_ROOT/{mnt,media/{cdrom,floppy},proc,root,sbin,tmp} \
73 $RPM_BUILD_ROOT/usr/{bin,games,include,lib,sbin,share,src} \
74 $RPM_BUILD_ROOT/usr/share/{dict,doc,games,info,misc,tmac,xml} \
75 $RPM_BUILD_ROOT/usr/lib/games \
76 $RPM_BUILD_ROOT/usr/local/{bin,etc,games,include,lib,sbin,share/{doc,info},src} \
77 $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/misc,local,lock,log,mail,opt,run,spool,tmp,yp}
79 %if "%{_lib}" == "lib64"
80 install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
83 for manp in man{1,2,3,4,5,6,7,8} ; do
84 install -d $RPM_BUILD_ROOT/usr/share/man/${manp}
85 install -d $RPM_BUILD_ROOT%{_locmandir}/${manp}
86 for mloc in bg ca cs da de el eo es fi fr gl hr hu id it ja ko lt nl \
87 pl pt pt_BR ro ru sk sl sr sv tr uk zh_CN zh_TW ; do
88 install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp}
92 # "/usr/local/share/man and /usr/local/man must be synonomous" per FHS 2.3
93 ln -sf ../man $RPM_BUILD_ROOT/usr/local/share/man
98 check_filesystem_dirs() {
99 RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
101 find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort > $TMPFILE
103 # find finds also '.', so use option -B for diff
104 if rpm -qpl %{_rpmdir}/$RPMFILE | grep -v '^/$' | LC_ALL=C sort | diff -uB $TMPFILE - ; then
105 rm -rf $RPM_BUILD_ROOT
107 echo -e "\nNot so good, some directories are not included in package\n"
112 check_filesystem_dirs
114 # XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
116 posix.chown("/var/mail", 0, %{gid_mail})
117 posix.chown("/var/lock", 0, %{gid_uucp})
120 %defattr(644,root,root,755)
131 %dir %attr(775,root,root) /media
132 %dir %attr(775,root,root) %verify(not group) /media/floppy
133 %dir %attr(775,root,root) %verify(not group) /media/cdrom
136 %dir %attr(555,root,root) %verify(not group) /proc
137 %dir %attr(700,root,root) /root
139 %dir %attr(755,root,root) /srv
140 %dir %attr(1777,root,root) /tmp
151 %dir /usr/share/games
154 %dir /usr/share/man/man[1-8]
155 %lang(bg) /usr/share/man/bg
156 %lang(ca) /usr/share/man/ca
157 %lang(cs) /usr/share/man/cs
158 %lang(da) /usr/share/man/da
159 %lang(de) /usr/share/man/de
160 %lang(el) /usr/share/man/el
161 %lang(eo) /usr/share/man/eo
162 %lang(es) /usr/share/man/es
163 %lang(fi) /usr/share/man/fi
164 %lang(fr) /usr/share/man/fr
165 %lang(gl) /usr/share/man/gl
166 %lang(hr) /usr/share/man/hr
167 %lang(hu) /usr/share/man/hu
168 %lang(id) /usr/share/man/id
169 %lang(it) /usr/share/man/it
170 %lang(ja) /usr/share/man/ja
171 %lang(ko) /usr/share/man/ko
172 %lang(lt) /usr/share/man/lt
173 %lang(nl) /usr/share/man/nl
174 %lang(pl) /usr/share/man/pl
175 %lang(pt) /usr/share/man/pt
176 %lang(pt_BR) /usr/share/man/pt_BR
177 %lang(ro) /usr/share/man/ro
178 %lang(ru) /usr/share/man/ru
179 %lang(sl) /usr/share/man/sl
180 %lang(sk) /usr/share/man/sk
181 %lang(sr) /usr/share/man/sr
182 %lang(sv) /usr/share/man/sv
183 %lang(tr) /usr/share/man/tr
184 %lang(uk) /usr/share/man/uk
185 %lang(zh_CN) /usr/share/man/zh_CN
186 %lang(zh_TW) /usr/share/man/zh_TW
194 %dir /usr/local/games
195 %dir /usr/local/include
198 %dir /usr/local/share
199 %dir /usr/local/share/doc
200 %dir /usr/local/share/info
212 %dir %attr(1771,root,root) /var/lock
213 %dir %attr(751,root,root) /var/log
214 %dir %attr(2775,root,root) /var/mail
219 %dir %attr(1777,root,root) /var/tmp
220 %if "%{_lib}" == "lib64"
223 %dir /usr/lib64/games
224 %dir /usr/local/lib64