]> git.pld-linux.org Git - packages/FHS.git/blob - FHS.spec
- updated to FHS 3.0 specs
[packages/FHS.git] / FHS.spec
1 # TODO
2 # - provide -doc-text, -doc-pdf, -doc-html as offline reference for the spec
3 # NOTE
4 # - don't use %{_*dir} macros for paths defined by FHS
5 # - do not add any dependencies to this pkg, FHS should be the first package being installed
6 # - do not use any other user/group than "root", as then we have to depend on "setup" package.
7 #   But: root %attr+chown in %post means integrity verification (rpm -V) error.
8 #   Maybe use non-root %attr+numeric chown in %post (without setup dependency)? The only disadvantage
9 #   seems to be a warning message on install.
10 Summary:        Basic FHS %{version} filesystem layout
11 Summary(de.UTF-8):      Grundlegende Dateisystemstruktur
12 Summary(fr.UTF-8):      Arborescence de base du système de fichiers
13 Summary(pl.UTF-8):      Podstawowy układ katalogów systemu Linux zgodny z FHS %{version}
14 Summary(tr.UTF-8):      Temel dosya sistemi yapısı
15 Name:           FHS
16 Version:        3.0
17 Release:        1
18 License:        GPL
19 Group:          Base
20 URL:            http://refspecs.linuxfoundation.org/fhs.shtml
21 # list of languages for localized man pages directories
22 Source0:        locale-dirs
23 BuildRequires:  mktemp
24 BuildRequires:  rpmbuild(macros) >= 1.213
25 Conflicts:      setup < 2.7
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 # nothing to put there
29 %define         _enable_debug_packages  0
30
31 %if "%{_lib}" == "lib64"
32 %define         with_lib64      1
33 %endif
34 %if "%{_lib}" == "libx32"
35 %define         with_libx32     1
36 %define         with_lib64      1
37 %else
38 %ifarch %{x8664}
39 # x32 as additional ABI
40 %define         with_libx32     1
41 %endif
42 %endif
43
44 # avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
45 %define         __spec_clean_body       %{nil}
46
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
51
52 # we have to use numeric uids/groups. see comment above
53
54 %define         gid_uucp        14
55 %define         gid_mail        12
56
57 %description
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) %{version}.
61
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) %{version}.
66
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) %{version}.
71
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
75 %{version}.
76
77 %prep
78 %setup -qcT
79 cp -a %{SOURCE0} .
80
81 %install
82 rm -rf $RPM_BUILD_ROOT
83
84 install -d \
85         $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,run,srv,sys} \
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/{color/icc,dict,doc,games,info,misc,ppd,tmac,xml} \
91         $RPM_BUILD_ROOT/usr/lib/games \
92         $RPM_BUILD_ROOT/usr/local/{bin,etc,games,include,lib,sbin,share/{color/icc,doc,info,man},src} \
93         $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/{color,misc},local,lock,log,mail,opt,run,spool,tmp,yp}
94
95 %if %{with lib64}
96 install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
97 %endif
98 %if %{with libx32}
99 install -d $RPM_BUILD_ROOT{/libx32,/usr/libx32/games,/usr/local/libx32}
100 %endif
101
102 install -d $RPM_BUILD_ROOT/usr/share/man/man{1,2,3,4,5,6,7,8}
103 install -d $RPM_BUILD_ROOT/usr/local/share/man/man{1,2,3,4,5,6,7,8}
104
105 > %{name}.lang
106 for mloc in $(cat locale-dirs); do
107         echo "%%lang($mloc) %dir /usr/share/man/${mloc}" >> %{name}.lang
108         for manp in man{1,2,3,4,5,6,7,8}; do
109                 install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp}
110                 echo "%%lang($mloc) %dir /usr/share/man/${mloc}/${manp}" >> %{name}.lang
111         done
112 done
113
114 %clean
115 cd $RPM_BUILD_ROOT
116
117 check_filesystem_dirs() {
118         RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
119         TMPFILE=$(mktemp)
120         find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort > $TMPFILE
121
122         # find finds also '.', so use option -B for diff
123         if rpm -qpl %{_rpmdir}/$RPMFILE | grep -v '^/$' | LC_ALL=C sort | diff -uB $TMPFILE - ; then
124                 rm -rf $RPM_BUILD_ROOT
125         else
126                 echo -e "\nNot so good, some directories are not included in package\n"
127                 exit 1
128         fi
129         rm -f $TMPFILE
130 }
131 check_filesystem_dirs
132
133 %pretrans -p <lua>
134 if posix.stat("/usr/local/share/man", "type") == "link" then os.remove("/usr/local/share/man") end
135
136 # XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
137 %post -p <lua>
138 posix.chown("/var/mail", 0, %{gid_mail})
139 posix.chown("/var/lock", 0, %{gid_uucp})
140
141 %files -f %{name}.lang
142 %defattr(644,root,root,755)
143 %dir /
144 %dir /bin
145 %dir /boot
146 %dir /dev
147 %dir /etc
148 %dir /etc/X11
149 %dir /etc/opt
150 %dir /home
151 %dir /lib
152 %dir /lib/modules
153 %dir /media
154 %dir /mnt
155 %dir /opt
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
159 %dir /run
160 %dir /sbin
161 %dir %attr(755,root,root) /srv
162 %dir /sys
163 %dir %attr(1777,root,root) /tmp
164 %dir /usr
165 %dir /usr/bin
166 %dir /usr/games
167 %dir /usr/include
168 %dir /usr/lib
169 %dir /usr/lib/games
170 %dir /usr/sbin
171 %dir /usr/share
172 %dir /usr/share/color
173 %dir /usr/share/color/icc
174 %dir /usr/share/dict
175 %dir /usr/share/doc
176 %dir /usr/share/games
177 %dir /usr/share/info
178 %dir /usr/share/man
179 %dir /usr/share/man/man[1-8]
180 %dir /usr/share/misc
181 %dir /usr/share/ppd
182 %dir /usr/share/tmac
183 %dir /usr/share/xml
184 %dir /usr/src
185 %dir /usr/local
186 %dir /usr/local/bin
187 %dir /usr/local/etc
188 %dir /usr/local/games
189 %dir /usr/local/include
190 %dir /usr/local/lib
191 %dir /usr/local/sbin
192 %dir /usr/local/share
193 %dir /usr/local/share/color
194 %dir /usr/local/share/color/icc
195 %dir /usr/local/share/doc
196 %dir /usr/local/share/info
197 %dir /usr/local/share/man
198 %dir /usr/local/share/man/man[1-8]
199 %dir /usr/local/src
200 %dir /var
201 %dir /var/cache
202 %dir /var/crash
203 %dir /var/db
204 %dir /var/games
205 %dir /var/lib
206 %dir /var/lib/color
207 %dir /var/lib/color/icc
208 %dir /var/lib/misc
209 %dir /var/local
210 %dir %attr(1771,root,root) /var/lock
211 %dir %attr(751,root,root) /var/log
212 %dir %attr(2775,root,root) /var/mail
213 %dir /var/opt
214 %dir /var/run
215 %dir /var/spool
216 %dir /var/yp
217 %dir %attr(1777,root,root) /var/tmp
218 %if %{with lib64}
219 %dir /lib64
220 %dir /usr/lib64
221 %dir /usr/lib64/games
222 %dir /usr/local/lib64
223 %endif
224 %if %{with libx32}
225 %dir /libx32
226 %dir /usr/libx32
227 %dir /usr/libx32/games
228 %dir /usr/local/libx32
229 %endif
This page took 0.111111 seconds and 4 git commands to generate.