Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep)

爷,独闯天下 提交于 2019-12-03 12:29:22

Check out http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html, specifically the "-n — Set Name of Build Directory" section.

The %setup macro is expecting that after untaring the tar.gz, there will be a hero-01 directory available, but your hero-01.tar.gz probably creates some other directory name, probably one without the version included in the name.

So, for example, if there's a 'hero' directory instead of a 'hero-01' directory in /root/rpmbuild/BUILD after the untarring, then update the spec file to use '%setup -n hero' instead of just '%setup'.

In your rpmbuild folder, go to SOURCES and rename your source folder this way:

mypackage-1.0

then create the tarball:

mypackage-1.0.tar.gz

And it should work.

What happens is that after untarring the archive, rpmbuild expects a folder named mypackage-1.0 and not mypackage or mypackage-something else.

Respect naming conventions. Check Guidelines

Also noteworthy is that some tarballs will not create themselves as a parent directory to the install paths. I.e., my tarball has the tree:

usr
├── bin
│   ├── check_for_incorrect_quotes
│   └── check_for_incorrect_quotes.py
└── lib
    └── python2.6
        └── site-packages
            ├── incorrectquotes
            │   ├── check_for_incorrect_quotes.py
            │   ├── check_for_incorrect_quotes.pyc
            │   ├── __init__.py
            │   ├── __init__.pyc
            │   └── test
            │       ├── __init__.py
            │       └── __init__.pyc
            └── IncorrectQuotes-0.2.0-py2.6.egg-info
                ├── dependency_links.txt
                ├── entry_points.txt
                ├── PKG-INFO
                ├── requires.txt
                ├── SOURCES.txt
                └── top_level.txt

Because this is where it wants to install these packages

To make this work, you can just change setup -n to setup -c to create and move to that directory before untarring (You'll want to ctrl+f for "create directory (and change to it)")

TL;DR: setup -n -> setup -c might help

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!