]> git.pld-linux.org Git - packages/FHS.git/blob - FHS.spec
- lib64 bugfix; release 38
[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:        38
13 License:        GPL
14 Group:          Base
15 URL:            http://www.pathname.com/fhs/
16 Source0:        locale-dirs
17 BuildRequires:  mktemp
18 BuildRequires:  rpmbuild(macros) >= 1.213
19 Conflicts:      setup < 2.7
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 # nothing to put there
23 %define         _enable_debug_packages  0
24
25 %if "%{_lib}" == "lib64"
26 %define         with_lib64      1
27 %endif
28 %if "%{_lib}" == "libx32"
29 %define         with_libx32     1
30 %else
31 %ifarch %{x8664}
32 # x32 as additional ABI
33 %define         with_libx32     1
34 %endif
35 %endif
36
37 # avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
38 %define         __spec_clean_body       %{nil}
39
40 %define         _locmandir      /usr/local/man
41
42 # doesn't contain any files, but we're not noarch package
43 %define         no_install_post_strip   1
44 %define         no_install_post_chrpath 1
45 %define         no_install_post_compress_modules        1
46
47 # we have to use numeric uids/groups. see comment above
48
49 %define         gid_uucp        14
50 %define         gid_mail        12
51
52 %description
53 This package contains the basic directory layout for a Linux system,
54 including the proper permissions for the directories. This layout
55 conforms to the Filesystem Hierarchy Standard (FHS) 2.3.
56
57 %description -l de.UTF-8
58 Dieses Paket enthält die grundlegende Verzeichnisstruktur eines
59 Linux-Systems, einschließlich der entsprechenden Zugriffsrechte. Diese
60 Struktur entspricht dem Filesystem Hierarchy Standard (FHS) 2.3.
61
62 %description -l fr.UTF-8
63 Ce package contient l'arborescence type pour système Linux y compris
64 les permissions adéquates pour les répertoires. Cette arborescence est
65 conforme au standard "Filesystem Hierarchy Standard" (FHS) 2.3.
66
67 %description -l pl.UTF-8
68 Pakiet ten zawiera informacje o podstawowej strukturze katalogów
69 systemu i praw dostępu do nich. Struktura katalogów jest zgodna z FHS
70 2.3.
71
72 %prep
73 %setup -qcT
74 cp -a %{SOURCE0} .
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78
79 install -d \
80         $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,srv} \
81         $RPM_BUILD_ROOT/etc/{X11,opt} \
82         $RPM_BUILD_ROOT/lib/modules \
83         $RPM_BUILD_ROOT/{mnt,media,proc,root/tmp,sbin,tmp} \
84         $RPM_BUILD_ROOT/usr/{bin,games,include,lib,sbin,share,src} \
85         $RPM_BUILD_ROOT/usr/share/{dict,doc,games,info,misc,tmac,xml} \
86         $RPM_BUILD_ROOT/usr/lib/games \
87         $RPM_BUILD_ROOT/usr/local/{bin,etc,games,include,lib,sbin,share/{doc,info},src} \
88         $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/misc,local,lock,log,mail,opt,run,spool,tmp,yp}
89
90 %if %{with lib64}
91 install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
92 %endif
93 %if %{with libx32}
94 install -d $RPM_BUILD_ROOT{/libx32,/usr/libx32/games,/usr/local/libx32}
95 %endif
96
97 install -d $RPM_BUILD_ROOT/usr/share/man/man{1,2,3,4,5,6,7,8}
98 install -d $RPM_BUILD_ROOT%{_locmandir}/man{1,2,3,4,5,6,7,8}
99
100 # "/usr/local/share/man and /usr/local/man must be synonomous" per FHS 2.3
101 ln -sf ../man $RPM_BUILD_ROOT/usr/local/share/man
102
103 > %{name}.lang
104 for mloc in $(cat locale-dirs); do
105         echo "%%lang($mloc) %dir /usr/share/man/${mloc}" >> %{name}.lang
106         for manp in man{1,2,3,4,5,6,7,8}; do
107                 install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp}
108                 echo "%%lang($mloc) %dir /usr/share/man/${mloc}/${manp}" >> %{name}.lang
109         done
110 done
111
112 %clean
113 cd $RPM_BUILD_ROOT
114
115 check_filesystem_dirs() {
116         RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
117         TMPFILE=$(mktemp)
118         find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort > $TMPFILE
119
120         # find finds also '.', so use option -B for diff
121         if rpm -qpl %{_rpmdir}/$RPMFILE | grep -v '^/$' | LC_ALL=C sort | diff -uB $TMPFILE - ; then
122                 rm -rf $RPM_BUILD_ROOT
123         else
124                 echo -e "\nNot so good, some directories are not included in package\n"
125                 exit 1
126         fi
127         rm -f $TMPFILE
128 }
129 check_filesystem_dirs
130
131 # XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
132 %post -p <lua>
133 posix.chown("/var/mail", 0, %{gid_mail})
134 posix.chown("/var/lock", 0, %{gid_uucp})
135
136 %files -f %{name}.lang
137 %defattr(644,root,root,755)
138 %dir /
139 %dir /bin
140 %dir /boot
141 %dir /dev
142 %dir /etc
143 %dir /etc/X11
144 %dir /etc/opt
145 %dir /home
146 %dir /lib
147 %dir /lib/modules
148 %dir /media
149 %dir /mnt
150 %dir /opt
151 %dir %attr(555,root,root) %verify(not group) /proc
152 %dir %attr(700,root,root) /root
153 %dir %attr(700,root,root) /root/tmp
154 %dir /sbin
155 %dir %attr(755,root,root) /srv
156 %dir %attr(1777,root,root) /tmp
157 %dir /usr
158 %dir /usr/bin
159 %dir /usr/games
160 %dir /usr/include
161 %dir /usr/lib
162 %dir /usr/lib/games
163 %dir /usr/sbin
164 %dir /usr/share
165 %dir /usr/share/dict
166 %dir /usr/share/doc
167 %dir /usr/share/games
168 %dir /usr/share/info
169 %dir /usr/share/man
170 %dir /usr/share/man/man[1-8]
171 %dir /usr/share/misc
172 %dir /usr/share/tmac
173 %dir /usr/share/xml
174 %dir /usr/src
175 %dir /usr/local
176 %dir /usr/local/bin
177 %dir /usr/local/etc
178 %dir /usr/local/games
179 %dir /usr/local/include
180 %dir /usr/local/lib
181 %dir /usr/local/sbin
182 %dir /usr/local/share
183 %dir /usr/local/share/doc
184 %dir /usr/local/share/info
185 /usr/local/share/man
186 %{_locmandir}
187 %dir /usr/local/src
188 %dir /var
189 %dir /var/cache
190 %dir /var/crash
191 %dir /var/db
192 %dir /var/games
193 %dir /var/lib
194 %dir /var/lib/misc
195 %dir /var/local
196 %dir %attr(1771,root,root) /var/lock
197 %dir %attr(751,root,root) /var/log
198 %dir %attr(2775,root,root) /var/mail
199 %dir /var/opt
200 %dir /var/run
201 %dir /var/spool
202 %dir /var/yp
203 %dir %attr(1777,root,root) /var/tmp
204 %if %{with lib64}
205 %dir /lib64
206 %dir /usr/lib64
207 %dir /usr/lib64/games
208 %dir /usr/local/lib64
209 %endif
210 %if %{with libx32}
211 %dir /libx32
212 %dir /usr/libx32
213 %dir /usr/libx32/games
214 %dir /usr/local/libx32
215 %endif
This page took 0.078673 seconds and 3 git commands to generate.