5
當我嘗試爲我的Linux發行版構建一個Python RPM包時,出現以下錯誤。我在這個過程中看到警告,但我不認爲這些與「-ba:未知錯誤」有關,任何想法如何讓它運行?Python bdist_rpm -ba:未知選項錯誤:命令'rpm'失敗,退出狀態1
錯誤:
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='[email protected]',
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",
],
)
當我運行蟒蛇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 <[email protected]>
%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)
或者爲suse系統安裝'zypper install rpm-build'。 – sebix