Add license and doc to rpm package
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Wed, 8 Apr 2020 15:54:51 +0000 (17:54 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Mon, 6 Sep 2021 11:55:52 +0000 (13:55 +0200)
Failed to do this using setup.py and hacks in make_dist.py,
at least when doc and license files should not end up in
site-packages with the source code. Therefore change (and
simplify) the whole build process by re-creating
make_dist.py to just create a tarball that is compatible
with standard python spec files (like that of our QA) and
provide such a simple spec file to be used with rpmbuild.

README
make_dist.py
pyi2ncommon.spec [new file with mode: 0644]
setup.py
setup_guide.txt [deleted file]

diff --git a/README b/README
index 84479c6..bd6eaa6 100644 (file)
--- a/README
+++ b/README
@@ -8,11 +8,6 @@ To run unittests: ./run_unitests.sh
 
 API documentation: see doc/about_docu.rst
 
-To create a source tar.gz and spec file, run
-  ./make_dist.sh
-That will try to build distributions for python 3.3 and 3.6 and will fail if
-these are not installed on the build machine. To build for a different version
-set, call
-  ./make_dist.sh VER1 VER2
-make_dist uses python distutils with info in setup.py.
-The result will be in ./dist.
+To build an rpm package, run:
+
+  make_dist.py
index f8e0022..849e6f5 100755 (executable)
 #!/usr/bin/env python3
 
 """
-Create rpm packages of pyi2ncommon for various python versions.
+Create source tarball, create rpm from it together with spec file.
 
-Usage::
-
-    make_dist.py [RELEASE [PY_VERSION_1 [PY_VERSION_2 ...]]]
-
-RELEASE defaults to current git commit hash, default versions to build for are
-3.6 for avocado and 3.3 for i2n system. All python versions used must be
-installed on local machine.
-
-Calls setup.py with different args. Adds %check section to .spec file. Runs
-unittests first.
-
-This script relies on one feature I accidentally stumbled over: it appears that
-setting install-lib to /usr/lib/python{VERSION}/site-packages is translated by
-setup.py to installation requirement python(abi) = {VERSION}
+Create a source tarball that is compatbile with standard build pipelines. Then
+run rpmbuild on it to create an installable rpm.
 
 .. codeauthor:: Intra2net AG <info@intra2net.com>
 """
 
-import os
-from os.path import join, isfile
 import sys
-from subprocess import call, check_output
-from tempfile import mkstemp
-from configparser import ConfigParser
-from glob import iglob
-import time
-
-INSTALL_DIR_PATTERN = '/usr/lib/python{}/site-packages'
-
-RPM_OPTIONS = dict(packager='Intra2net', group='Intra2net',
-                   vendor='Intra2net AG')
-
-DIST_DIR = 'dist'
-SPEC_FILE = join(DIST_DIR, 'pyi2ncommon.spec')
-
-CFG_FILE = 'setup.cfg'
-
-SPEC_START = b"""
-# spec file created automatically by make_dist.sh -- do not modify!
-
-"""
-
-SPEC_CHECK_SECTION = b"""%check
-PYTHONPATH=./src:$PYTHONPATH && python3 -m unittest discover test
-
-"""
-
-
-def check_py_version(py_version):
-    """Test that python version is installed."""
-    try:
-        result = call(['python{}'.format(py_version), '--version'])
-    except Exception:
-        result = 1
-    if result != 0:
-        raise RuntimeError('Python version {} not installed, '
-                           'run {} VERSION'.format(py_version, sys.argv[0]))
-
-
-def run_unittests(py_version):
-    """Run unittests with given python version. Re-Run with LANG=C."""
-    # Run twice: first with environment copied from call (env=None) and one
-    # in empoverished environment without unicode capability
-    for env in None, dict(LANG='C', PATH=os.environ['PATH']):
-        try:
-            print('Running unittests with python {} and env={}'
-                  .format(py_version, env))
-            result = call(['python{}'.format(py_version), '-m', 'unittest',
-                           'discover'], env=env)
-        except Exception as exc:
-            raise RuntimeError('Unittests with python {} and env={} failed. {}'
-                               .format(py_version, env, exc))
-        if result != 0:
-            raise RuntimeError('Unittests with python {} and env={} failed '
-                               '(command returned {}).'
-                               .format(py_version, env, result))
-
-
-def run_setup(command, cmd_line_args=None, install_options=None,
-              need_zip35=False):
+from os.path import join, basename, dirname, expanduser
+from re import compile as re_compile
+import tarfile
+from shutil import copy
+from subprocess import run
+
+# path to spec file
+BASE_DIR = dirname(__file__)
+SPEC_FILE = join(BASE_DIR, 'pyi2ncommon.spec')
+
+# regular expressions extracting relevant information from spec file
+VERSION_REGEX = re_compile(r'^Version:\s*(\S+)\s*$')
+NAME_REGEX = re_compile(r'^Name:\s*(\S+)\s*$')
+SOURCE_REGEX = re_compile(r'^Source0:\s*(\S+)\s*$')
+
+# dir to contain tarball
+DIST_DIR = join(BASE_DIR, 'dist')
+
+# files and dirs to add to tarball; keep in sync with %files secion in spec
+DATA = (
+    'COPYING.GPL', 'Linking-Exception.txt', 'README', 'CONTRIBUTING',
+    'setup.py', 'src', 'test', 'doc/about_docu.rst', 'doc/conf.py'
+)
+
+# dir where rpmbuild expects its tarballs
+RPM_SOURCE_DIR = expanduser(join('~', 'rpmbuild', 'SOURCES'))
+
+
+def get_spec_info():
+    """Extract name, version and source0 from spec file."""
+    name = None
+    version = None
+    source = None
+    with open(SPEC_FILE, 'rt') as reader:
+        for line in reader:
+            if name is not None and version is not None and source is not None:
+                source = source.replace('%{name}', name)\
+                               .replace('%{version}', version)
+                return name, version, source
+            match = NAME_REGEX.match(line)
+            if match:
+                name = match.group(1)
+                continue
+            match = VERSION_REGEX.match(line)
+            if match:
+                version = match.group(1)
+                continue
+            match = SOURCE_REGEX.match(line)
+            if match:
+                source = match.group(1)
+                continue
+
+
+def tar_add_filter(tarinfo):
     """
-    Run python3 setup.py with command and options.
+    Filter function for adding files to tarball
 
-    Need this function since setup.py bdist_rpm does not accept --prefix and
-    --install-lib options. Need to write them into cfg file from which they
-    are then read ... Grrr!
+    Return `None` for pycache and pyc, meaning "do not add". Return input
+    otherwise to add the file.
     """
-    config = ConfigParser()
-    rpm_options = dict(RPM_OPTIONS.items())
-    if need_zip35:
-        rpm_options['requires'] = 'python3-zipfile35'
-    if rpm_options:
-        config['bdist_rpm'] = rpm_options
-    if install_options:
-        config['install'] = install_options
-    need_delete = False
-    try:
-        with open(CFG_FILE, mode='xt') as write_handle:
-            need_delete = True
-            config.write(write_handle)
-        cmd = ['python3', 'setup.py', command]
-        if cmd_line_args:
-            cmd += cmd_line_args
-        if call(cmd) != 0:
-            raise RuntimeError('Running setup.py failed (cmd: {})'
-                               .format(' '.join(cmd)))
-    finally:
-        if need_delete:
-            os.unlink(CFG_FILE)
-            need_delete = False
-
-
-def create_rpm(py_version, release):
-    """Create rpm that will install pyi2ncommon for given python version."""
-    print('Creating RPM for python version {}'.format(py_version))
-
-    # define options for where to install library;
-    # It appears this is automatically translated into requirement
-    # python(abi) = version   !
-    install_options = {'prefix': '/'}
-    install_options['install-lib'] = INSTALL_DIR_PATTERN.format(py_version)
-
-    # if py_version is smaller than 3.5, need zipfile35 as extra dependency
-    need_zip35 = py_version.startswith('2') or py_version.startswith('3.0') or\
-        py_version.startswith('3.1') or py_version.startswith('3.2') or \
-        py_version.startswith('3.3') or py_version.startswith('3.4')
-
-    # create rpm
-    start_time = time.time()
-    run_setup('bdist_rpm', install_options=install_options,
-              cmd_line_args=['--release', release], need_zip35=need_zip35)
-
-    # find rpm and rename it
-    newest_names = []
-    newest_time = 0
-    for filename in iglob(join(DIST_DIR, 'pyi2ncommon-*.noarch.rpm')):
-        filetime = os.stat(filename).st_mtime
-        if filetime > newest_time:
-            newest_time = filetime
-            newest_names = [filename, ]
-        elif filetime == newest_time:
-            newest_names.append(filename)
-
-    if not newest_names:
-        raise RuntimeError('No pyi2ncommon rpm file found in {}'
-                           .format(DIST_DIR))
-    elif newest_time < start_time:
-        raise RuntimeError('Newest pyi2ncommon rpm file in {} is too old'
-                           .format(DIST_DIR))
-    elif len(newest_names) > 1:
-        raise RuntimeError('Multiple newest pyi2ncommon rpm files: {}'
-                           .format(newest_names))
-    newest_name = newest_names[0]
-    mod_name = newest_name[:-11] + '.py' + py_version.replace('.', '') + \
-               newest_name[-11:]
-    os.rename(newest_name, mod_name)
-    return mod_name
-
-
-def create_spec(release):
-    """Create .spec file and modify it."""
-    print('adapting spec file')
-    # create spec
-    run_setup('bdist_rpm', cmd_line_args=['--spec-only', '--release', release])
-
-    # adapt
-    temp_handle = None
-    temp_name = None
-    try:
-        temp_handle, temp_file = mkstemp(dir=DIST_DIR, text=False,
-                                         prefix='pyi2ncommon-adapt-',
-                                         suffix='.spec')
-        os.write(temp_handle, SPEC_START)
-        did_write_check = False
-        with open(SPEC_FILE, 'rb') as reader:
-            for line in reader:
-                print('spec file: {}'.format(line.rstrip()))
-                if line.strip() == b'%install':
-                    os.write(temp_handle, SPEC_CHECK_SECTION)
-                    did_write_check = True
-                os.write(temp_handle, line)
-        os.close(temp_handle)
-        temp_handle = None
-
-        if not did_write_check:
-            raise RuntimeError('Could not find place to write %check section')
-
-        # replace
-        os.unlink(SPEC_FILE)
-        os.rename(temp_file, SPEC_FILE)
-        temp_file = None
-    finally:
-        # clean up temp
-        if temp_handle is not None:
-            os.close(temp_handle)
-        if temp_name is not None and isfile(temp_file):
-            os.unlink(temp_file)
-    return SPEC_FILE
+    if tarinfo.name.endswith('.pyc'):
+        print(f'Skip {tarinfo.name}')
+        return None
+    if '__pycache__' in tarinfo.name:
+        print(f'Skip {tarinfo.name}')
+        return None
+    print(f'Adding {tarinfo.name}')
+    return tarinfo
+
+
+def create_tarball():
+    """Create tarball, return its full path."""
+    name, version, tarball_file = get_spec_info()
+    tarball_path = join(DIST_DIR, tarball_file)
+    print(f'Creating {tarball_path}')
+    dirname = f'{name}-{version}'
+    with tarfile.open(tarball_path, 'w:gz') as tarball:
+        for entry in DATA:
+            tarball.add(entry, join(dirname, entry), filter=tar_add_filter)
+    return tarball_path
+
+
+def build_rpm(tarball_path):
+    """Create rpm using rpmbuild with spec file and newly created tarball."""
+    copy(tarball_path, RPM_SOURCE_DIR)
+    run(('rpmbuild', '-bb', SPEC_FILE))
 
 
 def main():
     """
-    Main function, called when running file as script
+    Main function, called when running file as script.
 
-    see module doc for more info
+    See module doc for more info.
     """
-    release = None
-    py_versions = ['3.7', ]
-    if len(sys.argv) > 1:
-        if sys.argv[1] in ('--help', '-h'):
-            print('make_dist.py [releasename [py-ver1 [py-ver2...]]]')
-            print('  e.g.: make_dist.py featuretest 3.7')
-            return 2
-        release = sys.argv[1].replace('-', '_')
-    else:
-        release = check_output(['git', 'log', '--pretty=format:%h', '-n', '1'],
-                               universal_newlines=True)
-    if len(sys.argv) > 2:
-        py_versions = sys.argv[2:]
-    files_created = []
-    for py_version in py_versions:
-        check_py_version(py_version)
-        run_unittests(py_version)
-        files_created.append(create_rpm(py_version, release))
-    files_created.append(create_spec(release))
-
-    for filename in files_created:
-        print('Created {}'.format(filename))
-    print('(+ probably source rpm and tar.gz)')
+    tarball_path = create_tarball()
+    build_rpm(tarball_path)
+    print(f'{basename(__file__)} finished successfully.')
+
     return 0
 
 
 if __name__ == '__main__':
     sys.exit(main())
+
diff --git a/pyi2ncommon.spec b/pyi2ncommon.spec
new file mode 100644 (file)
index 0000000..6f44dbd
--- /dev/null
@@ -0,0 +1,61 @@
+Name:           pyi2ncommon
+Version:        1.6.5
+# note: keep version in sync with setup.py
+Release:        1%{?dist}
+Summary:        Intra2net library of common helper utilities
+Group:          Development/Languages
+License:        Intra2net AG
+URL:            http://www.intra2net.com
+Source0:        %{name}-%{version}.tar.gz
+
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch:      noarch
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+
+%description
+Helper modules for Intra2net source code that are used in several places and/or are of general interest
+
+%package -n python3-%{name}
+Summary:        Intra2net library of common helper utilities
+Group:          Development/Languages
+%description -n python3-%{name}
+Helper modules for Intra2net source code that are used in several places and/or are of general interest
+
+%prep
+%setup -q
+
+if [ -n "%{patches}" ]; then
+    # Use git to apply patches, so that permission changes work
+    git init
+    # Setup a committer
+    if [ -z "$GIT_COMMITTER_NAME" ]; then
+        git config user.email "opensource@intra2net.com"
+        git config user.name "Intra2net Automatic Patch Applicator"
+    fi
+    git add .
+    git commit --no-gpg-sign -a -q -m 'Initial commit for %{version}'
+    git am -p1 %{patches}
+fi
+
+%build
+%py3_build
+
+%check
+ln -s src pyi2ncommon    # make src importable from current dir
+PYTHONPATH=.:$PYTHONPATH python3 -m unittest discover test
+
+%install
+%py3_install
+
+%files -n python3-%{name}
+# keep in sync with list in make_dist.py
+%defattr(-,root,root,-)
+%license COPYING.GPL
+%license Linking-Exception.txt
+%doc README
+%doc CONTRIBUTING
+%doc doc/conf.py
+%doc doc/about_docu.rst
+%{python3_sitelib}/%{name}
+%{python3_sitelib}/%{name}-*.egg-info
index a4c64c2..cd5b1fc 100644 (file)
--- a/setup.py
+++ b/setup.py
 #
 # Copyright (c) 2016-2018 Intra2net AG <info@intra2net.com>
 
+# For packaging pyi2ncommon into an rpm, use make_dist.py
+
 from distutils.core import setup
 
 setup(name='pyi2ncommon',
-      version='1.6.5',
+      version='1.6.5',       # keep in sync with spec file
       description='Intra2net library of common python helper utilities',
       long_description='Helper modules for Intra2net python code that are '
                        'used in several places and/or are of '
@@ -33,14 +35,7 @@ setup(name='pyi2ncommon',
       url='http://www.intra2net.com',
       packages=['pyi2ncommon', 'pyi2ncommon.cnfline'],
       package_dir={'pyi2ncommon': 'src'},
-      # these files go into the srpm but not the rpm when building them using
-      # setup.py bdist_rpm
-      # however, when using build_and_install, they get installed, so leave
-      # them out (developers have source tree from git anyway)
-      #data_files=['check.sh',
-      #            'templates/template.py', 'templates/test_template.py',
-      #            'doc/index.rst', 'doc/modules.rst', 'doc/conf.py',
-      #            'doc/about_docu.rst'],
+      license_files=('COPYING.GPL', 'Linking-Exception.txt'),
       license='GPLv2 + linking exception',
       classifiers=[
           "Programming Language :: Python :: 3",
diff --git a/setup_guide.txt b/setup_guide.txt
deleted file mode 100644 (file)
index e074beb..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-Some minimal required setup on a machine in order to build the RPM:
-
-# minimal dependencies
-dnf install -y rpm-build
-dnf install -y python33
-dnf install -y python36
-
-# invoke script
-./make_dist.py
-
-# current problem with cache
-#rm src/cnfline/__pycache__/ -fr
-#rm src/cnfline/__pycache__/ -fr
-Checking for unpackaged file(s): /usr/lib/rpm/check-files /mnt/local/pyi2ncommon/build/bdist.linux-x86_64/rpm/BUILDROOT/pyi2ncommon-1.4-1.x86_64
-error: Installed (but unpackaged) file(s) found:
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/__init__.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/__init__.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/argparse_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/argparse_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/arnied_wrapper.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/arnied_wrapper.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/buffers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/buffers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/call_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/call_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/cnfvar.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/cnfvar.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/connd_state.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/connd_state.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/dial.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/dial.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/iter_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/iter_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/log_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/log_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/log_read.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/log_read.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/mail_utils.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/mail_utils.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/mk_config.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/mk_config.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/simple_cnf.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/simple_cnf.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/sysmisc.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/sysmisc.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/test_data_sync.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/test_data_sync.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/text_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/text_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/type_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/type_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/v4_addr_range.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/v4_addr_range.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/web_interface.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/web_interface.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/zip_stream.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/zip_stream.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/__init__.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/__init__.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_cnfvar.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_cnfvar.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_group.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_group.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_intraclient.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_intraclient.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_key.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_key.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_nic.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_nic.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_provider.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_provider.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_proxy_accesslist.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_proxy_accesslist.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_proxy_profile.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_proxy_profile.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_user.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_user.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_vpnconn.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_vpnconn.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/cnfline.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/cnfline.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/configure_proxy_antivirus.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/configure_proxy_antivirus.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/configure_webfilter.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/configure_webfilter.cpython-33.pyo
-
-
-RPM build errors:
-    Installed (but unpackaged) file(s) found:
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/__init__.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/__init__.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/argparse_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/argparse_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/arnied_wrapper.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/arnied_wrapper.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/buffers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/buffers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/call_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/call_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/cnfvar.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/cnfvar.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/connd_state.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/connd_state.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/dial.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/dial.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/iter_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/iter_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/log_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/log_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/log_read.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/log_read.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/mail_utils.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/mail_utils.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/mk_config.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/mk_config.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/simple_cnf.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/simple_cnf.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/sysmisc.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/sysmisc.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/test_data_sync.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/test_data_sync.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/text_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/text_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/type_helpers.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/type_helpers.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/v4_addr_range.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/v4_addr_range.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/web_interface.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/web_interface.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/zip_stream.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/__pycache__/zip_stream.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/__init__.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/__init__.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_cnfvar.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_cnfvar.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_group.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_group.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_intraclient.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_intraclient.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_key.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_key.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_nic.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_nic.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_provider.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_provider.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_proxy_accesslist.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_proxy_accesslist.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_proxy_profile.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_proxy_profile.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_user.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_user.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_vpnconn.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/build_vpnconn.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/cnfline.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/cnfline.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/configure_proxy_antivirus.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/configure_proxy_antivirus.cpython-33.pyo
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/configure_webfilter.cpython-33.pyc
-   /usr/lib/python3.3/site-packages/pyi2ncommon/cnfline/__pycache__/configure_webfilter.cpython-33.pyo
-error: command 'rpmbuild' failed with exit status 1
-Traceback (most recent call last):
-  File "./make_dist.py", line 158, in <module>
-    sys.exit(main())
-  File "./make_dist.py", line 152, in main
-    for filename in (create_rpm('3.3'), create_rpm('3.6'), create_spec()):
-  File "./make_dist.py", line 85, in create_rpm
-    run_setup('bdist_rpm', install_options=install_options)
-  File "./make_dist.py", line 67, in run_setup
-    .format(' '.join(cmd)))
-RuntimeError: Running setup.py failed (cmd: python3 setup.py bdist_rpm)
-