RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Pinto Elia
  Root:   /v/rpm/cvs                       Email:  devzero2...@rpm5.org
  Module: rpm                              Date:   27-Sep-2010 19:21:47
  Branch: HEAD                             Handle: 2010092717214700

  Added files:
    rpm/tests               rpm-size-limit.spec

  Log:
    add rpm test for rpm size limit: WIP

  Summary:
    Revision    Changes     Path
    1.1         +63 -0      rpm/tests/rpm-size-limit.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/tests/rpm-size-limit.spec
  ============================================================================
  $ cvs diff -u -r0 -r1.1 rpm-size-limit.spec
  --- /dev/null 2010-09-27 19:16:10.000000000 +0200
  +++ rpm-size-limit.spec       2010-09-27 19:21:47.559260438 +0200
  @@ -0,0 +1,63 @@
  +%{?!nofile:%global nofile 1 }
  +%{?!totalfilesizeMB:%global totalfilesizeMB 1 } 
  +%{?!filesizeMB:%global filesizeMB 1 } 
  +%{?!compresstgz:%global compresstgz 0 } 
  +
  +%if 0%{?totalfilesizeMB}
  +%{expand: %%global filesizeMB $(echo $((%{totalfilesizeMB}/%{nofile})))}
  +%endif
  +
  +Summary:        This is a toy rpm to test some rpm size limit
  +Name:           rpm-size-limit
  +Version:        1.0
  +Release:        1
  +Group:          Development/System
  +License:        LGPL
  +BuildArch:      noarch
  +BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root
  +
  +%description
  +
  +This toy rpm contains %{nofile} files of 
  +%{filesizeMB} MB in /tmp/. i
  +If you build with --define 'compresstgz 1'
  +then the rpm contains twice as much %{nofile} files: 
  +the compressed tarball version and the non-compressed.
  +
  +
  +Example :
  +
  +1) as in rhbz#462539 
  +
  +rpmbuild -ba --define 'nofile 1' --define 'totalfilesizeMB 110' --define 
'compresstgz 1' %{name}.spec 
  +
  +2) The  2Gb Limit rhbz#498236
  +
  +rpmbuild -ba --define 'nofile 1' --define 'totalfilesizeMB 2000'  
%{name}.spec 
  +
  +
  +%prep
  +#empty
  +%build
  +#empty
  +%install
  +
  +mkdir -p %{buildroot}/tmp
  +_c=1
  +while [ ${_c} -le %{nofile} ]
  +do
  + dd if=/dev/zero of=%{buildroot}/tmp/file%{name}${_c} count=%{filesizeMB} 
bs=1M 
  + [ "%{?compresstgz}" -ne 0 ] && tar -zcvf 
%{buildroot}/tmp/file%{name}${_c}.tgz %{buildroot}/tmp/file%{name}${_c} 
  + let _c=_c+1
  +done
  +
  +
  +%clean
  +rm -rf %{buildroot}
  +
  +%files
  +/tmp/file%{name}*
  +
  +%changelog
  +* Mon Sep 27 2010 Elia Pinto <devzero2...@rpm5.org> - 1.0-1
  +- First Build
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to