]> git.pld-linux.org Git - packages/FHS.git/blobdiff - FHS.spec
- added x32 arch libdirs
[packages/FHS.git] / FHS.spec
index 46de2b1590c3cd8f91c57c5b4360c0aa7eb0246e..8beb0e3d9ab8b2e09931ec09b157bdedeffd637d 100644 (file)
--- a/FHS.spec
+++ b/FHS.spec
@@ -1,4 +1,7 @@
-# NOTE: don't use %{_*dir} macros for paths defined by FHS
+# NOTE
+# - don't use %{_*dir} macros for paths defined by FHS
+# - do not add any dependencies to this pkg, FHS should be the first package being installed
+# - do not use any other user/group than "root", as then we have to depend on "setup" package.
 Summary:       Basic FHS 2.3 filesystem layout
 Summary(de.UTF-8):     Grundlegende Dateisystemstruktur
 Summary(fr.UTF-8):     Arborescence de base du système de fichiers
@@ -6,16 +9,33 @@ Summary(pl.UTF-8):    Podstawowy układ katalogów systemu Linux zgodny z FHS 2.3
 Summary(tr.UTF-8):     Temel dosya sistemi yapısı
 Name:          FHS
 Version:       2.3
-Release:       18
+Release:       36
 License:       GPL
 Group:         Base
 URL:           http://www.pathname.com/fhs/
+Source0:       locale-dirs
+BuildRequires: mktemp
 BuildRequires: rpmbuild(macros) >= 1.213
-Requires:      setup >= 2.4.6-4
+Conflicts:     setup < 2.7
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+# nothing to put there
+%define                _enable_debug_packages  0
+
+# avoid rpm 4.4.9 adding rm -rf buildroot, we need the dirs to check consistency
+%define                __spec_clean_body       %{nil}
+
 %define                _locmandir      /usr/local/man
+
+# doesn't contain any files, but we're not noarch package
 %define        no_install_post_strip   1
+%define        no_install_post_chrpath 1
+%define        no_install_post_compress_modules        1
+
+# we have to use numeric uids/groups. see comment above
+
+%define                gid_uucp        14
+%define                gid_mail        12
 
 %description
 This package contains the basic directory layout for a Linux system,
@@ -42,6 +62,8 @@ Bu paket GNU makro işleme dilini içerir. Mantıksal olarak
 ayrıştırılabilen metin dosyaları yazımı için yararlıdır.
 
 %prep
+%setup -qcT
+cp -a %{SOURCE0} .
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -50,7 +72,7 @@ install -d \
        $RPM_BUILD_ROOT/{bin,boot,dev,etc,home,opt,srv} \
        $RPM_BUILD_ROOT/etc/{X11,opt} \
        $RPM_BUILD_ROOT/lib/modules \
-       $RPM_BUILD_ROOT/{mnt,media/{cdrom,floppy},proc,root,sbin,tmp} \
+       $RPM_BUILD_ROOT/{mnt,media,proc,root/tmp,sbin,tmp} \
        $RPM_BUILD_ROOT/usr/{bin,games,include,lib,sbin,share,src} \
        $RPM_BUILD_ROOT/usr/share/{dict,doc,games,info,misc,tmac,xml} \
        $RPM_BUILD_ROOT/usr/lib/games \
@@ -59,38 +81,55 @@ install -d \
 
 %if "%{_lib}" == "lib64"
 install -d $RPM_BUILD_ROOT{/lib64,/usr/lib64/games,/usr/local/lib64}
+%ifarch %{x8664}
+install -d $RPM_BUILD_ROOT{/libx32,/usr/libx32/games,/usr/local/libx32}
+%endif
 %endif
 
-for manp in man{1,2,3,4,5,6,7,8} ; do
-       install -d $RPM_BUILD_ROOT/usr/share/man/${manp}
-       install -d $RPM_BUILD_ROOT%{_locmandir}/${manp}
-       for mloc in bg ca cs da de el es fi fr gl hr hu id it ja ko nl pl pt \
-                   pt_BR ro ru sk sl sr sv tr uk zh_CN zh_TW ; do
-               install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp}
-       done
-done
+%if "%{_lib}" == "libx32"
+install -d $RPM_BUILD_ROOT{/libx32,/usr/libx32/games,/usr/local/libx32}
+%endif
+
+install -d $RPM_BUILD_ROOT/usr/share/man/man{1,2,3,4,5,6,7,8}
+install -d $RPM_BUILD_ROOT%{_locmandir}/man{1,2,3,4,5,6,7,8}
 
 # "/usr/local/share/man and /usr/local/man must be synonomous" per FHS 2.3
 ln -sf ../man $RPM_BUILD_ROOT/usr/local/share/man
 
+> %{name}.lang
+for mloc in $(cat locale-dirs); do
+       echo "%%lang($mloc) %dir /usr/share/man/${mloc}" >> %{name}.lang
+       for manp in man{1,2,3,4,5,6,7,8}; do
+               install -d $RPM_BUILD_ROOT/usr/share/man/${mloc}/${manp}
+               echo "%%lang($mloc) %dir /usr/share/man/${mloc}/${manp}" >> %{name}.lang
+       done
+done
+
 %clean
 cd $RPM_BUILD_ROOT
 
-# %{_rpmfilename} is not expanded, so use
-# %{name}-%{version}-%{release}.%{buildarch}.rpm
-RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
-TMPFILE=%{name}-%{version}.tmp$$
-find . | sed -e 's|^\.||g' -e 's|^$||g' | sort | grep -v $TMPFILE > $TMPFILE
-
-# find finds also '.', so use option -B for diff
-if rpm -qpl %{_rpmdir}/$RPMFILE | grep -v '^/$' | sort | diff -uB $TMPFILE - ; then
-       rm -rf $RPM_BUILD_ROOT
-else
-       echo -e "\nNot so good, some directories are not included in package\n"
-       exit 1;
-fi
-
-%files
+check_filesystem_dirs() {
+       RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
+       TMPFILE=$(mktemp)
+       find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort > $TMPFILE
+
+       # find finds also '.', so use option -B for diff
+       if rpm -qpl %{_rpmdir}/$RPMFILE | grep -v '^/$' | LC_ALL=C sort | diff -uB $TMPFILE - ; then
+               rm -rf $RPM_BUILD_ROOT
+       else
+               echo -e "\nNot so good, some directories are not included in package\n"
+               exit 1
+       fi
+       rm -f $TMPFILE
+}
+check_filesystem_dirs
+
+# XXX: it is 2009, what uucp?! but we use /var/lock/subsys, so change it just to root?
+%post -p <lua>
+posix.chown("/var/mail", 0, %{gid_mail})
+posix.chown("/var/lock", 0, %{gid_uucp})
+
+%files -f %{name}.lang
 %defattr(644,root,root,755)
 %dir /
 %dir /bin
@@ -102,16 +141,15 @@ fi
 %dir /home
 %dir /lib
 %dir /lib/modules
-%attr(775,root,disk) %dir /media
-%attr(775,root,disk) /media/floppy
-%attr(775,root,disk) /media/cdrom
+%dir /media
 %dir /mnt
 %dir /opt
-%attr(555,root,proc) %verify(not group) /proc
-%attr(700,root,root) /root
+%dir %attr(555,root,root) %verify(not group) /proc
+%dir %attr(700,root,root) /root
+%dir %attr(700,root,root) /root/tmp
 %dir /sbin
-%attr(751,root,root) /srv
-%attr(1777,root,root) /tmp
+%dir %attr(755,root,root) /srv
+%dir %attr(1777,root,root) /tmp
 %dir /usr
 %dir /usr/bin
 %dir /usr/games
@@ -126,36 +164,6 @@ fi
 %dir /usr/share/info
 %dir /usr/share/man
 %dir /usr/share/man/man[1-8]
-%lang(bg) /usr/share/man/bg
-%lang(ca) /usr/share/man/ca
-%lang(cs) /usr/share/man/cs
-%lang(da) /usr/share/man/da
-%lang(de) /usr/share/man/de
-%lang(el) /usr/share/man/el
-%lang(es) /usr/share/man/es
-%lang(fi) /usr/share/man/fi
-%lang(fr) /usr/share/man/fr
-%lang(gl) /usr/share/man/gl
-%lang(hr) /usr/share/man/hr
-%lang(hu) /usr/share/man/hu
-%lang(id) /usr/share/man/id
-%lang(it) /usr/share/man/it
-%lang(ja) /usr/share/man/ja
-%lang(ko) /usr/share/man/ko
-%lang(nl) /usr/share/man/nl
-%lang(pl) /usr/share/man/pl
-%lang(pt) /usr/share/man/pt
-%lang(pt_BR) /usr/share/man/pt_BR
-%lang(ro) /usr/share/man/ro
-%lang(ru) /usr/share/man/ru
-%lang(sl) /usr/share/man/sl
-%lang(sk) /usr/share/man/sk
-%lang(sr) /usr/share/man/sr
-%lang(sv) /usr/share/man/sv
-%lang(tr) /usr/share/man/tr
-%lang(uk) /usr/share/man/uk
-%lang(zh_CN) /usr/share/man/zh_CN
-%lang(zh_TW) /usr/share/man/zh_TW
 %dir /usr/share/misc
 %dir /usr/share/tmac
 %dir /usr/share/xml
@@ -181,17 +189,29 @@ fi
 %dir /var/lib
 %dir /var/lib/misc
 %dir /var/local
-%attr(1771,root,uucp) %dir /var/lock
-%attr(751,root,root) /var/log
-%attr(2775,root,mail) /var/mail
+%dir %attr(1771,root,root) /var/lock
+%dir %attr(751,root,root) /var/log
+%dir %attr(2775,root,root) /var/mail
 %dir /var/opt
 %dir /var/run
 %dir /var/spool
 %dir /var/yp
-%attr(1777,root,root) %dir /var/tmp
+%dir %attr(1777,root,root) /var/tmp
 %if "%{_lib}" == "lib64"
 %dir /lib64
 %dir /usr/lib64
 %dir /usr/lib64/games
 %dir /usr/local/lib64
+%ifarch %{x8664}
+%dir /libx32
+%dir /usr/libx32
+%dir /usr/libx32/games
+%dir /usr/local/libx32
+%endif
+%endif
+%if "%{_lib}" == "libx32"
+%dir /libx32
+%dir /usr/libx32
+%dir /usr/libx32/games
+%dir /usr/local/libx32
 %endif
This page took 0.085388 seconds and 4 git commands to generate.