2015-11-02 20:48:15 -05:00
|
|
|
/*
|
|
|
|
* Licensed to Elasticsearch under one or more contributor
|
|
|
|
* license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright
|
|
|
|
* ownership. Elasticsearch licenses this file to you under
|
|
|
|
* the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
* not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
2015-10-29 14:40:19 -04:00
|
|
|
|
2015-11-02 20:48:15 -05:00
|
|
|
task buildRpm(type: Rpm) {
|
2015-11-05 15:47:54 -05:00
|
|
|
dependsOn dependencyFiles, preparePackagingFiles
|
2015-11-28 14:30:49 -05:00
|
|
|
baseName 'elasticsearch' // this is what pom generation uses for artifactId
|
2015-11-05 15:47:54 -05:00
|
|
|
// Follow elasticsearch's rpm file naming convention
|
2015-11-25 19:21:38 -05:00
|
|
|
archiveName "${packageName}-${project.version}.rpm"
|
2015-11-05 15:47:54 -05:00
|
|
|
packageGroup 'Application/Internet'
|
|
|
|
prefix '/usr'
|
|
|
|
packager 'Elasticsearch'
|
2016-03-24 03:36:08 -04:00
|
|
|
if (version.contains('~')) {
|
|
|
|
def tokenized = version.tokenize('~')
|
|
|
|
version tokenized[0]
|
|
|
|
release tokenized[1]
|
|
|
|
} else {
|
|
|
|
version version
|
|
|
|
release '1'
|
|
|
|
}
|
2016-04-02 04:38:34 -04:00
|
|
|
arch 'NOARCH'
|
|
|
|
os 'LINUX'
|
|
|
|
license '2009'
|
|
|
|
distribution 'Elasticsearch'
|
|
|
|
vendor 'Elasticsearch'
|
2016-04-18 17:31:28 -04:00
|
|
|
dirMode 0755
|
|
|
|
fileMode 0644
|
2016-05-05 17:21:14 -04:00
|
|
|
addParentDirs false
|
2015-11-05 15:47:54 -05:00
|
|
|
// TODO ospackage doesn't support icon but we used to have one
|
2015-11-02 20:48:15 -05:00
|
|
|
}
|
2015-11-03 01:19:29 -05:00
|
|
|
|
2015-11-02 20:48:15 -05:00
|
|
|
artifacts {
|
2015-11-25 19:21:38 -05:00
|
|
|
'default' buildRpm
|
2016-03-18 20:22:25 -04:00
|
|
|
archives buildRpm
|
2015-11-02 20:48:15 -05:00
|
|
|
}
|
2015-11-03 01:19:29 -05:00
|
|
|
|
2015-11-25 19:21:38 -05:00
|
|
|
integTest {
|
|
|
|
/* We use real rpm tools to extract the rpm file for testing so we have to
|
|
|
|
skip the test if they aren't around. */
|
|
|
|
enabled = new File('/bin/rpm').exists() || // Standard location
|
|
|
|
new File('/usr/bin/rpm').exists() || // Debian location
|
|
|
|
new File('/usr/local/bin/rpm').exists() // Homebrew location
|
|
|
|
}
|