diff --git a/make_spec-dir.patch b/make_spec-dir.patch new file mode 100644 index 0000000..c031474 --- /dev/null +++ b/make_spec-dir.patch @@ -0,0 +1,29 @@ +commit b4a269575a2050c347f64a53b656047375ecce8a +Author: Michal Cyprian +Date: Thu Apr 21 14:53:20 2016 +0200 + + Create spec file directory if missing + +diff --git a/pyp2rpm/bin.py b/pyp2rpm/bin.py +index 2458a8a..a76dfb6 100644 +--- a/pyp2rpm/bin.py ++++ b/pyp2rpm/bin.py +@@ -1,5 +1,6 @@ + import getpass + import logging ++import os + + from pyp2rpm.convertor import Convertor + from pyp2rpm import settings +@@ -110,7 +111,11 @@ def main(package, v, d, s, r, proxy, srpm, p, b, o, t, venv): + else: + # if user provide save_path then save spec in provided path + spec_path = d + '/' + spec_name ++ spec_dir = os.path.dirname(spec_path) ++ if not os.path.exists(spec_dir): ++ os.makedirs(spec_dir) + logger.debug('Opening specfile: {0}.'.format(spec_path)) ++ + if not utils.PY3: + converted = converted.encode('utf-8') + with open(spec_path, 'w') as f: diff --git a/pyp2rpm.spec b/pyp2rpm.spec index c740d49..fab8721 100644 --- a/pyp2rpm.spec +++ b/pyp2rpm.spec @@ -3,7 +3,7 @@ Name: %{pypi_name} Version: 3.0.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Convert Python packages to RPM SPECFILES License: MIT @@ -17,6 +17,8 @@ Patch1: archive_encoding.patch # Optional require virtualenv-api is not included in this branch # virtualenv module tests must be skiped Patch2: remove_venv_test.patch +# Create directory for spec file if missing +Patch3: make_spec-dir.patch BuildArch: noarch @@ -48,6 +50,7 @@ Mageia Python Policy. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 # Remove bundled egg-info rm -rf %{pypi_name}.egg-info @@ -69,6 +72,9 @@ PYTHONPATH="." py.test-3 %changelog +* Thu Apr 21 2016 Michal Cyprian - 3.0.2-2 +- Create specfile directory if missing + * Thu Apr 21 2016 Michal Cyprian - 3.0.2-1 - Update to 3.0.2