From 78585aca5ca9b1b0c139ab7cac7321219ad69559 Mon Sep 17 00:00:00 2001 From: Rickard Osser Date: Thu, 16 Sep 2021 14:58:04 +0200 Subject: [PATCH] Added RPM-creation option to setup.py. --- setup.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/setup.py b/setup.py index 94fd652..796bd9a 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,9 @@ import os from setuptools import find_packages, setup +from distutils.core import setup +import distutils.command.bdist_rpm +import distutils.command.install version = '0.1.2a1' install_requires = ['six'] @@ -13,6 +16,23 @@ with open(os.path.join(here, 'CHANGELOG.rst')) as fp: longdesc += "\n\n" + fp.read() +class bdist_rpm(distutils.command.bdist_rpm.bdist_rpm): + + def _make_spec_file(self): + spec = distutils.command.bdist_rpm.bdist_rpm._make_spec_file(self) + for path, files , perm in permissions: + + ## + # Add a line to the SPEC file to change the permissions of a + # specific file upon install. + # + # example: + # %attr(666, root, root) path/file + # + spec.extend(['%attr{} {}/{}'.format(perm, path, files)]) + + return spec + setup( name='python-libxdo', version=version,