thrift/debian/rules

227 lines
6.9 KiB
Plaintext
Raw Normal View History

#!/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)
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)
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
if [ -f bootstrap.sh ]; then $(CURDIR)/bootstrap.sh; fi
$(CURDIR)/configure --prefix=/usr --enable-plugin=no
touch configure-stamp
#Architecture
build: build-arch build-indep
# Tests disabled
# $(MAKE) -C test check
build-arch: build-arch-stamp
$(CURDIR)/compiler/cpp/thrift build-arch-stamp: configure-stamp
# Compile compiler
$(MAKE) -C $(CURDIR)/compiler/cpp
# Compile C++ library
$(MAKE) -C $(CURDIR)/lib/cpp
# Compile C (glib) library
$(MAKE) -C $(CURDIR)/lib/c_glib
# 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 && \
./configure && $(MAKE)
touch $@
build-indep: build-indep-stamp
build-indep-stamp: configure-stamp $(CURDIR)/compiler/cpp/thrift
# Add here commands to compile the indep part of the package.
#$(MAKE) doc
# Java
cd $(CURDIR)/lib/java && \
THRIFT-(1418|1507|3983|4120|4178|4259|4294): Multiple issues Client: java THRIFT-4294: Java Configure Fails for Ant >= 1.10 THRIFT-4259: Thrift does not compile due to Ant Maven task errors THRIFT-4178: Java libraries missing from package when using cmake THRIFT-3983: libthrift is deployed on central with pom packaging instead of jar THRIFT-1507: Maven can't download resource from central when behind a proxy and won't use local repository THRIFT-1418: Compiling Thrift from source: Class org.apache.tools.ant.taskdefs.ConditionTask doesn't support the nested "typefound" element Refactor CMake install hook to allow using "sudo make install/fast" which avoids the THRIFT-1507 and THRIFT-1418 issues. New Gradle based build system for Thrift Java Library * Add Gradle 4.4.1 Wrapper artifacts to enable builds Using the Gradle Wrapper helps normalize the builds on all platforms so we use a consistent build tool independent of package managers. The Gradle build logic was partitioned into multiple specific scripts to simplify understanding and maintenance of the build. This is now hooked into CMake and Autoconf processing steps and can build/test/publish to Maven. The README.md was updated to illustrate the new build options and add some documentation on the requirements for Maven publication. Cleaned up the CMake files to reduce reliance on file globbing which is known to cause confusion when multiple users contribute. * Fix two minor issues in Javadoc and unit test Return values were undeclared in Javadoc Test was asserting on the wrong test object instance * Create simple runner scripts for cross-check Using Gradle as a java execution wrapper is too heavy. I simplified the test client/server execution by using a three generated scripts in the build directory direcly callable by the cross-check test harness. * Cleanup the remaining Ant build scripts Pulled the Maven Ant task properties out of the Java build since they are no longer used there. Deleted the no longer used build.xml and build.properties files from the Java build. Made each Ant build own the Maven Ant task details in their build.properties file. * Fix the build issue with Java SSL in the ubuntu-trusty container The latest Trusty JDK7 builds seem to have encountered this issue because the OpenJDK removed the SunEC algorithms. * Update the developer info as requested in review Use the generic Apache Thrift developer list for contact information * Add Clover Code coverage for easy access by developers Clover plugin for Gradle was applied and configured which enables code coverage reports to be available on demand via a command line option. The documentation in the README.md was enhanced to give the details of this change and how to take advantage of it.
2018-01-24 15:30:13 +00:00
./gradlew --no-daemon -Prelease=true jar
# C#
$(MAKE) -C $(CURDIR)/lib/netstd
# Ruby
$(MAKE) -C $(CURDIR)/lib/rb
# Perl
$(MAKE) -C $(CURDIR)/lib/perl INSTALLDIRS=vendor
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp configure-stamp
cd $(CURDIR)/lib/py && python setup.py clean --all
# 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
dh_prep -i
dh_installdirs -i
# Add here commands to install the indep part of the package into
# debian/<package>-doc.
#INSTALLDOC#
# Java
mkdir -p $(CURDIR)/debian/libthrift-java/usr/share/java/ && \
THRIFT-(1418|1507|3983|4120|4178|4259|4294): Multiple issues Client: java THRIFT-4294: Java Configure Fails for Ant >= 1.10 THRIFT-4259: Thrift does not compile due to Ant Maven task errors THRIFT-4178: Java libraries missing from package when using cmake THRIFT-3983: libthrift is deployed on central with pom packaging instead of jar THRIFT-1507: Maven can't download resource from central when behind a proxy and won't use local repository THRIFT-1418: Compiling Thrift from source: Class org.apache.tools.ant.taskdefs.ConditionTask doesn't support the nested "typefound" element Refactor CMake install hook to allow using "sudo make install/fast" which avoids the THRIFT-1507 and THRIFT-1418 issues. New Gradle based build system for Thrift Java Library * Add Gradle 4.4.1 Wrapper artifacts to enable builds Using the Gradle Wrapper helps normalize the builds on all platforms so we use a consistent build tool independent of package managers. The Gradle build logic was partitioned into multiple specific scripts to simplify understanding and maintenance of the build. This is now hooked into CMake and Autoconf processing steps and can build/test/publish to Maven. The README.md was updated to illustrate the new build options and add some documentation on the requirements for Maven publication. Cleaned up the CMake files to reduce reliance on file globbing which is known to cause confusion when multiple users contribute. * Fix two minor issues in Javadoc and unit test Return values were undeclared in Javadoc Test was asserting on the wrong test object instance * Create simple runner scripts for cross-check Using Gradle as a java execution wrapper is too heavy. I simplified the test client/server execution by using a three generated scripts in the build directory direcly callable by the cross-check test harness. * Cleanup the remaining Ant build scripts Pulled the Maven Ant task properties out of the Java build since they are no longer used there. Deleted the no longer used build.xml and build.properties files from the Java build. Made each Ant build own the Maven Ant task details in their build.properties file. * Fix the build issue with Java SSL in the ubuntu-trusty container The latest Trusty JDK7 builds seem to have encountered this issue because the OpenJDK removed the SunEC algorithms. * Update the developer info as requested in review Use the generic Apache Thrift developer list for contact information * Add Clover Code coverage for easy access by developers Clover plugin for Gradle was applied and configured which enables code coverage reports to be available on demand via a command line option. The documentation in the README.md was enhanced to give the details of this change and how to take advantage of it.
2018-01-24 15:30:13 +00:00
cp $(CURDIR)/lib/java/build/libs/libthrift*.jar \
$(CURDIR)/debian/libthrift-java/usr/share/java/
# Ruby
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
# C#
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
# Perl
$(MAKE) -C $(CURDIR)/lib/perl install DESTDIR=$(CURDIR)/debian/libthrift-perl
mkdir -p $(CURDIR)/debian/libthrift-perl/usr/share
mv $(CURDIR)/debian/libthrift-perl/usr/local/lib/perl5 $(CURDIR)/debian/libthrift-perl/usr/share
rmdir $(CURDIR)/debian/libthrift-perl/usr/local/lib
rmdir $(CURDIR)/debian/libthrift-perl/usr/local
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
# Compiler
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
# Python
cd $(CURDIR)/lib/py && \
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
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
find $(CURDIR)/debian/python-thrift-dbg -name "*.py" -print0 | xargs -0 rm -f
find $(CURDIR)/debian/python-thrift-dbg -name "*.egg-info" -print0 | xargs -0 rm -rf
find $(CURDIR)/debian/python-thrift-dbg -depth -type d -empty -exec rmdir {} \;
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 {} \;
# PHP
mkdir -p $(CURDIR)/debian/php5-thrift
cd $(CURDIR)/lib/php && \
$(MAKE) DESTDIR=$(CURDIR)/debian/php5-thrift install
# C++ and C (glib)
mkdir -p $(CURDIR)/debian/tmp; \
cd $(CURDIR)/lib/cpp && \
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
cd $(CURDIR)/lib/c_glib && \
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
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
dh_strip -plibthrift0 --dbg-package=libthrift0-dbg
dh_strip -ppython-thrift --dbg-package=python-thrift-dbg
dh_strip -ppython3-thrift --dbg-package=python3-thrift-dbg
dh_strip -pthrift-compiler
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independent packages using the common target.
binary-indep: build-indep install-indep
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependent packages using the common target.
binary-arch: build-arch install-arch
echo "php:Depends=phpapi-$(shell php-config5 --phpapi)" > $(CURDIR)/debian/substvars
$(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