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 104 105 106 107 108 109 110 111
|
#!/usr/bin/make -f
include /usr/share/dpkg/default.mk
include /usr/share/javahelper/java-vars.mk
export JAVA_HOME=/usr/lib/jvm/default-java
%:
dh $@ --buildsystem=maven
override_dh_auto_clean:
dh_auto_clean -- -Pclean
rm -f debian/jruby.lintian-overrides
rm -rf .pc_gems
# cleanup bin executables
cd $(CURDIR)/bin && ( \
rm -f bundle bundler erb irb lock_jars racc rdoc ri ; \
)
# cleanup stdlib
-cd $(CURDIR)/lib/ruby/stdlib && ( \
rm -f $(foreach f,English abbrev ant base64 cmath debug delegate fileutils find getoptlong* ipaddr jar-dependencies jar_dependencies jar_install* kconv mutex_m nkf observer open-uri optionparser ostruct pp prettyprint pstore resolv-replace rinda ring tuplespace ruby2_keywords rubygems securerandom shellwords singleton stringio strscan time timeout tsort un weakref,$(f).rb) ; \
rm -f $(foreach j,nkf stringio strscan,${j}.jar) ; \
rm -rf benchmark* bigdecimal* bundler* cgi* csv* did_you_mean* digest* drb* erb* error_highlight* ffi* forwardable* io/console* io/wait* irb* jars jline jopenssl* json* libfixposix* logger* net/http* net/protocol* open3* openssl* optparse* org psych* racc* rake* random* rdoc* readline* reline* rinda* subspawn* scanf* uri* yaml* ; \
find rubygems -mindepth 1 -maxdepth 1 -not -name defaults -exec rm -rf {} \; \
)
# cleanup main builddirs
rm -rf core/src/main/java/META-INF
rm -rf lib/ruby/gems lib/jruby.jar
rm -f shaded/dependency-reduced-pom.xml test/pom.xml
-$(foreach p,. lib core shaded,test -f ${p}/pom.xml.bak && mv ${p}/pom.xml.bak ${p}/pom.xml;)
# cleanup maven artifacts
rm -f maven/pom.xml maven/jruby/pom.xml maven/jruby-complete/pom.xml
rm -rf maven/jruby-complete/src/it/osgi_many_bundles_with_embedded_gems_*
rm -rf maven/jruby-dist/target
execute_after_dh_auto_configure:
# move stdlib rubygems into maven repository
mv rubygems debian/maven-repo
# backup upstream generated poms
$(foreach p,. lib core shaded,cp ${p}/pom.xml ${p}/pom.xml.bak;)
override_dh_auto_build:
# ensure org.jruby.maven in local maven repo is writeable
# this is needed so that a given version of jruby can build itself
mkdir debian/maven-repo/org/jruby.tmp
cp -L -R debian/maven-repo/org/jruby/* debian/maven-repo/org/jruby.tmp/
rm -rf debian/maven-repo/org/jruby
mv debian/maven-repo/org/jruby.tmp debian/maven-repo/org/jruby
# build selected profiles
dh_auto_build -- -Djruby.revision=$(DEB_VERSION) -Pmain,complete
override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
# java tests
# to debug a single test, add -Dsurefire.useFile=false -Dtest=org/jruby/test/<TestFileName>.java
dh_auto_test -- -Djruby.revision=$(DEB_VERSION) -Ptest -pl org.jruby:jruby-base
endif
override_dh_auto_install:
# don't ship jruby-stdlib maven artifact
dh_auto_install --destdir=debian/jruby/ -O--buildsystem=maven -- -pl "!lib"
execute_after_dh_install:
# clean and install polyglot-generated poms
for p in maven/pom.xml maven/jruby/pom.xml; do \
mh_cleanpom --keep-pom-version -pjruby $$p; \
mh_installpom -pjruby $$p; \
done
# install org.jruby:jruby proxy jar
mh_installjar -pjruby ./maven/jruby/pom.xml \
./maven/jruby/target/jruby-$(DEB_VERSION_UPSTREAM:+ds=).jar
# apply Class-Path attribute to main jar
jh_classpath
execute_after_dh_installexamples:
# remove vcs control file
rm debian/jruby/usr/share/doc/jruby/examples/jnlp/.gitignore
JRUBY_HOME_DIR=lib/target/classes/META-INF/jruby.home
execute_after_dh_prep:
# apply patches to bundled stdlib gems
QUILT_PATCHES=debian/patches/gems QUILT_PC=.pc_gems quilt push -a
# remove superfluous shell scripts
rm -f $(JRUBY_HOME_DIR)/bin/*.bat
rm -f $(JRUBY_HOME_DIR)/bin/*.sh
# remove env from shell scripts
sed -i '1s|^#!/usr/bin/env\sruby|#!/usr/bin/jruby|' $(JRUBY_HOME_DIR)/bin/*
# mark all scripts executable
chmod +x $(JRUBY_HOME_DIR)/bin/*
# remove bundled libfixposix libraries
find $(JRUBY_HOME_DIR)/lib/ruby/stdlib/libfixposix/binary -type f -and -not -name version.rb -delete
find $(JRUBY_HOME_DIR)/lib/ruby/stdlib/libfixposix/binary -type d -and -empty -delete
# remove bundled font files from stdlib (rdoc templates)
# only remove the fonts that debian provides in packages
find $(JRUBY_HOME_DIR)/lib/ruby/stdlib -name Lato-\*.ttf -type f -print -delete
# remove .jrubydir files (only needed in jars)
find $(JRUBY_HOME_DIR)/lib -name .jrubydir -type f -delete
# remove bundled jars available in debian
rm -rf $(JRUBY_HOME_DIR)/lib/ruby/stdlib/jline
rm -rf $(JRUBY_HOME_DIR)/lib/ruby/stdlib/org/bouncycastle
rmdir $(JRUBY_HOME_DIR)/lib/ruby/stdlib/org
# remove unneeded executable bits from gem.home scripts
find $(JRUBY_HOME_DIR)/lib/ruby/gems/shared/gems/* -type f -executable \
| while read script; do \
sed -i '1,1{/^#\!\/usr\/bin\/env ruby/d}' $$script; \
chmod -x $$script; \
done
execute_before_dh_lintian:
sed 's,@DEB_VERSION_UPSTREAM@,$(DEB_VERSION_UPSTREAM:+ds=),g' \
debian/jruby.lintian-overrides.in > debian/jruby.lintian-overrides
|