Skip to content

Commit ef2cd35

Browse files
author
Sam Clements
committed
CentOS 5 protobuf package from source
1 parent 11d8eca commit ef2cd35

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

Makefile

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,28 @@ dist/python26-riemann-client-${version}-${release}.el5.noarch.rpm:
3535
setup.py
3636

3737
protobuf_version=2.5.0
38-
protobuf_release=2
38+
protobuf_release=3
39+
protobuf_source=https://pypi.python.org/packages/source/p/protobuf/protobuf-${protobuf_version}.tar.gz
3940

4041
protobuf.el5: dist/python26-protobuf-${protobuf_version}-${protobuf_release}.el5.noarch.rpm
4142

42-
dist/python26-protobuf-${protobuf_version}-${protobuf_release}.el5.noarch.rpm:
43+
dist/python26-protobuf-${protobuf_version}-${protobuf_release}.el5.noarch.rpm: build/protobuf-${protobuf_version}
4344
${fpm} --version ${protobuf_version} --iteration ${protobuf_release}.el5 \
44-
--python-package-name-prefix python26 protobuf
45-
45+
--python-package-name-prefix python26 \
46+
--python-bin python2.6 \
47+
build/protobuf-${protobuf_version}/setup.py
48+
49+
# easy_install pulls the full protobuf package from an external site, this
50+
# fetches the exact package we want to use. This also fixes permissions for the
51+
# package metadata, since those seem to be broken (the egg-info directory is not
52+
# world readable, meaning that non-root users can't import the package). If
53+
# you're reading this and need to fix this, I'm very sorry.
54+
55+
build/protobuf-${protobuf_version}:
56+
@mkdir -p build
57+
curl -sq ${protobuf_source} | tar xz --directory build
58+
chmod -R g+w,o+r build/protobuf-${protobuf_version}/protobuf.egg-info
59+
@touch build/protobuf-${protobuf_version}
4660

4761
el6: riemann-client.el6
4862

0 commit comments

Comments
 (0)