尝试为我的 Linux 发行版构建 Python RPM 包时出现以下错误。我在此过程中看到警告,但我认为这些与“-ba:未知错误”无关,有什么想法可以让它运行吗?
错误:
bdist_rpm -ba: unknown option error: command 'rpm' failed with exit status 1
我正在运行以下 python setup.py 脚本:
setup(
name='Tester',
version='0.1.0',
author='My Name',
author_email='emailaddress@gmail.com',
packages=['tester'],
license='LICENSE.txt',
description='IMAP Email Reader.',
long_description=open('README.txt').read(),
install_requires=[
"Django >= 1.1.1",
"caldav == 0.1.4",
],
)
当我运行python setup.py bdist_rpm时,它会在以下位置创建一个 Tester.spec 文件~/Tester/build/bdist.linux-x86_64/rpm/SPECS directory
:
%define name Tester
%define version 0.1.0
%define unmangled_version 0.1.0
%define release 1
Summary: Email Reader.
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{unmangled_version}.tar.gz
License: LICENSE.txt
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
BuildArch: noarch
Vendor: My Name <emailaddress@gmail.com>
%description
%prep
%setup -n %{name}-%{unmangled_version}
%build
python setup.py build
%install
python setup.py install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root)