]> git.pld-linux.org Git - packages/FHS.git/blob - FHS.spec
- implicit %dir
[packages/FHS.git] / FHS.spec
1 # NOTE
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ı
10 Name:           FHS
11 Version:        2.3
12 Release:        25
13 License:        GPL
14 Group:          Base
15 URL:            http://www.pathname.com/fhs/
16 BuildRequires:  mktemp
17 BuildRequires:  rpmbuild(macros) >= 1.213
18 Conflicts:      setup < 2.7
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 # nothing to put there
22 %define         _enable_debug_packages  0
23
24 # avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
25 %define         __spec_clean_body       %{nil}
26
27 %define         _locmandir      /usr/local/man
28
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
33
34 # we have to use numeric uids/groups. see comment above
35
36 %define         gid_uucp        14
37 %define         gid_mail        12
38
39 %description
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.
43
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.
48
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.
53
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
57 2.3.
58
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.
62
63 %prep
64
65 %install
66 rm -rf $RPM_BUILD_ROOT
67
68 install -d \
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}
78
79 %if "%{_lib}" == "lib64"
80 install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
81 %endif
82
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}
89         done
90 done
91
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
94
95 %clean
96 cd $RPM_BUILD_ROOT
97
98 check_filesystem_dirs() {
99         RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
100         TMPFILE=$(mktemp)
101         find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort > $TMPFILE
102
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
106         else
107                 echo -e "\nNot so good, some directories are not included in package\n"
108                 exit 1
109         fi
110         rm -f $TMPFILE
111 }
112 check_filesystem_dirs
113
114 # XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
115 %post -p <lua>
116 posix.chown("/var/mail", 0, %{gid_mail})
117 posix.chown("/var/lock", 0, %{gid_uucp})
118
119 %files
120 %defattr(644,root,root,755)
121 %dir /
122 %dir /bin
123 %dir /boot
124 %dir /dev
125 %dir /etc
126 %dir /etc/X11
127 %dir /etc/opt
128 %dir /home
129 %dir /lib
130 %dir /lib/modules
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
134 %dir /mnt
135 %dir /opt
136 %dir %attr(555,root,root) %verify(not group) /proc
137 %dir %attr(700,root,root) /root
138 %dir /sbin
139 %dir %attr(755,root,root) /srv
140 %dir %attr(1777,root,root) /tmp
141 %dir /usr
142 %dir /usr/bin
143 %dir /usr/games
144 %dir /usr/include
145 %dir /usr/lib
146 %dir /usr/lib/games
147 %dir /usr/sbin
148 %dir /usr/share
149 %dir /usr/share/dict
150 %dir /usr/share/doc
151 %dir /usr/share/games
152 %dir /usr/share/info
153 %dir /usr/share/man
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
187 %dir /usr/share/misc
188 %dir /usr/share/tmac
189 %dir /usr/share/xml
190 %dir /usr/src
191 %dir /usr/local
192 %dir /usr/local/bin
193 %dir /usr/local/etc
194 %dir /usr/local/games
195 %dir /usr/local/include
196 %dir /usr/local/lib
197 %dir /usr/local/sbin
198 %dir /usr/local/share
199 %dir /usr/local/share/doc
200 %dir /usr/local/share/info
201 /usr/local/share/man
202 %{_locmandir}
203 %dir /usr/local/src
204 %dir /var
205 %dir /var/cache
206 %dir /var/crash
207 %dir /var/db
208 %dir /var/games
209 %dir /var/lib
210 %dir /var/lib/misc
211 %dir /var/local
212 %dir %attr(1771,root,root) /var/lock
213 %dir %attr(751,root,root) /var/log
214 %dir %attr(2775,root,root) /var/mail
215 %dir /var/opt
216 %dir /var/run
217 %dir /var/spool
218 %dir /var/yp
219 %dir %attr(1777,root,root) /var/tmp
220 %if "%{_lib}" == "lib64"
221 %dir /lib64
222 %dir /usr/lib64
223 %dir /usr/lib64/games
224 %dir /usr/local/lib64
225 %endif
This page took 0.066515 seconds and 4 git commands to generate.