]> git.pld-linux.org Git - packages/FHS.git/blame - FHS.spec
- lua bugfixes, docs packaged in FHS-doc.spec (because of verification tricks here)
[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.
4e9a06c3
JB
5# But: root %attr+chown in %post means integrity verification (rpm -V) error.
6# Maybe use non-root %attr+numeric chown in %post (without setup dependency)? The only disadvantage
7# seems to be a warning message on install.
8Summary: Basic FHS %{version} filesystem layout
d280bbd7
ER
9Summary(de.UTF-8): Grundlegende Dateisystemstruktur
10Summary(fr.UTF-8): Arborescence de base du système de fichiers
4e9a06c3 11Summary(pl.UTF-8): Podstawowy układ katalogów systemu Linux zgodny z FHS %{version}
d280bbd7 12Summary(tr.UTF-8): Temel dosya sistemi yapısı
b3b300be 13Name: FHS
4e9a06c3
JB
14Version: 3.0
15Release: 1
15c9b486 16License: GPL
17Group: Base
e38ba8ca 18URL: http://refspecs.linuxfoundation.org/fhs.shtml
4e9a06c3 19# list of languages for localized man pages directories
38ec8b96 20Source0: locale-dirs
2fccd05c 21BuildRequires: mktemp
73559f52 22BuildRequires: rpmbuild(macros) >= 1.213
05fbeea7 23Conflicts: setup < 2.7
8ad4c704 24BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
15c9b486 25
5a4e441c
ER
26# nothing to put there
27%define _enable_debug_packages 0
28
335736da
JB
29%if "%{_lib}" == "lib64"
30%define with_lib64 1
335736da
JB
31%endif
32%if "%{_lib}" == "libx32"
33%define with_libx32 1
57d439f5 34%define with_lib64 1
335736da
JB
35%else
36%ifarch %{x8664}
37# x32 as additional ABI
38%define with_libx32 1
39%endif
40%endif
41
5a4e441c
ER
42# avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
43%define __spec_clean_body %{nil}
44
6c95f275 45# doesn't contain any files, but we're not noarch package
99177468 46%define no_install_post_strip 1
6c95f275
ER
47%define no_install_post_chrpath 1
48%define no_install_post_compress_modules 1
0fa811e0 49
05fbeea7
ER
50# we have to use numeric uids/groups. see comment above
51
52%define gid_uucp 14
53%define gid_mail 12
54
15c9b486 55%description
aac153be 56This package contains the basic directory layout for a Linux system,
57including the proper permissions for the directories. This layout
4e9a06c3 58conforms to the Filesystem Hierarchy Standard (FHS) %{version}.
15c9b486 59
fdedb1f3
JR
60%description -l de.UTF-8
61Dieses Paket enthält die grundlegende Verzeichnisstruktur eines
62Linux-Systems, einschließlich der entsprechenden Zugriffsrechte. Diese
4e9a06c3 63Struktur entspricht dem Filesystem Hierarchy Standard (FHS) %{version}.
15c9b486 64
fdedb1f3
JR
65%description -l fr.UTF-8
66Ce package contient l'arborescence type pour système Linux y compris
67les permissions adéquates pour les répertoires. Cette arborescence est
4e9a06c3 68conforme au standard "Filesystem Hierarchy Standard" (FHS) %{version}.
15c9b486 69
fdedb1f3
JR
70%description -l pl.UTF-8
71Pakiet ten zawiera informacje o podstawowej strukturze katalogów
72systemu i praw dostępu do nich. Struktura katalogów jest zgodna z FHS
4e9a06c3 73%{version}.
aac153be 74
15c9b486 75%prep
40188a0f 76%setup -qcT
c5fb118b 77cp -p %{SOURCE0} .
15c9b486 78
79%install
80rm -rf $RPM_BUILD_ROOT
81
d8cf4cdf 82install -d \
4e9a06c3 83 $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,run,srv,sys} \
d8cf4cdf
JB
84 $RPM_BUILD_ROOT/etc/{X11,opt} \
85 $RPM_BUILD_ROOT/lib/modules \
d13739ad 86 $RPM_BUILD_ROOT/{mnt,media,proc,root/tmp,sbin,tmp} \
d8cf4cdf 87 $RPM_BUILD_ROOT/usr/{bin,games,include,lib,sbin,share,src} \
4e9a06c3 88 $RPM_BUILD_ROOT/usr/share/{color/icc,dict,doc,games,info,misc,ppd,tmac,xml} \
d8cf4cdf 89 $RPM_BUILD_ROOT/usr/lib/games \
4e9a06c3 90 $RPM_BUILD_ROOT/usr/local/{bin,etc,games,include,lib,sbin,share/{color/icc,doc,info,man},src} \
c5fb118b 91 $RPM_BUILD_ROOT/var/{cache,crash,db,games,lib/{color/icc,misc},local,lock,log,mail,opt,run,spool,tmp,yp}
d8cf4cdf 92
335736da 93%if %{with lib64}
d8cf4cdf 94install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
9d2de01c 95%endif
335736da 96%if %{with libx32}
9d2de01c 97install -d $RPM_BUILD_ROOT{/libx32,/usr/libx32/games,/usr/local/libx32}
76796e14
JB
98%endif
99
42b7266a 100install -d $RPM_BUILD_ROOT/usr/share/man/man{1,2,3,4,5,6,7,8}
4e9a06c3 101install -d $RPM_BUILD_ROOT/usr/local/share/man/man{1,2,3,4,5,6,7,8}
9d1c44e3 102
42b7266a
ER
103> %{name}.lang
104for 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
110done
111
15c9b486 112%clean
fa9aa6bf 113cd $RPM_BUILD_ROOT
0a75495b 114
2fccd05c 115check_filesystem_dirs() {
2fccd05c
ER
116 RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
117 TMPFILE=$(mktemp)
48e57f98 118 find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort > $TMPFILE
2fccd05c
ER
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}
129check_filesystem_dirs
15c9b486 130
4e9a06c3 131%pretrans -p <lua>
c5fb118b
JB
132st = posix.stat("/usr/local/share/man")
133if st and st.type == "link" then
134 os.remove("/usr/local/share/man")
135end
4e9a06c3 136
05fbeea7 137%post -p <lua>
c5fb118b 138--# XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
05fbeea7
ER
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
4e9a06c3 160%dir /run
15c9b486 161%dir /sbin
6c511447 162%dir %attr(755,root,root) /srv
4e9a06c3 163%dir /sys
6c511447 164%dir %attr(1777,root,root) /tmp
d8cf4cdf
JB
165%dir /usr
166%dir /usr/bin
167%dir /usr/games
168%dir /usr/include
169%dir /usr/lib
170%dir /usr/lib/games
171%dir /usr/sbin
172%dir /usr/share
4e9a06c3
JB
173%dir /usr/share/color
174%dir /usr/share/color/icc
d8cf4cdf
JB
175%dir /usr/share/dict
176%dir /usr/share/doc
177%dir /usr/share/games
178%dir /usr/share/info
d8cf4cdf
JB
179%dir /usr/share/man
180%dir /usr/share/man/man[1-8]
d8cf4cdf 181%dir /usr/share/misc
4e9a06c3 182%dir /usr/share/ppd
d8cf4cdf 183%dir /usr/share/tmac
017dd5c9 184%dir /usr/share/xml
d8cf4cdf
JB
185%dir /usr/src
186%dir /usr/local
187%dir /usr/local/bin
188%dir /usr/local/etc
189%dir /usr/local/games
190%dir /usr/local/include
191%dir /usr/local/lib
192%dir /usr/local/sbin
193%dir /usr/local/share
4e9a06c3
JB
194%dir /usr/local/share/color
195%dir /usr/local/share/color/icc
d8cf4cdf
JB
196%dir /usr/local/share/doc
197%dir /usr/local/share/info
4e9a06c3
JB
198%dir /usr/local/share/man
199%dir /usr/local/share/man/man[1-8]
d8cf4cdf 200%dir /usr/local/src
15c9b486 201%dir /var
d8cf4cdf 202%dir /var/cache
0a75495b 203%dir /var/crash
15c9b486 204%dir /var/db
15c9b486 205%dir /var/games
dff2ec9d 206%dir /var/lib
4e9a06c3
JB
207%dir /var/lib/color
208%dir /var/lib/color/icc
0a75495b 209%dir /var/lib/misc
e7f27a78 210%dir /var/local
6c511447
ER
211%dir %attr(1771,root,root) /var/lock
212%dir %attr(751,root,root) /var/log
213%dir %attr(2775,root,root) /var/mail
15c9b486 214%dir /var/opt
0a75495b 215%dir /var/run
2d4f80d5 216%dir /var/spool
48784dc4 217%dir /var/yp
6c511447 218%dir %attr(1777,root,root) /var/tmp
335736da 219%if %{with lib64}
d8cf4cdf
JB
220%dir /lib64
221%dir /usr/lib64
222%dir /usr/lib64/games
223%dir /usr/local/lib64
9d2de01c 224%endif
335736da 225%if %{with libx32}
9d2de01c
JR
226%dir /libx32
227%dir /usr/libx32
228%dir /usr/libx32/games
229%dir /usr/local/libx32
76796e14 230%endif
This page took 0.117556 seconds and 4 git commands to generate.