Hello community,

here is the log from the commit of package ceph for openSUSE:Factory checked in 
at 2016-08-05 18:16:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ceph (Old)
 and      /work/SRC/openSUSE:Factory/.ceph.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ceph"

Changes:
--------
New Changes file:

--- /dev/null   2016-07-07 10:01:34.856033756 +0200
+++ /work/SRC/openSUSE:Factory/.ceph.new/ceph-test.changes      2016-08-05 
18:16:52.000000000 +0200
@@ -0,0 +1,1814 @@
+-------------------------------------------------------------------
+Mon Aug 01 16:36:18 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1470069142.b15328c:
+  + rpm: remove newline from configure command
+
+-------------------------------------------------------------------
+Mon Aug 01 14:59:35 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1470063368.e6786e8:
+  + rpm: simplify openSUSE conditional
+
+-------------------------------------------------------------------
+Mon Aug 01 14:39:49 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1470061991.d6904b4:
+  + rpm: build with --disable-static on openSUSE
+    (encloses --disable-static in appropriate distro conditional)
+
+-------------------------------------------------------------------
+Wed Jul 27 19:34:06 UTC 2016 - [email protected]
+
+- Pass --disable-static to configure: Let's save the time and
+  resources by not building the static libraries instead of
+  deleting them in the install section again.
+- Drop required disk limit for ceph to from 28GB 20GB.
+
+-------------------------------------------------------------------
+Sun Jul 24 19:49:16 UTC 2016 - [email protected]
+
+- Raised ceph package _constraints to 28G disk and 11G memory 
+  (previous setting was valid only for "with minimal_debugging_information")
+
+-------------------------------------------------------------------
+Fri Jul 22 17:38:59 UTC 2016 - [email protected]
+
+- pre_checkin.sh: copy ceph.changes to ceph-test.changes
+
+-------------------------------------------------------------------
+Fri Jul 22 17:03:43 UTC 2016 - [email protected]
+
+- _constraints: set separate constraints for ceph.spec and ceph-test.spec 
+
+-------------------------------------------------------------------
+Fri Jul 22 13:33:31 UTC 2016 - [email protected]
+
+- Split ceph.spec into ceph.spec + ceph-test.spec
+  + Added pre_checkin.sh script to generate ceph-test.spec
+  + Reduced the constraints on resources required to build ceph and ceph-test 
packages
+
+-------------------------------------------------------------------
+Fri Jul 22 13:30:54 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1469189740.b62fb63:
+  + build: Added new configure option --with-tests
+  + build: Use WITH_TESTS flag to guard the build of ceph-test scripts/binaries
+  + rpm: Moved ceph-client-debug from ceph-base to ceph-test package
+  + rpm: Renamed bcond tests flag to make_check
+  + rpm: Added ceph_test_package bcond flag to control the build of ceph-test 
package
+
+-------------------------------------------------------------------
+Tue Jul 19 13:57:43 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1468935528.7232e18:
+  + rpm: Fix creation of mount.ceph symbolic link for SUSE distros (bsc#987594)
+
+-------------------------------------------------------------------
+Tue Jul 19 10:24:43 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1468923564.55149c4:
+  + fix bsc#989512
+    - Revert "ceph.spec.in: add ExcludeArch: i586"
+    - Revert "Revert "ceph.spec.in: add ExclusiveArch: x86_64 aarch64""
+
+-------------------------------------------------------------------
+Tue Jul 19 08:01:54 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1468914912.5a3ea0a:
+  + makefile: install mount.fuse.ceph,mount.ceph into /usr/sbin
+
+-------------------------------------------------------------------
+Mon Jul 18 16:11:19 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1468852657.c7d4fc3:
+  + rpm: create mount.ceph symlink in /sbin
+
+-------------------------------------------------------------------
+Mon Jul 18 09:13:15 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1468832924.19e510c:
+  + ceph.spec.in: move ceph-dencoder to ceph-base
+  + ceph.spec.in: drop ceph-brag and ceph-post-file
+  + ceph.spec.in: move cephfs-* fsck tools to ceph-base
+
+-------------------------------------------------------------------
+Thu Jul 14 09:24:10 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1468439993.fb857f2:
+  + rpm: provide -devel library packages that are being obsoleted
+
+-------------------------------------------------------------------
+Tue Jul 12 14:01:20 UTC 2016 - [email protected]
+
+- _constraints: Align memory constraint with actual memory usage
+  and available build workers
+
+-------------------------------------------------------------------
+Tue Jul 12 09:31:05 UTC 2016 - [email protected]
+
+- _constraints: Align disk constraint with actual disk usage
+
+-------------------------------------------------------------------
+Thu Jun 16 21:52:13 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1466113786.b5a7c56:
+  + rpm: remove major version from shared library devel pkg names
+  + rpm: align librgw-devel dependencies with debian packaging
+  + rpm: drop obsolete devel-compat meta package
+  + rpm: drop obsolete libs-compat metapackage
+  + rpm: drop obsolete python-ceph-compat metapackage
+
+-------------------------------------------------------------------
+Thu Jun 16 09:21:22 UTC 2016 - [email protected]
+
+- Update to upstream 10.2.2:
+  + mds: order directories by hash and fix simultaneous readdir races (pr#9655,
+    issue#16251, issue#16284)
+  + client: fix bugs accidentally disabling readahead (pr#9656, issue#16252)
+  + qa/workunits: ensure replay has started before checking position (pr#9674,
+    issue#16267)
+  + rbd-mirror: do not re-use image id from mirror directory if creating image
+    (pr#9673, issue#16265)
+  + librbd: recursive lock possible when disabling journaling (pr#9654,
+    issue#16246)
+  + rbd-mirror: FAILED assert(!m_status_watcher) (pr#9690, issue#16290)
+  + librbd: do not shut down exclusive lock while acquiring (pr#9691,
+    issue#16291)
+  + librbd: remove should ignore mirror errors from older OSDs (pr#9692,
+    issue#16292)
+
+-------------------------------------------------------------------
+Mon Jun 13 16:02:43 UTC 2016 - [email protected]
+
+- Update to version 10.2.1+git.1465817005.1b99e11:
+  + rpm: fix _with_ocf
+
+-------------------------------------------------------------------
+Mon Jun 13 08:41:36 UTC 2016 - [email protected]
+
+- Update to version 10.2.1+git.1465806934.b8533b1:
+  + ceph-{mds,mon,osd,radosgw} systemd unit files need wants=time-sync.target
+    (pr#8802, issue#15606)
+  + Pipe: take a ref to existing while we are waiting (pr#9237, issue#15961)
+  + mon/Monitor: fix memory leak; add leaked key to tracked_conf_key (pr#9270,
+    issue#15852)
+  + ceph.in: fix exception when pool name has non-ascii characters (pr#9320,
+    issue#16017, bsc#972370)
+  + rpm: unconditionally set ceph user's primary group to ceph (SUSE) (pr#9424,
+    issue#16107)
+  + ceph-disk: workaround gperftool hang (pr#9427, issue#16104)
+  + Clean up hobject_t::max() values in decode, avoid comparing directly to
+    get_max() (pr#9614, issue#)
+  + osdc/Objecter: upper bound watch_check result (pr#9104, issue#15795)
+  + osd: handle boot racing with NOUP set (pr#9101, issue#15799)
+  + OSD: fix deadlock in OSD::_committed_osd_maps (pr#9103, issue#15797)
+  + rbd: close journal before removing (pr#9548, issue#15963)
+  + rbd: initial python APIs to support mirroring (pr#9550, issue#15969)
+  + remove invalid objectmap flag when objectmap is disabled (pr#9555,
+    issue#16147)
+  + rbd: check value of config override when setting image-meta (pr#9554,
+    issue#16084)
+  + test/rbd: fsx needs to shut down the journal (pr#9556, issue#16162)
+  + cls_rbd: mirror image status summary should read full directory (pr#9608,
+    issue#16189)
+  + librbd: refresh image if needed in mirror functions (pr#9609, issue#16216)
+  + TaskFinisher: use singleton SafeTimer and Finisher (pr#9580, issue#15996)
+  + librbd: journal IO error results in failed assertion in AioCompletion
+    (pr#9611, issue#16210)
+  + librbd: prevent error messages when journal externally disabled (pr#9610,
+    issue#16209)
+  + rbd-mirror: support bootstrap canceling (pr#9612, issue#16208)
+  + Remove reliance on FLAG_OMAP for reads (pr#9638)
+  + BackoffThrottle spins unnecessarily with very small backoff while the
+    throttle is full (pr#9579, issue#16006)
+  + rbd-mirror: refresh image after creating sync point (pr#9627, issue#16217)
+  + rbd-mirror: fix journal shut down ordering (pr#9628, issue#16224)
+  + rbd-mirror: do not propagate deletions when pool unavailable (pr#9630,
+    issue#16223)
+  + rbd-mirror: fix deletion propagation edge cases (pr#9629, issue#16231)
+  + qa: dynamic_features.sh: return error only if it failed on alive QEMU
+    (pr#9552, issue#15981)
+  + Python librbd API has default value of "features=0", which is causing the
+    clone operation to fail (pr#9553, issue#16038)
+
+-------------------------------------------------------------------
+Mon Jun 13 05:28:43 UTC 2016 - [email protected]
+
++++ 1617 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:Factory/.ceph.new/ceph-test.changes
--- /work/SRC/openSUSE:Factory/ceph/ceph.changes        2016-07-21 
08:17:44.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.ceph.new/ceph.changes   2016-08-05 
18:16:52.000000000 +0200
@@ -1,0 +2,60 @@
+Mon Aug 01 16:36:18 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1470069142.b15328c:
+  + rpm: remove newline from configure command
+
+-------------------------------------------------------------------
+Mon Aug 01 14:59:35 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1470063368.e6786e8:
+  + rpm: simplify openSUSE conditional
+
+-------------------------------------------------------------------
+Mon Aug 01 14:39:49 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1470061991.d6904b4:
+  + rpm: build with --disable-static on openSUSE
+    (encloses --disable-static in appropriate distro conditional)
+
+-------------------------------------------------------------------
+Wed Jul 27 19:34:06 UTC 2016 - [email protected]
+
+- Pass --disable-static to configure: Let's save the time and
+  resources by not building the static libraries instead of
+  deleting them in the install section again.
+- Drop required disk limit for ceph to from 28GB 20GB.
+
+-------------------------------------------------------------------
+Sun Jul 24 19:49:16 UTC 2016 - [email protected]
+
+- Raised ceph package _constraints to 28G disk and 11G memory 
+  (previous setting was valid only for "with minimal_debugging_information")
+
+-------------------------------------------------------------------
+Fri Jul 22 17:38:59 UTC 2016 - [email protected]
+
+- pre_checkin.sh: copy ceph.changes to ceph-test.changes
+
+-------------------------------------------------------------------
+Fri Jul 22 17:03:43 UTC 2016 - [email protected]
+
+- _constraints: set separate constraints for ceph.spec and ceph-test.spec 
+
+-------------------------------------------------------------------
+Fri Jul 22 13:33:31 UTC 2016 - [email protected]
+
+- Split ceph.spec into ceph.spec + ceph-test.spec
+  + Added pre_checkin.sh script to generate ceph-test.spec
+  + Reduced the constraints on resources required to build ceph and ceph-test 
packages
+
+-------------------------------------------------------------------
+Fri Jul 22 13:30:54 UTC 2016 - [email protected]
+
+- Update to version 10.2.2+git.1469189740.b62fb63:
+  + build: Added new configure option --with-tests
+  + build: Use WITH_TESTS flag to guard the build of ceph-test scripts/binaries
+  + rpm: Moved ceph-client-debug from ceph-base to ceph-test package
+  + rpm: Renamed bcond tests flag to make_check
+  + rpm: Added ceph_test_package bcond flag to control the build of ceph-test 
package
+
+-------------------------------------------------------------------

Old:
----
  ceph-10.2.2+git.1468935528.7232e18.tar.bz2

New:
----
  ceph-10.2.2+git.1470069142.b15328c.tar.bz2
  ceph-test.changes
  ceph-test.spec
  pre_checkin.sh

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ceph-test.spec ++++++
++++ 709 lines (skipped)

++++++ ceph.spec ++++++
--- /var/tmp/diff_new_pack.dGvsSe/_old  2016-08-05 18:16:57.000000000 +0200
+++ /var/tmp/diff_new_pack.dGvsSe/_new  2016-08-05 18:16:57.000000000 +0200
@@ -13,7 +13,12 @@
 #
 # Please submit bugfixes or comments via http://tracker.ceph.com/
 # 
-%bcond_with tests
+%if 0%{?suse_version}
+%bcond_with ceph_test_package
+%else
+%bcond_without ceph_test_package
+%endif
+%bcond_with make_check
 %bcond_with xio
 %bcond_without tcmalloc
 %bcond_with lowmem_builder
@@ -53,7 +58,7 @@
 # common
 
#################################################################################
 Name:          ceph
-Version:       10.2.2+git.1468935528.7232e18
+Version:       10.2.2+git.1470069142.b15328c
 Release:       0
 Summary:       User space components of the Ceph file system
 License:       LGPL-2.1 and CC-BY-SA-1.0 and GPL-2.0 and BSL-1.0 and 
GPL-2.0-with-autoconf-exception and BSD-3-Clause and MIT
@@ -509,6 +514,7 @@
 This package contains Python libraries for interacting with Cephs distributed
 file system.
 
+%if 0%{with ceph_test_package}
 %package -n ceph-test
 Summary:       Ceph benchmarks and test tools
 Group:         System Environment/Libraries
@@ -517,6 +523,7 @@
 Requires:      xmlstarlet
 %description -n ceph-test
 This package contains Ceph benchmarks and test tools.
+%endif
 
 %if 0%{with cephfs_java}
 
@@ -601,6 +608,9 @@
                 --libexecdir=%{_libexecdir} \
                --localstatedir=%{_localstatedir} \
                --sysconfdir=%{_sysconfdir} \
+%if 0%{?is_opensuse}
+               --disable-static \
+%endif
 %if 0%{?rhel} && ! 0%{?centos}
                 --enable-subman \
 %endif
@@ -611,6 +621,9 @@
                --with-nss \
                --without-cryptopp \
                --with-debug \
+%if 0%{without ceph_test_package}
+                --without-tests \
+%endif
 %if 0%{with cephfs_java}
                --enable-cephfs-java \
 %endif
@@ -660,7 +673,7 @@
 
 make "$PARALLEL_BUILD"
 
-%if 0%{with tests}
+%if 0%{with make_check}
 %check
 # run in-tree unittests
 make CHECK_ULIMIT=false %{?_smp_mflags} check
@@ -730,7 +743,6 @@
 %{_bindir}/ceph-run
 %{_bindir}/ceph-dencoder
 %{_bindir}/ceph-detect-init
-%{_bindir}/ceph-client-debug
 %{_bindir}/cephfs
 %{_bindir}/cephfs-data-scan
 %{_bindir}/cephfs-journal-tool
@@ -1344,8 +1356,10 @@
 %{python_sitelib}/ceph_volume_client.py*
 
 
#################################################################################
+%if 0%{with ceph_test_package}
 %files -n ceph-test
 %defattr(-,root,root,-)
+%{_bindir}/ceph-client-debug
 %{_bindir}/ceph_bench_log
 %{_bindir}/ceph_kvstorebench
 %{_bindir}/ceph_multi_stress_watch
@@ -1379,6 +1393,7 @@
 %{_mandir}/man8/ceph-debugpack.8*
 %dir %{_libdir}/ceph
 %{_libdir}/ceph/ceph-monstore-update-crush.sh
+%endif
 
 
#################################################################################
 %if 0%{with cephfs_java}

++++++ _constraints ++++++
--- /var/tmp/diff_new_pack.dGvsSe/_old  2016-08-05 18:16:57.000000000 +0200
+++ /var/tmp/diff_new_pack.dGvsSe/_new  2016-08-05 18:16:57.000000000 +0200
@@ -1,12 +1,34 @@
 <?xml version="1.0"?>
 <constraints>
-  <hardware>
-    <disk>
-       <size unit="G">40</size>
-    </disk>
-    <memory>
-       <size unit="G">11</size>
-    </memory>
-  </hardware>
+
   <sandbox>kvm</sandbox>
+
+  <overwrite>
+    <conditions>
+      <package>ceph</package>
+    </conditions>
+    <hardware>
+      <disk>
+         <size unit="M">19950</size>
+      </disk>
+      <memory>
+         <size unit="G">8</size>
+      </memory>
+    </hardware>
+  </overwrite>
+
+  <overwrite>
+    <conditions>
+      <package>ceph-test</package>
+    </conditions>
+    <hardware>
+      <disk>
+         <size unit="G">40</size>
+      </disk>
+      <memory>
+         <size unit="G">11</size>
+      </memory>
+    </hardware>
+  </overwrite>
+
 </constraints>

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.dGvsSe/_old  2016-08-05 18:16:57.000000000 +0200
+++ /var/tmp/diff_new_pack.dGvsSe/_new  2016-08-05 18:16:57.000000000 +0200
@@ -1,5 +1,5 @@
 <servicedata>
 <service name="tar_scm">
             <param name="url">git://github.com/SUSE/ceph.git</param>
-          <param 
name="changesrevision">7232e187533f205bcc5a5f0dbaec8f9830531601</param></service>
+          <param 
name="changesrevision">b15328cb435130e9a861b3e4df96fff64e5e5f41</param></service>
 </servicedata>
\ No newline at end of file

++++++ ceph-10.2.2+git.1468935528.7232e18.tar.bz2 -> 
ceph-10.2.2+git.1470069142.b15328c.tar.bz2 ++++++
/work/SRC/openSUSE:Factory/ceph/ceph-10.2.2+git.1468935528.7232e18.tar.bz2 
/work/SRC/openSUSE:Factory/.ceph.new/ceph-10.2.2+git.1470069142.b15328c.tar.bz2 
differ: char 11, line 1

++++++ pre_checkin.sh ++++++
#!/bin/bash

set -f

function packages_files {
  local spec_file=$1
  local exclude_pkg=$2
  local in_files=false
  local result=""
  
  while IFS='' read -r line || [[ -n "$line" ]]; do
  
    case $line in
    "%files "*)
        pkg=`echo "$line" | sed 's/%files.* \(\w\+\)/\1/g'`
        if [[ $pkg == $exclude_pkg ]]; then
          in_files=false
          continue
        fi
        in_files=true
        continue
        ;;
    "%post"* | "%pre"* | "%preun"* | "%postun"*)
      in_files=false
      continue
      ;;
    esac
    
    result=""
    changed=true
    while [[ $in_files == true ]] && [[ $changed == true ]]; do
      changed=false
      case $line in
      "%if"* | "" | "%defattr"* | "%endif"* | "%else"* | "#"* | "%docdir"*)
        break
        ;;
      "%dir"*)
        break # for now we'll ignore %dir entries
        ;;
      *)
        result=`echo "$line" | sed -e 's/%config \(.*\)/\1/g' \
                                   -e 's/%config(.*) \(.*\)/\1/g' \
                                   -e 's/%attr(.*) \(.*\)/\1/g' \
                                   -e 's/%exclude \(.*\)/\1/g'`
        if [[ ! $line == $result ]]; then
          changed=true
                line=$result
        continue
        fi
        ;;
      esac
      
      # process path variables
      result=`echo "$result" | sed -e 's!%{_bindir}!/usr/bin!g' \
                                   -e 's!%{_docdir}!/usr/share/doc/packages!g' \
                                   -e 's!%{_sbindir}!/usr/sbin!g' \
                                   -e 's!%{_libdir}!/usr/lib64!g' \
                                   -e 's!%{_mandir}!/usr/share/man!g' \
                                   -e 's!%{_sysconfdir}!/etc!g' \
                                   -e 's!%{_includedir}!/usr/include!g' \
                                   -e 's!%{_unitdir}!/usr/lib/systemd/system!g' 
\
                                   -e 
's!%{python_sitelib}!/usr/lib/python2.7/site-packages!g' \
                                   -e 's!%{_datadir}!/usr/share!g' \
                                   -e 
's!%{python_sitearch}!/usr/lib64/python2.7/site-packages!g' \
                                   -e 's!%{_javadir}!/usr/share/java!g' \
                                   -e 's!%{_libexecdir}!/usr/lib!g' \
                                   -e 's!%{_prefix}!/usr!g' \
                                   -e 's!%{_localstatedir}!/var!g' \
                                   -e 's!%{_tmpfilesdir}!/usr/lib/tmpfiles.d!g' 
\
                                   -e 
's!%{_udevrulesdir}!/usr/lib/udev/rules.d!g'`
  
      # sanity check
      if [[ "$result" == "%"* ]]; then
        echo "ERROR: unparsable file entry: $result"
        exit 1
      fi 
  
      echo "$result"
    done
  done < $spec_file
}

function get_package_summary {
  local spec_file=$1
  local pkg_name=$2
  local in_package=false
  
  while IFS='' read -r line || [[ -n "$line" ]]; do
  
    case $line in
    "%package "*)
      pkg=`echo "$line" | sed 's/%package.* \(\w\+\)/\1/g'`
      if [[ ! $pkg == $pkg_name ]]; then
        in_package=false
      else
        in_package=true
      fi
      ;;
    "%prep"* | "%build"* | "%install"*)
      in_package=false
      ;;
    "Summary:"*)
      if [[ $in_package == true ]]; then
        echo $line
        break
      fi
      ;;
    esac
  done < $spec_file
}

function get_package_requires {
  local spec_file=$1
  local pkg_name=$2
  local in_package=false
  
  while IFS='' read -r line || [[ -n "$line" ]]; do
  
    case $line in
    "%package "*)
      pkg=`echo "$line" | sed 's/%package.* \(\w\+\)/\1/g'`
      if [[ ! $pkg == $pkg_name ]]; then
        in_package=false
      else
        in_package=true
      fi
      ;;
    "%prep"* | "%build"* | "%install"*)
      in_package=false
      ;;
    "Requires:"*)
      if [[ $in_package == true ]]; then
        echo $line
      fi
      ;;
    esac
  done < $spec_file
}

function get_package_description {
  local spec_file=$1
  local pkg_name=$2
  local in_desc=false
  
  while IFS='' read -r line || [[ -n "$line" ]]; do
  
    case $line in
    "%description "*)
      pkg=`echo "$line" | sed 's/%description.* \(\w\+\)/\1/g'`
      if [[ ! $pkg == $pkg_name ]]; then
        in_desc=false
      else
        in_desc=true
      fi
      continue
      ;;
    "%prep"* | "%build"* | "%install"* | "%package"* | "%if"* | "%endif"*)
      in_desc=false
      continue
      ;;
    esac
   
    if [[ $in_desc == true ]]; then
      echo "$line"
    fi
  done < $spec_file
}

function transform_spec_file {
  local spec_file=$1
  local include_pkg=$2
  local rm_files=$3
  local summary=$4
  local description=$5
  local requires=$6
  local in_package=false
  local in_files=false
  local in_desc=false
  
  while IFS='' read -r line || [[ -n "$line" ]]; do
  
    case $line in
    "%bcond_with ceph_test_package"*)
      line="%bcond_without ceph_test_package"
      ;;
    "Name:"*)
      line="Name:           $include_pkg"
      ;;
    "Summary:"*)
      if [[ $in_package == false ]]; then
        line="$summary"
      fi
      ;;
    "Source0:"*)
      line=`echo $line | sed 's/%{name}/ceph/g'`
      ;;
    "%setup -q")
      line="$line -n ceph-%version"
      ;;
    "Requires:"*)
      if [[ $in_package == false ]]; then
        line=""
      fi
      ;;
    "Requires(post):"*)
      if [[ $in_package == false ]]; then
        IFS=''
        for r in "$requires"; do
          echo "$r"
        done
      fi
      ;;
    "%description"*)
      if [[ $in_package == false ]]; then
        in_desc=true
        echo "$line"
        echo "$description"
        echo ""
        continue
      fi
      ;;
    "%package "*)
        #pkg=`echo "$line" | sed 's/%package.* \(\w\+\)/\1/g'`
        #if [[ $pkg == $include_pkg ]]; then
        #  in_package=false
        #else
          in_package=true
          continue
        #fi
        in_desc=false
        ;;
    "%prep"* | "%build"* | "%install"*)
      in_package=false
      in_desc=false
      ;;
    "%files "*)
        pkg=`echo "$line" | sed 's/%files.* \(\w\+\)/\1/g'`
        if [[ $pkg == $include_pkg ]]; then
          in_files=false
        else
          in_files=true
          continue
        fi
        ;;
    "%changelog"*)
      in_files=false
      ;;
    "%clean"*)
      in_package=false
      IFS=''
      for rf in "$rm_files"; do
        echo "$rf"
      done
      echo ""
      echo "dirs=\`find %{buildroot} -type d -empty\`"
      echo "while [[ -n \$dirs ]]; do"
      echo "  for d in \$dirs; do"
      echo "    rm -rf \$d"
      echo "  done"
      echo "dirs=\`find %{buildroot} -type d -empty\`"
      echo "done"
      echo ""
      ;;
    "#"* | "%"*)
      in_desc=false
      ;;
    esac

  if [[ $in_package == false ]] && [[ $in_files == false ]] && [[ $in_desc == 
false ]]; then
    echo $line
  else
    if [[ $line == "%if"* ]] || [[ $line == "%endif"* ]]; then
      echo $line
    fi
  fi

  done < $spec_file
}

function generate_rm_exclude_files {
  local exclude_list=$1
  local buildroot=$2

  for f in $exclude_list; do
    echo "rm -rf $buildroot$f"
  done
}

function copy_changes_file {
  local dest_pkg=$1

  cp ceph.changes ${dest_pkg}.changes
}

PACKAGE="ceph-test"
SPEC_FILE="ceph.spec"

files=`packages_files $SPEC_FILE $PACKAGE`
if [[ "$?" == "1" ]]; then
 echo "ERROR: "
 echo $files
 exit 0
fi
rm_files=`generate_rm_exclude_files "$files" "%{buildroot}"`
summ=`get_package_summary $SPEC_FILE $PACKAGE`
desc=`get_package_description $SPEC_FILE $PACKAGE`
reqs=`get_package_requires $SPEC_FILE $PACKAGE`
transform_spec_file $SPEC_FILE $PACKAGE "$rm_files" "$summ" "$desc" "$reqs" > 
$PACKAGE.spec
copy_changes_file $PACKAGE

Reply via email to