]> git.pld-linux.org Git - packages/filesystem.git/blobdiff - filesystem.spec
- revert ghost /initrd on HEAD too; rel 17
[packages/filesystem.git] / filesystem.spec
index 63ccdf2112ec8e11f5efda5d9ca6da6958c710f5..9256698f28c6e7ed0f2655498a6b5d78d7f73cf2 100644 (file)
@@ -1,14 +1,26 @@
+#
+# Conditional build:
+%bcond_without debuginfo       # build without debuginfo package
 
+# disable bcond if debuginfo is disabled from rpmmacros
+%if %{expand:%%define __sip_%{?_enable_debug_packages} 1}0%{?__sip_0:1}%{expand:%%undefine __sip_%{?_enable_debug_packages}}
+%undefine      with_debuginfo
+%endif
+
+# disable rpm generated debug package in any way
 %define                _enable_debug_packages  0
 
+# avoid rpm 4.4.9 adding rm -rf buildroot
+%define                __spec_clean_body       %{nil}
 Summary:       Common directories
 Summary(pl.UTF-8):     Wspólne katalogi
 Name:          filesystem
 Version:       3.0
-Release:       15
+Release:       17
 License:       GPL
 Group:         Base
 BuildRequires: automake
+BuildRequires: mktemp
 Requires:      FHS >= 2.3-15
 Provides:      browser-plugins(%{_target_base_arch})
 %ifarch %{x8664}
@@ -52,6 +64,7 @@ Ten pakiet udostępnia wspólne katalogi dla plików z informacjami dla
 debuggera.
 
 %prep
+%setup -qcT
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -62,9 +75,9 @@ install -d \
        $RPM_BUILD_ROOT/home/{users,services} \
        $RPM_BUILD_ROOT/lib/{firmware,security} \
        $RPM_BUILD_ROOT/usr/include/security \
-       $RPM_BUILD_ROOT/usr/lib/{cgi-bin,browser-plugins,debug%{_libdir},pkgconfig} \
+       $RPM_BUILD_ROOT/usr/lib/{cgi-bin,browser-plugins,pkgconfig} \
        $RPM_BUILD_ROOT/usr/share/{gnome/help,man/man{n,l},man/pl/mann,pkgconfig,sounds,themes/Default,wallpapers,wm-properties,xsessions} \
-       $RPM_BUILD_ROOT/usr/src/{debug,examples} \
+       $RPM_BUILD_ROOT/usr/src/examples \
        $RPM_BUILD_ROOT/var/lock/subsys \
        $RPM_BUILD_ROOT{%{_aclocaldir},%{_desktopdir}/docklets,%{_iconsdir},%{_pixmapsdir}} \
        $RPM_BUILD_ROOT%{_fontsdir}/{{100,75}dpi,OTF,Speedo,Type1/{afm,pfm},TTF,cyrillic,local,misc} \
@@ -77,21 +90,47 @@ install -d \
        $RPM_BUILD_ROOT/usr/lib64/browser-plugins
 %endif
 
+%if %{with debuginfo}
+install -d \
+       $RPM_BUILD_ROOT/usr/lib/debug/%{_lib} \
+       $RPM_BUILD_ROOT/usr/lib/debug%{_libdir} \
+       $RPM_BUILD_ROOT/usr/lib/debug/{bin,sbin} \
+       $RPM_BUILD_ROOT/usr/lib/debug/usr/{bin,sbin} \
+       $RPM_BUILD_ROOT/usr/lib/debug/lib/security \
+       $RPM_BUILD_ROOT/usr/src/debug
+
+%if "%{_lib}" == "lib64"
+install -d \
+       $RPM_BUILD_ROOT/usr/lib/debug/lib64/security
+%endif
+
+find $RPM_BUILD_ROOT/usr/lib/debug -type d | while read line; do
+       echo ${line#$RPM_BUILD_ROOT}
+done > $RPM_BUILD_ROOT/usr/src/debug/%{name}-debuginfo.files
+%endif
+
+# create this for %clean
+tar -cf checkfiles.tar -C $RPM_BUILD_ROOT .
+
 %clean
+mkdir -p $RPM_BUILD_ROOT
+tar -xf checkfiles.tar -C $RPM_BUILD_ROOT
 cd $RPM_BUILD_ROOT
 
-# %{_rpmfilename} is not expanded, so use
-# %{name}-%{version}-%{release}.%{buildarch}.rpm
-RPMFILE=%{name}-%{version}-%{release}.%{_target_cpu}.rpm
-RPMFILE2=%{name}-debuginfo-%{version}-%{release}.%{_target_cpu}.rpm
-TMPFILE=%{name}-%{version}.tmp$$
-# note: we must exclude from check all existing dirs belonging to FHS
-find . | sed -e 's|^\.||g' -e 's|^$||g' | sort | grep -v $TMPFILE | grep -E -v '^/(etc|etc/X11|home|lib|lib64|usr|usr/include|usr/lib|usr/lib64|usr/share|usr/share/man|usr/share/man/pl|usr/src|var|var/lock)$' > $TMPFILE
+check_filesystem_dirs() {
+       RPMFILE=%{_rpmdir}/%{name}-%{version}-%{release}.%{_target_cpu}.rpm
+       RPMFILE2=%{?with_debuginfo:%{_rpmdir}/%{name}-debuginfo-%{version}-%{release}.%{_target_cpu}.rpm}
+       TMPFILE=$(mktemp)
+       # note: we must exclude from check all existing dirs belonging to FHS
+       find | sed -e 's|^\.||g' -e 's|^$||g' | LC_ALL=C sort | grep -v $TMPFILE | grep -E -v '^/(etc|etc/X11|home|lib|lib64|usr|usr/include|usr/lib|usr/lib64|usr/share|usr/share/man|usr/share/man/pl|usr/src|var|var/lock)$' > $TMPFILE
 
-# find finds also '.', so use option -B for diff
-rpm -qpl %{_rpmdir}/$RPMFILE %{_rpmdir}/$RPMFILE2 | grep -v '^/$' | sort | diff -uB $TMPFILE - || :
+       # find finds also '.', so use option -B for diff
+       rpm -qpl $RPMFILE $RPMFILE2 | grep -v '^/$' | LC_ALL=C sort | diff -uB $TMPFILE - || :
 
-rm -rf $RPM_BUILD_ROOT
+       rm -f $TMPFILE
+}
+
+check_filesystem_dirs
 
 %files
 %defattr(644,root,root,755)
@@ -105,7 +144,7 @@ rm -rf $RPM_BUILD_ROOT
 %dir /etc/xdg/autostart
 %dir /home/users
 %attr(751,root,adm) %dir /home/services
-%ghost %dir /initrd
+%dir /initrd
 %dir /lib/firmware
 %dir /lib/security
 %dir /selinux
@@ -141,8 +180,12 @@ rm -rf $RPM_BUILD_ROOT
 %dir /usr/lib64/browser-plugins
 %endif
 
+%if %{with debuginfo}
 %files debuginfo
 %defattr(644,root,root,755)
 %dir /usr/lib/debug
 /usr/lib/debug/*
+
 %dir /usr/src/debug
+/usr/src/debug/filesystem-debuginfo.files
+%endif
This page took 0.069615 seconds and 4 git commands to generate.