1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto
export DEB_LDFLAGS_MAINT_APPEND =
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk
PY3REQUESTED := $(shell py3versions -r)
PY3DEFAULT := $(shell py3versions -d)
PYTHON3 := $(filter-out $(PY3DEFAULT),$(PY3REQUESTED)) python3
PERL_VENDOR_ARCH=$(shell perl -V:vendorarch|cut -d\' -f2)
%:
dh $@
override_dh_auto_configure:
dh_auto_configure
make -C bindings
cd bindings/python; sed -i "s/__version__/$(DEB_VERSION_UPSTREAM)/" setup.py
override_dh_auto_build:
dh_auto_build
cd bindings/perl; perl Makefile.PL \
INSTALL_BASE=$(CURDIR)/debian/libmarisa-perl/usr \
INSTALLARCHLIB=$(CURDIR)/debian/libmarisa-perl$(PERL_VENDOR_ARCH) \
INSTALLSITEARCH=$(CURDIR)/debian/libmarisa-perl$(PERL_VENDOR_ARCH) \
INSTALLVENDORARCH=$(CURDIR)/debian/libmarisa-perl$(PERL_VENDOR_ARCH) \
INC="-I../../include" \
LIBS="-L../../lib/marisa/.libs -lmarisa" \
CCFLAGS="$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" \
LDDLFLAGS="-shared -L/usr/local/lib -fstack-protector $(shell dpkg-buildflags --get LDFLAGS)"
cd bindings/python; \
set -ex; for python in $(PYTHON3); do \
$$python setup.py build_ext --include-dirs=../../include \
--library-dirs=../../lib/marisa/.libs; \
done
cd bindings/perl; make
cd bindings/ruby; ruby extconf.rb --with-opt-include=../../include \
--with-opt-lib=../../lib/marisa/.libs
sed -i 's/^V = 0/V = 1/' bindings/ruby/Makefile
sed -i 's%^sitearchdir = .*%sitearchdir = $$(exec_prefix)/lib/$(DEB_HOST_MULTIARCH)/ruby/$$(ruby_version)%' bindings/ruby/Makefile
cd bindings/ruby; make
override_dh_auto_install:
dh_auto_install
rm debian/tmp/usr/lib/*/libmarisa.la
cd bindings/python; \
set -ex; for python in $(PYTHON3); do \
$$python setup.py install \
--root=$(CURDIR)/debian/python3-marisa --install-layout=deb; \
done
( cd bindings/perl; find . -name "*.so*" -type f -exec chrpath --delete {} \; )
( cd bindings/perl ; make install )
rm $(CURDIR)/debian/libmarisa-perl$(PERL_VENDOR_ARCH)/auto/marisa/.packlist
rm $(CURDIR)/debian/libmarisa-perl$(PERL_VENDOR_ARCH)/perllocal.pod
rm $(CURDIR)/debian/libmarisa-perl$(PERL_VENDOR_ARCH)/sample.pl
cd bindings/ruby; make install DESTDIR=$(CURDIR)/debian/ruby-marisa
override_dh_gencontrol:
dh_gencontrol -- \
-V"ruby:Build-Version=$$(dpkg-query -f='$${Version}' -W ruby)"
execute_before_dh_autoreconf:
cp -pR bindings bindings.bak
cp -pR tests tests.bak
execute_after_dh_clean:
if [ -e bindings.bak ]; then \
rm -rf bindings; \
mv bindings.bak bindings; \
fi
if [ -e tests.bak ]; then \
rm -rf tests; \
mv tests.bak tests; \
fi
|