2010-12-14 21:38:00 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# -*- makefile -*-
|
|
|
|
# Sample debian/rules that uses debhelper.
|
|
|
|
#
|
|
|
|
# This file was originally written by Joey Hess and Craig Small.
|
|
|
|
# As a special exception, when this file is copied by dh-make into a
|
|
|
|
# dh-make output file, you may use that output file without restriction.
|
|
|
|
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
|
|
|
#
|
|
|
|
# Modified to make a template file for a multi-binary package with separated
|
|
|
|
# build-arch and build-indep targets by Bill Allombert 2001
|
|
|
|
|
|
|
|
# Uncomment this to turn on verbose mode.
|
|
|
|
#export DH_VERBOSE=1
|
|
|
|
|
|
|
|
# This has to be exported to make some magic below work.
|
|
|
|
export DH_OPTIONS
|
|
|
|
|
|
|
|
PYVERS := $(shell pyversions -r)
|
|
|
|
|
2016-01-10 15:25:57 +00:00
|
|
|
export CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
|
|
|
|
export CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
|
|
|
|
export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
|
|
|
|
export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
|
|
|
|
|
2010-12-14 21:38:00 +00:00
|
|
|
configure: configure-stamp
|
|
|
|
configure-stamp:
|
|
|
|
dh_testdir
|
2016-01-10 15:25:57 +00:00
|
|
|
|
2010-12-14 21:38:00 +00:00
|
|
|
# Add here commands to configure the package.
|
|
|
|
if [ -f bootstrap.sh ]; then $(CURDIR)/bootstrap.sh; fi
|
2017-01-26 01:41:06 +00:00
|
|
|
$(CURDIR)/configure --prefix=/usr --enable-plugin=no
|
2010-12-14 21:38:00 +00:00
|
|
|
|
|
|
|
touch configure-stamp
|
|
|
|
|
|
|
|
|
|
|
|
#Architecture
|
|
|
|
build: build-arch build-indep
|
|
|
|
# Tests disabled
|
|
|
|
# $(MAKE) -C test check
|
|
|
|
|
|
|
|
build-arch: build-arch-stamp
|
2016-03-24 23:51:09 +00:00
|
|
|
$(CURDIR)/compiler/cpp/thrift build-arch-stamp: configure-stamp
|
2010-12-14 21:38:00 +00:00
|
|
|
|
2016-09-10 05:02:19 +00:00
|
|
|
# Compile compiler
|
|
|
|
$(MAKE) -C $(CURDIR)/compiler/cpp
|
|
|
|
|
2017-01-26 01:41:06 +00:00
|
|
|
# Compile C++ library
|
|
|
|
$(MAKE) -C $(CURDIR)/lib/cpp
|
|
|
|
|
2011-04-12 20:36:12 +00:00
|
|
|
# Compile C (glib) library
|
|
|
|
$(MAKE) -C $(CURDIR)/lib/c_glib
|
|
|
|
|
2010-12-14 21:38:00 +00:00
|
|
|
# Python library
|
|
|
|
cd $(CURDIR)/lib/py && \
|
|
|
|
for py in $(PYVERS); do \
|
|
|
|
$$py setup.py build; \
|
|
|
|
$$py-dbg setup.py build; \
|
|
|
|
done
|
|
|
|
|
|
|
|
# PHP
|
|
|
|
cd $(CURDIR)/lib/php/src/ext/thrift_protocol && \
|
|
|
|
phpize && \
|
2016-03-24 23:51:09 +00:00
|
|
|
./configure && $(MAKE)
|
2010-12-14 21:38:00 +00:00
|
|
|
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
build-indep: build-indep-stamp
|
2016-03-24 23:51:09 +00:00
|
|
|
build-indep-stamp: configure-stamp $(CURDIR)/compiler/cpp/thrift
|
2010-12-14 21:38:00 +00:00
|
|
|
|
|
|
|
# Add here commands to compile the indep part of the package.
|
|
|
|
#$(MAKE) doc
|
|
|
|
|
|
|
|
# Java
|
|
|
|
cd $(CURDIR)/lib/java && \
|
2018-01-24 15:30:13 +00:00
|
|
|
./gradlew --no-daemon -Prelease=true jar
|
2010-12-14 21:38:00 +00:00
|
|
|
|
|
|
|
# C#
|
2020-02-22 15:51:51 +00:00
|
|
|
$(MAKE) -C $(CURDIR)/lib/netstd
|
2010-12-14 21:38:00 +00:00
|
|
|
|
2011-12-09 10:36:05 +00:00
|
|
|
# Ruby
|
|
|
|
$(MAKE) -C $(CURDIR)/lib/rb
|
|
|
|
|
2010-12-14 21:38:00 +00:00
|
|
|
# Perl
|
|
|
|
$(MAKE) -C $(CURDIR)/lib/perl INSTALLDIRS=vendor
|
|
|
|
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
rm -f build-arch-stamp build-indep-stamp configure-stamp
|
|
|
|
|
2016-03-24 23:51:09 +00:00
|
|
|
cd $(CURDIR)/lib/py && python setup.py clean --all
|
|
|
|
|
2010-12-14 21:38:00 +00:00
|
|
|
# Add here commands to clean up after the build process.
|
|
|
|
-$(MAKE) clean
|
|
|
|
|
|
|
|
dh_clean
|
|
|
|
|
|
|
|
install: install-indep install-arch
|
|
|
|
install-indep:
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
2016-12-19 19:57:54 +00:00
|
|
|
dh_prep -i
|
2010-12-14 21:38:00 +00:00
|
|
|
dh_installdirs -i
|
|
|
|
|
|
|
|
# Add here commands to install the indep part of the package into
|
|
|
|
# debian/<package>-doc.
|
|
|
|
#INSTALLDOC#
|
|
|
|
|
2016-03-24 23:51:09 +00:00
|
|
|
# Java
|
2010-12-14 21:38:00 +00:00
|
|
|
mkdir -p $(CURDIR)/debian/libthrift-java/usr/share/java/ && \
|
2018-01-24 15:30:13 +00:00
|
|
|
cp $(CURDIR)/lib/java/build/libs/libthrift*.jar \
|
2010-12-14 21:38:00 +00:00
|
|
|
$(CURDIR)/debian/libthrift-java/usr/share/java/
|
|
|
|
|
2016-03-24 23:51:09 +00:00
|
|
|
# Ruby
|
2011-12-09 10:36:05 +00:00
|
|
|
mkdir -p $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1 && \
|
|
|
|
cp $(CURDIR)/lib/rb/lib/thrift.rb \
|
|
|
|
$(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1
|
|
|
|
cp -r $(CURDIR)/lib/rb/lib/thrift \
|
|
|
|
$(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1
|
|
|
|
|
2010-12-14 21:38:00 +00:00
|
|
|
# C#
|
2020-02-22 15:51:51 +00:00
|
|
|
mkdir -p $(CURDIR)/debian/libthrift-netstd/usr/lib/cli/thrift/ && \
|
|
|
|
cp $(CURDIR)/lib/netstd/Thrift/bin/Release/netstandard2.0/Thrift.dll \
|
|
|
|
$(CURDIR)/debian/libthrift-netstd/usr/lib/cli/thrift/Thrift.dll
|
2010-12-14 21:38:00 +00:00
|
|
|
|
|
|
|
# Perl
|
2016-03-24 23:51:09 +00:00
|
|
|
$(MAKE) -C $(CURDIR)/lib/perl install DESTDIR=$(CURDIR)/debian/libthrift-perl
|
2017-02-08 18:05:33 +00:00
|
|
|
mkdir -p $(CURDIR)/debian/libthrift-perl/usr/share
|
|
|
|
mv $(CURDIR)/debian/libthrift-perl/usr/local/lib/perl5 $(CURDIR)/debian/libthrift-perl/usr/share
|
2016-03-24 23:51:09 +00:00
|
|
|
rmdir $(CURDIR)/debian/libthrift-perl/usr/local/lib
|
|
|
|
rmdir $(CURDIR)/debian/libthrift-perl/usr/local
|
2010-12-14 21:38:00 +00:00
|
|
|
|
|
|
|
dh_install -i
|
|
|
|
|
|
|
|
install-arch:
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
dh_clean -k -s
|
|
|
|
dh_installdirs -s
|
|
|
|
|
|
|
|
# Add here commands to install the arch part of the package into
|
|
|
|
# debian/tmp.
|
|
|
|
#$(MAKE) DESTDIR=$(CURDIR)/debian/thrift install
|
|
|
|
|
2011-11-06 20:29:26 +00:00
|
|
|
# Compiler
|
2010-12-14 21:38:00 +00:00
|
|
|
mkdir -p $(CURDIR)/debian/thrift-compiler/usr/bin && \
|
|
|
|
cp $(CURDIR)/compiler/cpp/thrift \
|
|
|
|
$(CURDIR)/debian/thrift-compiler/usr/bin/thrift && \
|
|
|
|
rmdir $(CURDIR)/debian/thrift-compiler/usr/sbin
|
|
|
|
|
2011-11-06 20:29:26 +00:00
|
|
|
# Python
|
2010-12-14 21:38:00 +00:00
|
|
|
cd $(CURDIR)/lib/py && \
|
2016-03-25 00:22:16 +00:00
|
|
|
python2 setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift && \
|
|
|
|
python2-dbg setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python-thrift-dbg && \
|
|
|
|
python3 setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python3-thrift && \
|
|
|
|
python3-dbg setup.py install --install-layout=deb --no-compile --root=$(CURDIR)/debian/python3-thrift-dbg
|
2010-12-14 21:38:00 +00:00
|
|
|
|
2016-03-24 23:51:09 +00:00
|
|
|
find $(CURDIR)/debian/python-thrift -name "*.py[co]" -print0 | xargs -0 rm -f
|
|
|
|
find $(CURDIR)/debian/python-thrift -name "__pycache__" -print0 | xargs -0 rm -fr
|
|
|
|
find $(CURDIR)/debian/python-thrift-dbg -name "__pycache__" -print0 | xargs -0 rm -fr
|
|
|
|
find $(CURDIR)/debian/python-thrift-dbg -name "*.py[co]" -print0 | xargs -0 rm -f
|
2010-12-14 21:38:00 +00:00
|
|
|
find $(CURDIR)/debian/python-thrift-dbg -name "*.py" -print0 | xargs -0 rm -f
|
2011-12-09 10:36:05 +00:00
|
|
|
find $(CURDIR)/debian/python-thrift-dbg -name "*.egg-info" -print0 | xargs -0 rm -rf
|
2010-12-14 21:38:00 +00:00
|
|
|
find $(CURDIR)/debian/python-thrift-dbg -depth -type d -empty -exec rmdir {} \;
|
|
|
|
|
2016-03-25 00:22:16 +00:00
|
|
|
find $(CURDIR)/debian/python3-thrift -name "*.py[co]" -print0 | xargs -0 rm -f
|
|
|
|
find $(CURDIR)/debian/python3-thrift -name "__pycache__" -print0 | xargs -0 rm -fr
|
|
|
|
find $(CURDIR)/debian/python3-thrift-dbg -name "__pycache__" -print0 | xargs -0 rm -fr
|
|
|
|
find $(CURDIR)/debian/python3-thrift-dbg -name "*.py[co]" -print0 | xargs -0 rm -f
|
|
|
|
find $(CURDIR)/debian/python3-thrift-dbg -name "*.py" -print0 | xargs -0 rm -f
|
|
|
|
find $(CURDIR)/debian/python3-thrift-dbg -name "*.egg-info" -print0 | xargs -0 rm -rf
|
|
|
|
find $(CURDIR)/debian/python3-thrift-dbg -depth -type d -empty -exec rmdir {} \;
|
|
|
|
|
2010-12-14 21:38:00 +00:00
|
|
|
# PHP
|
|
|
|
mkdir -p $(CURDIR)/debian/php5-thrift
|
|
|
|
cd $(CURDIR)/lib/php && \
|
|
|
|
$(MAKE) DESTDIR=$(CURDIR)/debian/php5-thrift install
|
|
|
|
|
2011-04-12 20:36:12 +00:00
|
|
|
# C++ and C (glib)
|
2010-12-14 21:38:00 +00:00
|
|
|
mkdir -p $(CURDIR)/debian/tmp; \
|
|
|
|
cd $(CURDIR)/lib/cpp && \
|
2016-03-24 23:51:09 +00:00
|
|
|
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
|
2011-04-12 20:36:12 +00:00
|
|
|
cd $(CURDIR)/lib/c_glib && \
|
2016-03-24 23:51:09 +00:00
|
|
|
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
|
2010-12-14 21:38:00 +00:00
|
|
|
|
|
|
|
dh_install --sourcedir=debian/tmp -s
|
|
|
|
|
|
|
|
|
|
|
|
# Must not depend on anything. This is to be called by
|
|
|
|
# binary-arch/binary-indep
|
|
|
|
# in another 'make' thread.
|
|
|
|
binary-common:
|
|
|
|
dh_testdir
|
|
|
|
dh_testroot
|
|
|
|
dh_installchangelogs
|
|
|
|
dh_installdocs
|
|
|
|
dh_installexamples
|
|
|
|
dh_installman
|
|
|
|
dh_link
|
2017-03-10 11:14:18 +00:00
|
|
|
dh_strip -plibthrift0 --dbg-package=libthrift0-dbg
|
2016-04-15 17:09:49 +00:00
|
|
|
dh_strip -ppython-thrift --dbg-package=python-thrift-dbg
|
|
|
|
dh_strip -ppython3-thrift --dbg-package=python3-thrift-dbg
|
2017-03-10 11:14:18 +00:00
|
|
|
dh_strip -pthrift-compiler
|
2010-12-14 21:38:00 +00:00
|
|
|
dh_compress
|
|
|
|
dh_fixperms
|
|
|
|
dh_makeshlibs
|
|
|
|
dh_installdeb
|
|
|
|
dh_perl
|
|
|
|
dh_shlibdeps
|
|
|
|
dh_gencontrol
|
|
|
|
dh_md5sums
|
|
|
|
dh_builddeb
|
2014-11-24 09:55:31 +00:00
|
|
|
# Build architecture independent packages using the common target.
|
2010-12-14 21:38:00 +00:00
|
|
|
binary-indep: build-indep install-indep
|
|
|
|
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
|
|
|
|
|
2014-11-24 09:55:31 +00:00
|
|
|
# Build architecture dependent packages using the common target.
|
2010-12-14 21:38:00 +00:00
|
|
|
binary-arch: build-arch install-arch
|
2016-03-24 23:51:09 +00:00
|
|
|
echo "php:Depends=phpapi-$(shell php-config5 --phpapi)" > $(CURDIR)/debian/substvars
|
2010-12-14 21:38:00 +00:00
|
|
|
$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
|
|
|
|
|
|
|
|
binary: binary-arch binary-indep
|
|
|
|
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure
|