@@ -61,23 +61,23 @@ buildscript {
6161 }
6262}
6363
64- void addProcessFilesTask (String type , boolean oss ) {
65- String packagingFiles = " build/packaging/${ oss ? 'oss-' : ''}${ type} "
64+ void addProcessFilesTask (String type , boolean oss , boolean jdk ) {
65+ String packagingFiles = " build/packaging/${ oss ? 'oss-' : '' }${ jdk ? '' : 'no-jdk- '}${ type} "
6666
67- String taskName = " process${ oss ? 'Oss' : ''}${ type.capitalize()} Files"
67+ String taskName = " process${ oss ? 'Oss' : ''}${ jdk ? '' : 'NoJdk' }${ type.capitalize()} Files"
6868 task(taskName, type : Copy ) {
6969 into packagingFiles
7070
7171 with copySpec {
7272 from ' src/common'
7373 from " src/${ type} "
74- MavenFilteringHack . filter(it, expansionsForDistribution(type, oss))
74+ MavenFilteringHack . filter(it, expansionsForDistribution(type, oss, jdk ))
7575 }
7676
7777 into(' etc/elasticsearch' ) {
78- with configFiles(type, oss)
78+ with configFiles(type, oss, jdk )
7979 }
80- MavenFilteringHack . filter(it, expansionsForDistribution(type, oss))
80+ MavenFilteringHack . filter(it, expansionsForDistribution(type, oss, jdk ))
8181
8282 doLast {
8383 // create empty dirs, we set the permissions when configuring the packages
@@ -91,17 +91,21 @@ void addProcessFilesTask(String type, boolean oss) {
9191 }
9292 }
9393}
94- addProcessFilesTask(' deb' , true )
95- addProcessFilesTask(' deb' , false )
96- addProcessFilesTask(' rpm' , true )
97- addProcessFilesTask(' rpm' , false )
94+ addProcessFilesTask(' deb' , true , true )
95+ addProcessFilesTask(' deb' , true , false )
96+ addProcessFilesTask(' deb' , false , true )
97+ addProcessFilesTask(' deb' , false , false )
98+ addProcessFilesTask(' rpm' , true , true )
99+ addProcessFilesTask(' rpm' , true , false )
100+ addProcessFilesTask(' rpm' , false , true )
101+ addProcessFilesTask(' rpm' , false , false )
98102
99103// Common configuration that is package dependent. This can't go in ospackage
100104// since we have different templated files that need to be consumed, but the structure
101105// is the same
102106Closure commonPackageConfig (String type , boolean oss , boolean jdk ) {
103107 return {
104- dependsOn " process${ oss ? 'Oss' : ''}${ type.capitalize()} Files"
108+ dependsOn " process${ oss ? 'Oss' : ''}${ jdk ? '' : 'NoJdk' }${ type.capitalize()} Files"
105109 packageName " elasticsearch${ oss ? '-oss' : ''} "
106110 arch (type == ' deb' ? ' amd64' : ' X86_64' )
107111 // Follow elasticsearch's file naming convention
@@ -110,7 +114,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) {
110114
111115 String prefix = " ${ oss ? 'oss-' : ''}${ jdk ? '' : 'no-jdk-'}${ type} "
112116 destinationDir = file(" ${ prefix} /build/distributions" )
113- String packagingFiles = " build/packaging/${ oss ? 'oss-' : ''}${ type} "
117+ String packagingFiles = " build/packaging/${ oss ? 'oss-' : ''}${ jdk ? '' : 'no-jdk-' }${ type} "
114118
115119 String scripts = " ${ packagingFiles} /scripts"
116120 preInstall file(" ${ scripts} /preinst" )
@@ -125,7 +129,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) {
125129 // specify it again explicitly for copying common files
126130 into(' /usr/share/elasticsearch' ) {
127131 into(' bin' ) {
128- with binFiles(type, oss)
132+ with binFiles(type, oss, jdk )
129133 }
130134 from(rootProject. projectDir) {
131135 include ' README.textile'
@@ -202,7 +206,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) {
202206 createDirectoryEntry true
203207 fileType CONFIG | NOREPLACE
204208 }
205- String envFile = expansionsForDistribution(type, false )[' path.env' ]
209+ String envFile = expansionsForDistribution(type, oss, jdk )[' path.env' ]
206210 configurationFile envFile
207211 into(new File (envFile). getParent()) {
208212 fileType CONFIG | NOREPLACE
0 commit comments