Permalink
Browse files

Fix build & packaging

  • Loading branch information...
1 parent dc588d9 commit ad6b3a75cbaf5f6a5b24e27b87a8c3c6a2e84f08 @ieure committed Sep 28, 2009
Showing with 16 additions and 11 deletions.
  1. +12 −11 Makefile
  2. +4 −0 debian/rules
View
23 Makefile
@@ -1,34 +1,35 @@
SRCDIR = cassandra
+GENDIR = tmp
SCRIPTDIR = scripts
INTERFACE = https://svn.apache.org/repos/asf/incubator/cassandra/trunk/interface/cassandra.thrift
-all: sdist egg
+all: $(SRCDIR) $(SCRIPTDIR)/Cassandra-remote
-egg: $(SRCDIR) scripts/Cassandra-remote
+egg: all
python setup.py bdist_egg
-sdist: $(SRCDIR) scripts/Cassandra-remote
+sdist: all
python setup.py sdist
$(SRCDIR)/Cassandra-remote: $(SRCDIR)
-$(SRCDIR): $(SRCDIR)/gen-py
- mv $^/cassandra/* $@
+$(SRCDIR): $(GENDIR)/gen-py
+ mkdir -p $@
+ cp -R $^/cassandra/* $@
-scripts/Cassandra-remote: $(SRCDIR)/Cassandra-remote
+$(SCRIPTDIR)/Cassandra-remote: $(SRCDIR)/Cassandra-remote
mkdir -p $(SCRIPTDIR)
sed -e s/'import Cassandra'/'from cassandra import Cassandra'/ \
-e s/'from ttypes import '/'from cassandra.ttypes import '/ \
< $^ > $@
chmod --reference $^ $@
- rm $^
-$(SRCDIR)/gen-py: cassandra.thrift
- mkdir -p $(SRCDIR)
- thrift -o $(shell dirname $@) -gen py:new_style=True $^
+$(GENDIR)/gen-py: cassandra.thrift
+ -mkdir -p $(GENDIR)
+ thrift -o $(GENDIR) -gen py:new_style=True $^
update:
@echo "Updating to: $(shell svn info $(INTERFACE) | grep ^Last\ Changed\ Rev | cut -d: -f2)"
svn cat $(INTERFACE) > $(shell basename $(INTERFACE))
clean:
- rm -rf $(SRCDIR) $(SCRIPTDIR) build dist *.egg-info
+ rm -rf $(GENDIR) $(SRCDIR) $(SCRIPTDIR) gen-* build dist *.egg-info
View
4 debian/rules
@@ -14,6 +14,10 @@ DEB_PYTHON_INSTALL_ARGS := ${DEB_PYTHON_INSTALL_ARGS_ALL}
UPSTREAM_VERSION=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
PYVER=$(shell python -V 2>&1 | cut -d ' ' -f 2 | cut -d . -f 1-2)
+configure/python-cassandra::
+ make all
+
clean::
# hack (CDBS bug -- see #300149)
-rm -rf build
+ make clean

0 comments on commit ad6b3a7

Please sign in to comment.