Search code examples
pythonrpmsetuptools

setuptools not creating requierd section in rpm.spec file


I am trying to build a rpm from a python project i have using setuptools. In my setup file I specify the install_requires section but this does not translate over to the rpm file. I checked the .spec file and I can see its missing any idea why ? If its not possible any suggestions are welcomed.

When I make a egg and use easy_install pip it does catch the dependencies.

Setup.py:

#!/usr/bin/env python                                                           
from setuptools import setup, find_packages                                     

setup(name='FakeUE',                                                            
      version='0.1',                                                            
      description=',Demo of packaged spam',                                   
      author='MrCool',                                                   
      author_email='[email protected]',                                    
      url='http://www.coolguy.com',                                       
      packages=find_packages('spam'),                                         
      package_dir={'':'spam'},                                                
      install_requires=["Twisted >= 17",                                        
                        "pyserial >= 3.3",                                      
                        "PyBluez >= 0.22",                                      
                        ]                                                       
      ) 

Spec file:

%define name spam 
%define version 0.1 
%define unmangled_version 0.1 
%define unmangled_version 0.1 
%define release 1 

summary: ,demo of packaged spam 
name: %{name} 
version: %{version} 
release: %{release} 
source0: %{name}-%{unmangled_version}.tar.gz 
license: unknown 
group: development/libraries 
buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot 
prefix: %{_prefix} 
buildarch: noarch 
vendor: mr cool <cool guy> 
url: http://www.coolguyRus.com 

%description 
unknown 

%prep 
%setup -n %{name}-%{unmangled_version} -n %{name}-%{unmangled_version} 

%build 
python setup.py build 

%install 
python setup.py install --single-version-externally-managed -o1 --root=$rpm_build_root --record=installed_files 

%clean 
rm -rf $rpm_build_root 

%files -f installed_files 
%defattr(-,root,root)                          

Solution

  • In case someone else ends up in the same place. I ended up creating the tar.gz file with python

    python setup.py sdist
    

    And then rolling my own .spec file with rpmbuild with the needed requirements like so.

    Requires: python-twisted-core, python-devel,pyserial, ect