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