# Can not build rpm from src

**URL:** <https://forum.ansible.com/t/can-not-build-rpm-from-src/11567>\
**Category:** Ansible Project\
**Created:** [May 23, 2012, 12:34pm UTC](https://forum.ansible.com/t/can-not-build-rpm-from-src/11567 "2012-05-23T12:34:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas\_Davour](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Andreas\_Davour](https://forum.ansible.com/u/Andreas_Davour)\
**Post date:** [May 23, 2012, 12:34pm UTC](https://forum.ansible.com/t/can-not-build-rpm-from-src/11567/1 "2012-05-23T12:34:06Z")

</div>

I have some problems building rpms from the source. This is what I did.

wget [https://github.com/downloads/ansible/ansible/ansible-0.3.1.tar.gz](https://github.com/downloads/ansible/ansible/ansible-0.3.1.tar.gz)  
tar zxvf ansible-0.3.1.tar.gz  
cd ansible-0.3.1  
make rpm

Then I get the following output, and I know for a fact that at least the examples/hosts file is there:

cat: VERSION: No such file or directory  
Cleaning up distutils stuff  
rm -rf build  
rm -rf dist  
Cleaning up byte compiled python stuff  
find . -type f -regex ".\*\.py[co]$" -delete  
Cleaning up editor backup files  
find . -type f \( -name "\*~" -or -name "#\*" \) -delete  
find . -type f \( -name "\*.swp" \) -delete  
Cleaning up asciidoc to man transformations and results  
find ./docs/man -type f -name "\*.xml" -delete  
find ./docs/man -type f -name "\*.asciidoc" -delete  
Cleaning up output from test runs  
rm -rf test/test\_data  
Cleaning up RPM building stuff  
rm -rf MANIFEST rpm-build  
Cleaning up Debian building stuff  
rm -rf debian  
rm -rf deb-build  
python setup.py sdist -t MANIFEST.in  
/usr/lib/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'install\_requires'  
&nbsp;&nbsp;warnings.warn(msg)  
running sdist  
warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)  
warning: sdist: standard file not found: should have one of README, README.txt  
writing manifest file 'MANIFEST'  
creating ansible-0.3.1  
creating ansible-0.3.1/bin  
creating ansible-0.3.1/lib  
creating ansible-0.3.1/lib/ansible  
making hard links in ansible-0.3.1...  
hard linking setup.py -\> ansible-0.3.1  
hard linking bin/ansible -\> ansible-0.3.1/bin  
hard linking bin/ansible-playbook -\> ansible-0.3.1/bin  
hard linking lib/ansible/\_\_init\_\_.py -\> ansible-0.3.1/lib/ansible  
hard linking lib/ansible/callbacks.py -\> ansible-0.3.1/lib/ansible  
hard linking lib/ansible/connection.py -\> ansible-0.3.1/lib/ansible  
hard linking lib/ansible/constants.py -\> ansible-0.3.1/lib/ansible  
hard linking lib/ansible/errors.py -\> ansible-0.3.1/lib/ansible  
hard linking lib/ansible/inventory.py -\> ansible-0.3.1/lib/ansible  
hard linking lib/ansible/playbook.py -\> ansible-0.3.1/lib/ansible  
hard linking lib/ansible/runner.py -\> ansible-0.3.1/lib/ansible  
hard linking lib/ansible/utils.py -\> ansible-0.3.1/lib/ansible  
creating dist  
tar -cf dist/ansible-0.3.1.tar ansible-0.3.1  
gzip -f9 dist/ansible-0.3.1.tar  
removing 'ansible-0.3.1' (and everything under it)  
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.92254  
+ umask 022  
+ cd /tmp/ansible-0.3.1/rpm-build  
+ cd /tmp/ansible-0.3.1/rpm-build  
+ rm -rf ansible-0.3.1  
+ /bin/gzip -dc /tmp/ansible-0.3.1/rpm-build/ansible-0.3.1.tar.gz  
+ tar -xf -  
+ STATUS=0  
+ '[' 0 -ne 0 ']'  
+ cd ansible-0.3.1  
++ /usr/bin/id -u  
+ '[' 0 = 0 ']'  
+ /bin/chown -Rhf root .  
++ /usr/bin/id -u  
+ '[' 0 = 0 ']'  
+ /bin/chgrp -Rhf root .  
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .  
+ exit 0  
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.92254  
+ umask 022  
+ cd /tmp/ansible-0.3.1/rpm-build  
+ cd ansible-0.3.1  
+ /usr/bin/python setup.py build  
/usr/lib/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'install\_requires'  
&nbsp;&nbsp;warnings.warn(msg)  
running build  
running build\_py  
creating build  
creating build/lib  
creating build/lib/ansible  
copying lib/ansible/connection.py -\> build/lib/ansible  
copying lib/ansible/utils.py -\> build/lib/ansible  
copying lib/ansible/inventory.py -\> build/lib/ansible  
copying lib/ansible/playbook.py -\> build/lib/ansible  
copying lib/ansible/callbacks.py -\> build/lib/ansible  
copying lib/ansible/errors.py -\> build/lib/ansible  
copying lib/ansible/runner.py -\> build/lib/ansible  
copying lib/ansible/\_\_init\_\_.py -\> build/lib/ansible  
copying lib/ansible/constants.py -\> build/lib/ansible  
running build\_scripts  
creating build/scripts-2.4  
copying and adjusting bin/ansible -\> build/scripts-2.4  
copying and adjusting bin/ansible-playbook -\> build/scripts-2.4  
changing mode of build/scripts-2.4/ansible from 644 to 755  
changing mode of build/scripts-2.4/ansible-playbook from 644 to 755  
+ exit 0  
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.92254  
+ umask 022  
+ cd /tmp/ansible-0.3.1/rpm-build  
+ cd ansible-0.3.1  
+ /usr/bin/python setup.py install -O1 --root=  
/usr/lib/python2.4/distutils/dist.py:236: UserWarning: Unknown distribution option: 'install\_requires'  
&nbsp;&nbsp;warnings.warn(msg)  
running install  
running build  
running build\_py  
running build\_scripts  
running install\_lib  
creating usr  
creating usr/lib  
creating usr/lib/python2.4  
creating usr/lib/python2.4/site-packages  
creating usr/lib/python2.4/site-packages/ansible  
copying build/lib/ansible/connection.py -\> usr/lib/python2.4/site-packages/ansible  
copying build/lib/ansible/utils.py -\> usr/lib/python2.4/site-packages/ansible  
copying build/lib/ansible/inventory.py -\> usr/lib/python2.4/site-packages/ansible  
copying build/lib/ansible/playbook.py -\> usr/lib/python2.4/site-packages/ansible  
copying build/lib/ansible/callbacks.py -\> usr/lib/python2.4/site-packages/ansible  
copying build/lib/ansible/errors.py -\> usr/lib/python2.4/site-packages/ansible  
copying build/lib/ansible/runner.py -\> usr/lib/python2.4/site-packages/ansible  
copying build/lib/ansible/\_\_init\_\_.py -\> usr/lib/python2.4/site-packages/ansible  
copying build/lib/ansible/constants.py -\> usr/lib/python2.4/site-packages/ansible  
byte-compiling usr/lib/python2.4/site-packages/ansible/connection.py to connection.pyc  
&nbsp;&nbsp;File "usr/lib/python2.4/site-packages/ansible/connection.py", line 24  
&nbsp;&nbsp;&nbsp;&nbsp;with warnings.catch\_warnings():  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^  
SyntaxError: invalid syntax  
byte-compiling usr/lib/python2.4/site-packages/ansible/utils.py to utils.pyc  
byte-compiling usr/lib/python2.4/site-packages/ansible/inventory.py to inventory.pyc  
byte-compiling usr/lib/python2.4/site-packages/ansible/playbook.py to playbook.pyc  
&nbsp;&nbsp;File "usr/lib/python2.4/site-packages/ansible/playbook.py", line 371  
&nbsp;&nbsp;&nbsp;&nbsp;raise errors.AnsibleError("action is required for each item in tasks: offending task is %s" % name if name else "unknown")  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^  
SyntaxError: invalid syntax  
byte-compiling usr/lib/python2.4/site-packages/ansible/callbacks.py to callbacks.pyc  
byte-compiling usr/lib/python2.4/site-packages/ansible/errors.py to errors.pyc  
byte-compiling usr/lib/python2.4/site-packages/ansible/runner.py to runner.pyc  
byte-compiling usr/lib/python2.4/site-packages/ansible/\_\_init\_\_.py to \_\_init\_\_.pyc  
byte-compiling usr/lib/python2.4/site-packages/ansible/constants.py to constants.pyc  
writing byte-compilation script '/tmp/tmpwk\_M97.py'  
/usr/bin/python -O /tmp/tmpwk\_M97.py  
&nbsp;&nbsp;File "usr/lib/python2.4/site-packages/ansible/connection.py", line 24  
&nbsp;&nbsp;&nbsp;&nbsp;with warnings.catch\_warnings():  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^  
SyntaxError: invalid syntax  
&nbsp;&nbsp;File "usr/lib/python2.4/site-packages/ansible/playbook.py", line 371  
&nbsp;&nbsp;&nbsp;&nbsp;raise errors.AnsibleError("action is required for each item in tasks: offending task is %s" % name if name else "unknown")  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;^  
SyntaxError: invalid syntax  
removing /tmp/tmpwk\_M97.py  
running install\_scripts  
creating usr/bin  
copying build/scripts-2.4/ansible-playbook -\> usr/bin  
copying build/scripts-2.4/ansible -\> usr/bin  
changing mode of usr/bin/ansible-playbook to 755  
changing mode of usr/bin/ansible to 755  
+ mkdir -p /etc/ansible/  
+ cp examples/hosts /etc/ansible/  
cp: cannot stat `examples/hosts': No such file or directory  
error: Bad exit status from /var/tmp/rpm-tmp.92254 (%install)

RPM build errors:  
&nbsp;&nbsp;&nbsp;&nbsp;Bad exit status from /var/tmp/rpm-tmp.92254 (%install)  
make: \*\*\* [rpm] Error 1

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 23, 2012, 12:42pm UTC](https://forum.ansible.com/t/can-not-build-rpm-from-src/11567/2 "2012-05-23T12:42:12Z")

</div>

0.3.1 is actually packaged in Fedora, so I’m not sure what’s up with what you have here.

That being said, 0.4 will be out most likely _tonight_, so you probably can just do a “make rpm” from the git checkout of the devel branch if you want and should be good to go.

–Michael

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [May 23, 2012, 12:42pm UTC](https://forum.ansible.com/t/can-not-build-rpm-from-src/11567/3 "2012-05-23T12:42:56Z")

</div>

For clarification, you can also find Ansible in EPEL 6.

---

<div class="post-metadata">

**Author:** ![Andreas\_Davour](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Andreas\_Davour](https://forum.ansible.com/u/Andreas_Davour)\
**Post date:** [May 23, 2012, 12:58pm UTC](https://forum.ansible.com/t/can-not-build-rpm-from-src/11567/4 "2012-05-23T12:58:26Z")

</div>

> [1 \<text/plain; utf-8 (7bit)\>]  
> 0.3.1 is actually packaged in Fedora, so I'm not sure what's up with  
> what you have here.

This is done on a RHEL5 machine.

> That being said, 0.4 will be out most likely \*tonight\*, so you  
> probably can just do a "make rpm" from the git checkout of the devel  
> branch if you want and should be good to go.

I tried the same from a git clone, git checkout 0.3.1 and then copied that tree to the RHEL machine. That gave some other weird results, though.

Now I did try the 0.4 branch, though, and it worked. I was under the impression that it was next Wednesday, and not this one so I thought I'd stay with 0.3.1 instead. Apparently 0.4 was the way to go. Thanks.

-andreas
