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