| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- Makefile -*- |
| 3 |
|
| 4 |
include /usr/share/dpkg/pkg-info.mk |
| 5 |
|
| 6 |
export PYBUILD_NAME=mecab |
| 7 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 8 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 9 |
|
| 10 |
%: |
| 11 |
dh $@ --with python3,ruby |
| 12 |
|
| 13 |
override_dh_auto_configure: |
| 14 |
dh_auto_configure -- --with-perl5=/usr/bin/perl --libexecdir=/usr/lib/ |
| 15 |
mkdir -p java/org/chasen/mecab |
| 16 |
for lang in perl python ruby java; do cp -rp $(CURDIR)/debian/$$lang $(CURDIR); $(MAKE) -C swig $$lang; done |
| 17 |
dh_auto_configure --sourcedirectory=python --buildsystem=pybuild |
| 18 |
dh_auto_configure --sourcedirectory=ruby --buildsystem=ruby |
| 19 |
|
| 20 |
override_dh_auto_build: |
| 21 |
dh_auto_build -- CXXFLAGS+=-g |
| 22 |
dh_auto_build --sourcedirectory=python --buildsystem=pybuild |
| 23 |
dh_auto_build --sourcedirectory=ruby --buildsystem=ruby |
| 24 |
$(MAKE) -C java |
| 25 |
|
| 26 |
override_dh_auto_install: |
| 27 |
dh_auto_install |
| 28 |
# delayed perl configuration since it needs mecab.so to link |
| 29 |
dh_auto_configure --sourcedirectory=perl |
| 30 |
dh_auto_build --sourcedirectory=perl |
| 31 |
chrpath -d $(CURDIR)/perl/blib/arch/auto/MeCab/MeCab.so |
| 32 |
dh_auto_install --sourcedirectory=perl --destdir=debian/libmecab-perl |
| 33 |
dh_auto_install --sourcedirectory=python --buildsystem=pybuild |
| 34 |
dh_auto_install --buildsystem=ruby |
| 35 |
mkdir -p $(CURDIR)/debian/libmecab-java/usr/share/java |
| 36 |
cp -p java/MeCab.jar $(CURDIR)/debian/libmecab-java/usr/share/java/MeCab-$(DEB_VERSION_UPSTREAM).jar |
| 37 |
mkdir -p $(CURDIR)/debian/libmecab-jni/usr/lib/jni |
| 38 |
cp -p java/libMeCab.so $(CURDIR)/debian/libmecab-jni/usr/lib/jni |
| 39 |
# move gemspec to multiarch path |
| 40 |
find $(CURDIR)/debian/ruby-mecab/usr/share/rubygems-integration \ |
| 41 |
-name '*.gemspec' | while read f; do \ |
| 42 |
install -d $(CURDIR)/debian/ruby-mecab/usr/lib/$(DEB_HOST_MULTIARCH)/rubygems-integration/specifications/; \ |
| 43 |
mv "$$f" $(CURDIR)/debian/ruby-mecab/usr/lib/$(DEB_HOST_MULTIARCH)/rubygems-integration/specifications/; \ |
| 44 |
done |
| 45 |
find $(CURDIR)/debian/ruby-mecab/usr/share/rubygems-integration \ |
| 46 |
-type d -empty -delete |
| 47 |
|