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 # But: root %attr+chown in %post means integrity verification (rpm -V) error.
6 # Maybe use non-root %attr+numeric chown in %post (without setup dependency)? The only disadvantage
7 # seems to be a warning message on install.
8 Summary: Basic FHS 3.0 filesystem layout
9 Summary(de.UTF-8): Grundlegende Dateisystemstruktur
10 Summary(fr.UTF-8): Arborescence de base du système de fichiers
11 Summary(pl.UTF-8): Podstawowy układ katalogów systemu Linux zgodny z FHS 3.0
12 Summary(tr.UTF-8): Temel dosya sistemi yapısı
18 URL: http://refspecs.linuxfoundation.org/fhs.shtml
19 # list of languages for localized man pages directories
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 # doesn't contain any files, but we're not noarch package
46 %define no_install_post_strip 1
47 %define no_install_post_chrpath 1
48 %define no_install_post_compress_modules 1
50 # we have to use numeric uids/groups. see comment above
55 This package contains the basic directory layout for a Linux system,
56 including the proper permissions for the directories. This layout
57 conforms to the Filesystem Hierarchy Standard (FHS) %{version}.
59 %description -l de.UTF-8
60 Dieses Paket enthält die grundlegende Verzeichnisstruktur eines
61 Linux-Systems, einschließlich der entsprechenden Zugriffsrechte. Diese
62 Struktur entspricht dem Filesystem Hierarchy Standard (FHS) %{version}.
64 %description -l fr.UTF-8
65 Ce package contient l'arborescence type pour système Linux y compris
66 les permissions adéquates pour les répertoires. Cette arborescence est
67 conforme au standard "Filesystem Hierarchy Standard" (FHS) %{version}.
69 %description -l pl.UTF-8
70 Pakiet ten zawiera informacje o podstawowej strukturze katalogów
71 systemu i praw dostępu do nich. Struktura katalogów jest zgodna z FHS
75 Summary: Debug information directory hierarchy
76 Summary(pl.UTF-8): Hierarchia katalogów dla informacji diagnostycznych
77 Group: Development/Debug
80 This package provides directory hierarchy for debug information
81 contained in debuginfo rpm packages.
83 %description debug -l pl.UTF-8
84 Ten pakiet dostarcza hierarchię katalogów dla zawarych w pakietach
85 RPM debuginfo informacji pozwalających na śledzenie programów.
92 rm -rf $RPM_BUILD_ROOT
95 $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,run,srv,sys} \
96 $RPM_BUILD_ROOT/etc/{X11,opt} \
97 $RPM_BUILD_ROOT/lib/modules \
98 $RPM_BUILD_ROOT/{mnt,media,proc,root/tmp,sbin,tmp} \
99 $RPM_BUILD_ROOT/usr/{bin,games,include,lib,libexec,sbin,share,src} \
100 $RPM_BUILD_ROOT/usr/share/{color/icc,dict,doc,games,info,misc,ppd,tmac,xml} \
101 $RPM_BUILD_ROOT/usr/lib/games \
102 $RPM_BUILD_ROOT/usr/local/{bin,etc,games,include,lib,libexec,sbin,share/{color/icc,doc,info,man},src} \
103 $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/{color/icc,misc},local,lock,log,mail,opt,run,spool,tmp,yp}
106 install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
109 install -d $RPM_BUILD_ROOT{/libx32,/usr/libx32/games,/usr/local/libx32}
112 install -d $RPM_BUILD_ROOT/usr/share/man/man{1,2,3,4,5,6,7,8}
113 install -d $RPM_BUILD_ROOT/usr/local/share/man/man{1,2,3,4,5,6,7,8}
115 for i in $(seq 0 255); do
116 install -d "$RPM_BUILD_ROOT$(printf '/usr/lib/.build-id/%02x' $i)"
120 for mloc in $(cat locale-dirs); do
121 echo "%%lang($mloc) %dir /usr/share/man/${mloc}" >> %{name}.lang
122 for manp in man{1,2,3,4,5,6,7,8}; do
123 install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp}
124 echo "%%lang($mloc) %dir /usr/share/man/${mloc}/${manp}" >> %{name}.lang
131 check_filesystem_dirs() {
132 RPMFILES="%{_rpmdir}/%{name}-%{version}-%{release}.%{_target_cpu}.rpm %{_rpmdir}/%{name}-debug-%{version}-%{release}.%{_target_cpu}.rpm"
134 find | sed -e 's|^\.||g' -e '/^$/d' | LC_ALL=C sort > $TMPFILE
136 if rpm -qpl $RPMFILES | grep -v '^/$' | LC_ALL=C sort | diff -u $TMPFILE - ; then
137 rm -rf $RPM_BUILD_ROOT
139 echo -e "\nNot so good, some directories are not included in package\n"
144 check_filesystem_dirs
147 st = posix.stat("/usr/local/share/man")
148 if st and st.type == "link" then
149 os.remove("/usr/local/share/man")
153 --# XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
154 posix.chown("/var/mail", 0, %{gid_mail})
155 posix.chown("/var/lock", 0, %{gid_uucp})
157 %files -f %{name}.lang
158 %defattr(644,root,root,755)
172 %dir %attr(555,root,root) %verify(not group) /proc
173 %dir %attr(700,root,root) /root
174 %dir %attr(700,root,root) /root/tmp
177 %dir %attr(755,root,root) /srv
178 %dir %attr(555,root,root) /sys
179 %dir %attr(1777,root,root) /tmp
189 %dir /usr/share/color
190 %dir /usr/share/color/icc
193 %dir /usr/share/games
196 %dir /usr/share/man/man[1-8]
205 %dir /usr/local/games
206 %dir /usr/local/include
208 %dir /usr/local/libexec
210 %dir /usr/local/share
211 %dir /usr/local/share/color
212 %dir /usr/local/share/color/icc
213 %dir /usr/local/share/doc
214 %dir /usr/local/share/info
215 %dir /usr/local/share/man
216 %dir /usr/local/share/man/man[1-8]
225 %dir /var/lib/color/icc
228 %dir %attr(1771,root,root) /var/lock
229 %dir %attr(751,root,root) /var/log
230 %dir %attr(2775,root,root) /var/mail
235 %dir %attr(1777,root,root) /var/tmp
239 %dir /usr/lib64/games
240 %dir /usr/local/lib64
245 %dir /usr/libx32/games
246 %dir /usr/local/libx32
250 %defattr(644,root,root,755)
251 %dir /usr/lib/.build-id
252 %dir /usr/lib/.build-id/[0-9a-f][0-9a-f]