Skip to content

Instantly share code, notes, and snippets.

Created March 9, 2013 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5124039 to your computer and use it in GitHub Desktop.
Save anonymous/5124039 to your computer and use it in GitHub Desktop.
A Makefile for Python bindings for the Boilerpipe Java package. Boilerpipe enables HTML page extraction of text and removal of boilerplate materials. This method can easily be extended for other Java packages that you want bindings for, only by making minor modifications to the Makefile below. Depends on: - Boileripe https://code.google.com/p/bo…
PYTHON=/usr/bin/python2.6
JCC=$(PYTHON) -m jcc.__main__
PKGVERSION=1.2.0
BOILERDIR=/path/to/boilerpipe-1.2.0
JARS=$(BOILERDIR)/boilerpipe-1.2.0.jar
# JARS+=
CLASSPATH=$(BOILERDIR)/lib/nekohtml-1.9.13.jar
CLASSPATH+=$(BOILERDIR)/lib/xerces-2.9.1.jar
GENERATE=$(JCC) $(foreach jar,$(JARS),--jar $(jar)) \
$(JCCFLAGS) \
--package java.lang java.lang.System \
java.lang.Runtime \
java.lang.IllegalStateException \
java.lang.IndexOutOfBoundsException \
--package java.util java.util.Arrays \
java.util.HashMap \
java.util.HashSet \
java.util.NoSuchElementException \
java.text.SimpleDateFormat \
java.text.DecimalFormat \
java.text.Collator \
--package java.util.regex \
--package java.net \
--package java.io java.io.StringReader \
java.io.InputStreamReader \
java.io.FileInputStream \
$(foreach classpath,$(CLASSPATH),--classpath $(classpath)) \
$(foreach classpath,$(CLASSPATH),--include $(classpath)) \
--python boilerpipe \
--files 4 \
--version $(PKGVERSION)
generate: jars
$(GENERATE)
jars: $(JARS)
compile: jars
$(GENERATE) --build $(DEBUG_OPT)
install: jars
$(GENERATE) --install $(DEBUG_OPT) $(INSTALL_OPT)
bdist: jars
$(GENERATE) --bdist
all: jars compile
@echo build of Boilerpipe complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment