rpmbuild of ansible tarball results in error: line 9: Illegal char '$' in: Version: $VERSION

518 views
Skip to first unread message

Paul Davies

unread,
Apr 8, 2016, 6:38:02 AM4/8/16
to Ansible Project
Hi

I'm not experienced in RPMbuilds so I may simply be doing this wrong

I have downloaded both ansible-latest.tr.gz and ansible-2.0.2.0-0.3.rc3.tar.gz from http://releases.ansible.com/ansible/

I have tried to build an RPM using rpmbuild -ta <filename> for both files and both result in the error: line 9: Illegal char '$' in: Version:   $VERSION

I have never tried this before so I don't know if I am simply doing this the wrong way or if there is a problem in the tarball

Centos 7

thanks
Paul

Johannes Kastl

unread,
Apr 9, 2016, 1:55:42 PM4/9/16
to ansible...@googlegroups.com
On 08.04.16 12:38 Paul Davies wrote:

> I have tried to build an RPM using rpmbuild -ta <filename> for both files
> and both result in the error: line 9: Illegal char '$' in: Version:
> $VERSION

Looks like the macros ($VERSION) do not get filled in. Do you need to
run automake or configure or similar in the source directory (unpacked
tarball) before that?

Is there no rpm of the version you would like to have?

The opensuse build service has a package for RHEL7, but it seems
broken atm:
https://build.opensuse.org/package/show/systemsmanagement/ansible

But maybe you can take a look at how it is packaged there...

Johannes

signature.asc

Johannes Kastl

unread,
Apr 9, 2016, 2:16:31 PM4/9/16
to ansible...@googlegroups.com
On 09.04.16 19:55 Johannes Kastl wrote:

> Is there no rpm of the version you would like to have?

I built a version of ansible for CentOS_7 on the opensuse
buildservice, if you want to give it a try:

http://download.opensuse.org/repositories/home:/ojkastl_buildservice:/CentOS_Zeug/CentOS_7/

Johannes

signature.asc

John Barker

unread,
Apr 12, 2016, 2:28:31 AM4/12/16
to Ansible Project
For reference:
make rpm

Ki-Hyun Sung

unread,
Nov 23, 2017, 7:40:41 PM11/23/17
to Ansible Project
Hi  Johannes

I get this error when building from the tarball (ansible version 2.4.0.0), also on Centos 7

error: line 10: Illegal char '"' in: Release: 100.git201711240000"".el7.centos

Just wondering if you ran into a similar issue? Googling that error message presents me with just two search results!
One of which is this forum.

Basically I have installed epel-release, asciidoc and rpmbuild packages.
Then extracted the tarball, cd into the root of it, and ran make rpm.
That is when I hit that issue.

I am also not familiar with rpm build, or Linux in general - any help would be much appreciated!

-Darren

Toshio Kuratomi

unread,
Nov 24, 2017, 10:48:45 AM11/24/17
to ansible...@googlegroups.com
This looks like you aren't getting the tarballs from the official source: https://releases.ansible.com/ansible/

Note that we also are building nightly rpms (repositories for centos and fedora).  Look in https://releases.ansible.com/ansible/rpm

-Toshio

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a0ea06e2-4d8b-4e8e-8e74-a5eb9ff21283%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Todd Zullinger

unread,
Nov 24, 2017, 12:17:44 PM11/24/17
to ansible...@googlegroups.com
Toshio Kuratomi wrote:
> This looks like you aren't getting the tarballs from the official source:
> https://releases.ansible.com/ansible/

This still happens with the offical tarballs. The 'make rpm' target
does not work as documented due to numerous issues, which I tried to
document in my reply last night.

Why the OP isn't using the officially provided rpm packages is another
question, of course. But the documentation does tell users that 'make
rpm' should work from both a git clone and a tarball.

http://docs.ansible.com/ansible/latest/intro_installation.html#latest-release-via-yum

"You can also build an RPM yourself. From the
root of a checkout or tarball, use the make rpm
command to build an RPM you can distribute and
install."

If you try that with 2.0.2.0-0.3.rc3 as the OP in this thread, 2.4.0.0
as the poster you replied to, or even with 2.4.1.0, it fails.

I don't get the error mentioned in the subject, but I wouldn't be
surprised to find that system differences could tickle the Makefile
to produce a bogus string in the version tag as opposed to the broken
release tag that is easily reproducible:

# yum -d0 -e0 install -y epel-release
# yum -d0 -e0 install -y asciidoc python2-devel python-jinja2 python-setuptools python-yaml rpm-build
# useradd rpmbuild
# su -l rpmbuild
$ curl -s -O https://releases.ansible.com/ansible/ansible-2.0.2.0-0.3.rc3.tar.gz
$ tar -xf ansible-2.0.2.0-0.3.rc3.tar.gz
$ cd ansible-2.0.2.0/
$ make rpm
...
error: line 10: Illegal char '"' in: Release: 0.git201711240000"".el7.centos
make: *** [rpm] Error 1

Without passing OFFICIAL=yes to make rpm, the process can't work. I
put more details in an earlier reply to another thread, here:

https://groups.google.com/forum/#!topic/ansible-project/NTmpFBEr9Rg

I poked a little to see about fixing this, but it requires more than
just fixing the GITINFO var and I didn't have the time to untangle
things and submit a properly tested patch.

Basically, the Makefile assumes that if git is installed, you must be
in a git clone rather than a tarball. That's clearly a faulty
assumption. Fixing it requires a number of changes to the logic to
ensure that the required variables are set appropriately for either a
git clone or a tarball build.

--
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Age doesn't always bring wisdom. Sometimes it comes alone.

Reply all
Reply to author
Forward
0 new messages