@@ -4,26 +4,39 @@ vendor="Sam Clements <sam.clements@datasift.com>"
44
55define fpm
66 @mkdir -p dist
7- fpm -s python -t rpm --package $@ --vendor ${vendor} --epoch 1
7+ fpm -s python -t rpm --package $@ --vendor ${vendor} --epoch 0
88endef
99
1010
1111default :
1212 @echo " Usage:"
1313 @echo " make riemann-client - build generic riemann-client RPM"
14- @echo " make el6 - build CentOS 6 riemann-client RPM"
14+ @echo " make el6 - build CentOS 6 riemann-client and protobuf RPM"
1515 @echo " make el5 - build CentOS 5 riemann-client and protobuf RPM"
1616
1717
1818version =$(shell python setup.py --version)
19- release =4
19+ release =6
2020
2121riemann-client : dist/python-riemann-client-${version}-${release}.noarch.rpm
2222
2323dist/python-riemann-client-${version}-${release}.noarch.rpm :
2424 ${fpm} --iteration ${release} --version ${version} setup.py
2525
2626
27+ el6 : riemann-client.el6
28+
29+ riemann-client.el6 : dist/python-riemann-client-${version}-${release}.el6.noarch.rpm
30+
31+ dist/python-riemann-client-${version}-${release}.el6.noarch.rpm :
32+ ${fpm} --iteration ${release} .el6 --version ${version} \
33+ --python-bin python2.6 \
34+ --no-python-dependencies \
35+ --depends ' python-argparse >= 1.1' \
36+ --depends ' python-protobuf >= ${protobuf_version}-${protobuf_release}.el6' \
37+ setup.py
38+
39+
2740el5 : riemann-client.el5 protobuf.el5
2841
2942riemann-client.el5 : dist/python26-riemann-client-${version}-${release}.el5.noarch.rpm
@@ -32,43 +45,45 @@ dist/python26-riemann-client-${version}-${release}.el5.noarch.rpm:
3245 ${fpm} --version ${version} --iteration ${release} .el5 \
3346 --python-bin python2.6 \
3447 --python-package-name-prefix python26 \
48+ --no-python-dependencies \
49+ --depends ' python26-argparse >= 1.1' \
50+ --depends ' python26-protobuf >= ${protobuf_version}-${protobuf_release}.el5' \
3551 setup.py
3652
53+
54+
3755protobuf_version =2.5.0
38- protobuf_release =3
39- protobuf_source =https://pypi.python.org/packages/source/p/protobuf/protobuf-${protobuf_version}.tar.gz
56+ protobuf_release =4
57+ protobuf_source =build/protobuf-${protobuf_version}
58+
59+ protobuf.el5 : dist/python-protobuf-${protobuf_version}-${protobuf_release}.el6.noarch.rpm
60+
61+ dist/python-protobuf-${protobuf_version}-${protobuf_release}.el6.noarch.rpm : ${protobuf_source}
62+ ${fpm} --version ${protobuf_version} --iteration ${protobuf_release} .el6 \
63+ --python-bin python2.6 \
64+ --conflicts ' protobuf-python' \
65+ ${protobuf_source} /setup.py
4066
4167protobuf.el5 : dist/python26-protobuf-${protobuf_version}-${protobuf_release}.el5.noarch.rpm
4268
43- dist/python26-protobuf-${protobuf_version}-${protobuf_release}.el5.noarch.rpm : build/protobuf-${protobuf_version }
69+ dist/python26-protobuf-${protobuf_version}-${protobuf_release}.el5.noarch.rpm : ${protobuf_source }
4470 ${fpm} --version ${protobuf_version} --iteration ${protobuf_release} .el5 \
4571 --python-package-name-prefix python26 \
4672 --python-bin python2.6 \
47- build/protobuf- ${protobuf_version } /setup.py
73+ ${protobuf_source } /setup.py
4874
4975# easy_install pulls the full protobuf package from an external site, this
5076# fetches the exact package we want to use. This also fixes permissions for the
5177# 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.
78+ # world readable, meaning that non-root users can't import the package).
79+
80+ protobuf_source_url =https://pypi.python.org/packages/source/p/protobuf/protobuf-${protobuf_version}.tar.gz
5481
5582build/protobuf-${protobuf_version} :
5683 @mkdir -p build
57- curl -sq ${protobuf_source } | tar xz --directory build
84+ curl -sq ${protobuf_source_url } | tar xz --directory build
5885 chmod -R g+w,o+r build/protobuf-${protobuf_version} /protobuf.egg-info
5986 @touch build/protobuf-${protobuf_version}
6087
61- el6 : riemann-client.el6
62-
63- riemann-client.el6 : dist/python-riemann-client-${version}-${release}.el6.noarch.rpm
64-
65- dist/python-riemann-client-${version}-${release}.el6.noarch.rpm :
66- ${fpm} --iteration ${release} .el6 --version ${version} \
67- --python-bin python2.6 \
68- --no-python-dependencies \
69- --depends ' python-argparse >= 1.1' \
70- --depends ' protobuf-python >= 2.3.0' \
71- setup.py
72-
7388
7489.PHONY : default riemann-client el5 riemann-client.el5 protobuf.el5 el6 riemann-client.el6
0 commit comments