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