#8 Improve "with" conditional statement as inline.
Merged 6 years ago by jaruga. Opened 6 years ago by jaruga.

file modified
+6 -13
@@ -148,16 +148,10 @@

  BuildRequires: readline-devel

  # Needed to pass test_set_program_name(TestRubyOptions)

  BuildRequires: procps

- %if %{with systemtap}

- BuildRequires: %{_bindir}/dtrace

- %endif

+ %{?with_systemtap:BuildRequires: %{_bindir}/dtrace}

  # RubyGems test suite optional dependencies.

- %if %{with git}

- BuildRequires: git

- %endif

- %if %{with cmake}

- BuildRequires: %{_bindir}/cmake

- %endif

+ %{?with_git:BuildRequires: git}

+ %{?with_cmake:BuildRequires: %{_bindir}/cmake}

  # Required to test hardening.

  BuildRequires: %{_bindir}/checksec

  BuildRequires: multilib-rpm-config
@@ -723,10 +717,8 @@

  # runruby, so re-enable them).

  make runruby TESTRUN_SCRIPT="--enable-gems %{SOURCE12}"

  

- %if %{with systemtap}

  # Check if systemtap is supported.

- make runruby TESTRUN_SCRIPT=%{SOURCE13}

- %endif

+ %{?with_systemtap:make runruby TESTRUN_SCRIPT=%{SOURCE13}}

  

  DISABLE_TESTS=""

  
@@ -1042,8 +1034,9 @@

  %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec

  

  %changelog

- * Sat Oct 21 2017 Jun Aruga <jaruga@redhat.com> - 2.4.2-86

+ * Fri Oct 27 2017 Jun Aruga <jaruga@redhat.com> - 2.4.2-86

  - Add macro to remove rubypick dependency.

+ - Improve "with" conditional statement as inline.

  

  * Thu Oct 19 2017 Jun Aruga <jaruga@redhat.com> - 2.4.2-85

  - Add macros to remove systemtap, git and cmake dependencies.

This PR to update with conditional statement as inline statement.

I tested below cases

$ fedpkg --release master srpm

$ mock -r fedora-rawhide-x86_64 --without=systemtap --without=git --without=cmake *.rpm

->
on mock environment,

  • /usr/bin/dtrace does not exist
  • Package git does not exist
  • /usr/bin/cmake does not exist
  • "make runruby TESTRUN_SCRIPT=test_systemtap.rb" is not in build.log.
$ mock -r fedora-rawhide-x86_64 *.rpm

->
on mock environment,
- /usr/bin/dtrace exists
- Package git exists
- /usr/bin/cmake exists.
- "make runruby TESTRUN_SCRIPT=test_systemtap.rb" is in build.log.

rpmlint: ok
Install binary RPMs: ok
Run ruby on mock environment: ok

The release bump is not needed, otherwise LGTM. Feel free to merge it ....

rebased onto 9bc7bec

6 years ago

ok thanks for the review.
I removed the release dump.

Pull-Request has been merged by jaruga

6 years ago
Metadata