]>
Commit | Line | Data |
---|---|---|
2fccd05c ER |
1 | # NOTE |
2 | # - don't use %{_*dir} macros for paths defined by FHS | |
05fbeea7 ER |
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. | |
4e9a06c3 JB |
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. | |
d6daf6dc | 8 | Summary: Basic FHS 3.0 filesystem layout |
d280bbd7 ER |
9 | Summary(de.UTF-8): Grundlegende Dateisystemstruktur |
10 | Summary(fr.UTF-8): Arborescence de base du système de fichiers | |
d6daf6dc | 11 | Summary(pl.UTF-8): Podstawowy układ katalogów systemu Linux zgodny z FHS 3.0 |
d280bbd7 | 12 | Summary(tr.UTF-8): Temel dosya sistemi yapısı |
b3b300be | 13 | Name: FHS |
4e9a06c3 | 14 | Version: 3.0 |
483f43b7 | 15 | Release: 6 |
15c9b486 | 16 | License: GPL |
17 | Group: Base | |
e38ba8ca | 18 | URL: http://refspecs.linuxfoundation.org/fhs.shtml |
4e9a06c3 | 19 | # list of languages for localized man pages directories |
38ec8b96 | 20 | Source0: locale-dirs |
2fccd05c | 21 | BuildRequires: mktemp |
73559f52 | 22 | BuildRequires: rpmbuild(macros) >= 1.213 |
05fbeea7 | 23 | Conflicts: setup < 2.7 |
8ad4c704 | 24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
15c9b486 | 25 | |
5a4e441c ER |
26 | # nothing to put there |
27 | %define _enable_debug_packages 0 | |
28 | ||
335736da JB |
29 | %if "%{_lib}" == "lib64" |
30 | %define with_lib64 1 | |
335736da JB |
31 | %endif |
32 | %if "%{_lib}" == "libx32" | |
33 | %define with_libx32 1 | |
57d439f5 | 34 | %define with_lib64 1 |
335736da JB |
35 | %else |
36 | %ifarch %{x8664} | |
37 | # x32 as additional ABI | |
38 | %define with_libx32 1 | |
39 | %endif | |
40 | %endif | |
41 | ||
5a4e441c ER |
42 | # avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency |
43 | %define __spec_clean_body %{nil} | |
44 | ||
6c95f275 | 45 | # doesn't contain any files, but we're not noarch package |
483f43b7 JR |
46 | %define no_install_post_strip 1 |
47 | %define no_install_post_chrpath 1 | |
48 | %define no_install_post_compress_modules 1 | |
0fa811e0 | 49 | |
05fbeea7 | 50 | # we have to use numeric uids/groups. see comment above |
05fbeea7 ER |
51 | %define gid_uucp 14 |
52 | %define gid_mail 12 | |
53 | ||
15c9b486 | 54 | %description |
aac153be | 55 | This package contains the basic directory layout for a Linux system, |
56 | including the proper permissions for the directories. This layout | |
4e9a06c3 | 57 | conforms to the Filesystem Hierarchy Standard (FHS) %{version}. |
15c9b486 | 58 | |
fdedb1f3 JR |
59 | %description -l de.UTF-8 |
60 | Dieses Paket enthält die grundlegende Verzeichnisstruktur eines | |
61 | Linux-Systems, einschließlich der entsprechenden Zugriffsrechte. Diese | |
4e9a06c3 | 62 | Struktur entspricht dem Filesystem Hierarchy Standard (FHS) %{version}. |
15c9b486 | 63 | |
fdedb1f3 JR |
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 | |
4e9a06c3 | 67 | conforme au standard "Filesystem Hierarchy Standard" (FHS) %{version}. |
15c9b486 | 68 | |
fdedb1f3 JR |
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 | |
4e9a06c3 | 72 | %{version}. |
aac153be | 73 | |
483f43b7 JR |
74 | %package debug |
75 | Summary: Debug information directory hierarchy | |
76 | Group: Development/Debug | |
77 | ||
78 | %description debug | |
79 | This package provides directory hierarchy for debug information | |
80 | contained in debuginfo rpm packages. | |
81 | ||
15c9b486 | 82 | %prep |
40188a0f | 83 | %setup -qcT |
c5fb118b | 84 | cp -p %{SOURCE0} . |
15c9b486 | 85 | |
86 | %install | |
87 | rm -rf $RPM_BUILD_ROOT | |
88 | ||
d8cf4cdf | 89 | install -d \ |
4e9a06c3 | 90 | $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,run,srv,sys} \ |
d8cf4cdf JB |
91 | $RPM_BUILD_ROOT/etc/{X11,opt} \ |
92 | $RPM_BUILD_ROOT/lib/modules \ | |
d13739ad | 93 | $RPM_BUILD_ROOT/{mnt,media,proc,root/tmp,sbin,tmp} \ |
17f3eba2 | 94 | $RPM_BUILD_ROOT/usr/{bin,games,include,lib,libexec,sbin,share,src} \ |
4e9a06c3 | 95 | $RPM_BUILD_ROOT/usr/share/{color/icc,dict,doc,games,info,misc,ppd,tmac,xml} \ |
d8cf4cdf | 96 | $RPM_BUILD_ROOT/usr/lib/games \ |
17f3eba2 | 97 | $RPM_BUILD_ROOT/usr/local/{bin,etc,games,include,lib,libexec,sbin,share/{color/icc,doc,info,man},src} \ |
c5fb118b | 98 | $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/{color/icc,misc},local,lock,log,mail,opt,run,spool,tmp,yp} |
d8cf4cdf | 99 | |
335736da | 100 | %if %{with lib64} |
d8cf4cdf | 101 | install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64} |
9d2de01c | 102 | %endif |
335736da | 103 | %if %{with libx32} |
9d2de01c | 104 | install -d $RPM_BUILD_ROOT{/libx32,/usr/libx32/games,/usr/local/libx32} |
76796e14 JB |
105 | %endif |
106 | ||
42b7266a | 107 | install -d $RPM_BUILD_ROOT/usr/share/man/man{1,2,3,4,5,6,7,8} |
4e9a06c3 | 108 | install -d $RPM_BUILD_ROOT/usr/local/share/man/man{1,2,3,4,5,6,7,8} |
9d1c44e3 | 109 | |
483f43b7 JR |
110 | for i in $(seq 0 255); do |
111 | install -d "$RPM_BUILD_ROOT$(printf '/usr/lib/.build-id/%02x' $i)" | |
112 | done | |
113 | ||
42b7266a ER |
114 | > %{name}.lang |
115 | for mloc in $(cat locale-dirs); do | |
116 | echo "%%lang($mloc) %dir /usr/share/man/${mloc}" >> %{name}.lang | |
117 | for manp in man{1,2,3,4,5,6,7,8}; do | |
118 | install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp} | |
119 | echo "%%lang($mloc) %dir /usr/share/man/${mloc}/${manp}" >> %{name}.lang | |
120 | done | |
121 | done | |
122 | ||
15c9b486 | 123 | %clean |
fa9aa6bf | 124 | cd $RPM_BUILD_ROOT |
0a75495b | 125 | |
2fccd05c | 126 | check_filesystem_dirs() { |
b68acde4 | 127 | RPMFILES="%{_rpmdir}/%{name}-%{version}-%{release}.%{_target_cpu}.rpm %{_rpmdir}/%{name}-debug-%{version}-%{release}.%{_target_cpu}.rpm" |
2fccd05c | 128 | TMPFILE=$(mktemp) |
e75de10d | 129 | find | sed -e 's|^\.||g' -e '/^$/d' | LC_ALL=C sort > $TMPFILE |
2fccd05c | 130 | |
b68acde4 | 131 | if rpm -qpl $RPMFILES | grep -v '^/$' | LC_ALL=C sort | diff -u $TMPFILE - ; then |
2fccd05c ER |
132 | rm -rf $RPM_BUILD_ROOT |
133 | else | |
134 | echo -e "\nNot so good, some directories are not included in package\n" | |
135 | exit 1 | |
136 | fi | |
137 | rm -f $TMPFILE | |
138 | } | |
139 | check_filesystem_dirs | |
15c9b486 | 140 | |
4e9a06c3 | 141 | %pretrans -p <lua> |
c5fb118b JB |
142 | st = posix.stat("/usr/local/share/man") |
143 | if st and st.type == "link" then | |
144 | os.remove("/usr/local/share/man") | |
145 | end | |
4e9a06c3 | 146 | |
05fbeea7 | 147 | %post -p <lua> |
c5fb118b | 148 | --# XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root? |
05fbeea7 ER |
149 | posix.chown("/var/mail", 0, %{gid_mail}) |
150 | posix.chown("/var/lock", 0, %{gid_uucp}) | |
151 | ||
42b7266a | 152 | %files -f %{name}.lang |
bfef5768 | 153 | %defattr(644,root,root,755) |
52e00ac5 | 154 | %dir / |
d8cf4cdf JB |
155 | %dir /bin |
156 | %dir /boot | |
157 | %dir /dev | |
2d4f80d5 | 158 | %dir /etc |
d8cf4cdf JB |
159 | %dir /etc/X11 |
160 | %dir /etc/opt | |
b9fc8087 | 161 | %dir /home |
d8cf4cdf JB |
162 | %dir /lib |
163 | %dir /lib/modules | |
d13739ad | 164 | %dir /media |
d8cf4cdf JB |
165 | %dir /mnt |
166 | %dir /opt | |
6c511447 ER |
167 | %dir %attr(555,root,root) %verify(not group) /proc |
168 | %dir %attr(700,root,root) /root | |
ef2d028b | 169 | %dir %attr(700,root,root) /root/tmp |
4e9a06c3 | 170 | %dir /run |
15c9b486 | 171 | %dir /sbin |
6c511447 | 172 | %dir %attr(755,root,root) /srv |
6ad28b92 | 173 | %dir %attr(555,root,root) /sys |
6c511447 | 174 | %dir %attr(1777,root,root) /tmp |
d8cf4cdf JB |
175 | %dir /usr |
176 | %dir /usr/bin | |
177 | %dir /usr/games | |
178 | %dir /usr/include | |
179 | %dir /usr/lib | |
d49d853d | 180 | %dir /usr/libexec |
d8cf4cdf JB |
181 | %dir /usr/lib/games |
182 | %dir /usr/sbin | |
183 | %dir /usr/share | |
4e9a06c3 JB |
184 | %dir /usr/share/color |
185 | %dir /usr/share/color/icc | |
d8cf4cdf JB |
186 | %dir /usr/share/dict |
187 | %dir /usr/share/doc | |
188 | %dir /usr/share/games | |
189 | %dir /usr/share/info | |
d8cf4cdf JB |
190 | %dir /usr/share/man |
191 | %dir /usr/share/man/man[1-8] | |
d8cf4cdf | 192 | %dir /usr/share/misc |
4e9a06c3 | 193 | %dir /usr/share/ppd |
d8cf4cdf | 194 | %dir /usr/share/tmac |
017dd5c9 | 195 | %dir /usr/share/xml |
d8cf4cdf JB |
196 | %dir /usr/src |
197 | %dir /usr/local | |
198 | %dir /usr/local/bin | |
199 | %dir /usr/local/etc | |
200 | %dir /usr/local/games | |
201 | %dir /usr/local/include | |
202 | %dir /usr/local/lib | |
d49d853d | 203 | %dir /usr/local/libexec |
d8cf4cdf JB |
204 | %dir /usr/local/sbin |
205 | %dir /usr/local/share | |
4e9a06c3 JB |
206 | %dir /usr/local/share/color |
207 | %dir /usr/local/share/color/icc | |
d8cf4cdf JB |
208 | %dir /usr/local/share/doc |
209 | %dir /usr/local/share/info | |
4e9a06c3 JB |
210 | %dir /usr/local/share/man |
211 | %dir /usr/local/share/man/man[1-8] | |
d8cf4cdf | 212 | %dir /usr/local/src |
15c9b486 | 213 | %dir /var |
d8cf4cdf | 214 | %dir /var/cache |
0a75495b | 215 | %dir /var/crash |
15c9b486 | 216 | %dir /var/db |
15c9b486 | 217 | %dir /var/games |
dff2ec9d | 218 | %dir /var/lib |
4e9a06c3 JB |
219 | %dir /var/lib/color |
220 | %dir /var/lib/color/icc | |
0a75495b | 221 | %dir /var/lib/misc |
e7f27a78 | 222 | %dir /var/local |
6c511447 ER |
223 | %dir %attr(1771,root,root) /var/lock |
224 | %dir %attr(751,root,root) /var/log | |
225 | %dir %attr(2775,root,root) /var/mail | |
15c9b486 | 226 | %dir /var/opt |
0a75495b | 227 | %dir /var/run |
2d4f80d5 | 228 | %dir /var/spool |
48784dc4 | 229 | %dir /var/yp |
6c511447 | 230 | %dir %attr(1777,root,root) /var/tmp |
335736da | 231 | %if %{with lib64} |
d8cf4cdf JB |
232 | %dir /lib64 |
233 | %dir /usr/lib64 | |
234 | %dir /usr/lib64/games | |
235 | %dir /usr/local/lib64 | |
9d2de01c | 236 | %endif |
335736da | 237 | %if %{with libx32} |
9d2de01c JR |
238 | %dir /libx32 |
239 | %dir /usr/libx32 | |
240 | %dir /usr/libx32/games | |
241 | %dir /usr/local/libx32 | |
76796e14 | 242 | %endif |
483f43b7 JR |
243 | |
244 | %files debug | |
245 | %defattr(644,root,root,755) | |
246 | %dir /usr/lib/.build-id | |
247 | %dir /usr/lib/.build-id/[0-9af][0-9af] |