Repository: ambari Updated Branches: refs/heads/trunk 1aa76629b -> 1eab85a4b
AMBARI-5588. Ambari should not hardcode python 2.6, but support 2.6 and higher (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1eab85a4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1eab85a4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1eab85a4 Branch: refs/heads/trunk Commit: 1eab85a4b3523dce0b7721563b6e2b8abf2953b9 Parents: 1aa7662 Author: Andrew Onishuk <[email protected]> Authored: Thu Jun 5 19:28:05 2014 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Thu Jun 5 19:28:05 2014 +0300 ---------------------------------------------------------------------- ambari-client/groovy-client/pom.xml | 18 +++++++++- ambari-client/pom.xml | 16 +++++++++ ambari-client/python-client/pom.xml | 22 +++++++++--- .../src/main/package/deb/control/control | 22 ++++++++++++ .../src/main/package/deb/control/postinst | 15 ++++++++ .../src/main/package/deb/control/postrm | 15 ++++++++ .../src/main/package/deb/control/posttrm | 15 ++++++++ .../src/main/package/deb/control/preinst | 15 ++++++++ .../src/main/package/deb/control/prerm | 15 ++++++++ ambari-common/src/main/unix/ambari-python-wrap | 2 +- ambari-shell/pom.xml | 20 ++++++++++- ambari-web/pom.xml | 2 +- contrib/views/files/pom.xml | 6 ++-- contrib/views/pig/pom.xml | 2 +- contrib/views/slider/pom.xml | 26 +++++++------- contrib/views/src/main/unix/ambari-python-wrap | 38 ++++++++++++++++++++ 16 files changed, 223 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-client/groovy-client/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-client/groovy-client/pom.xml b/ambari-client/groovy-client/pom.xml index ed34848..7e4860c 100644 --- a/ambari-client/groovy-client/pom.xml +++ b/ambari-client/groovy-client/pom.xml @@ -108,6 +108,22 @@ <skipAssembly>true</skipAssembly> </configuration> </plugin> + <plugin> + <groupId>org.vafer</groupId> + <artifactId>jdeb</artifactId> + <version>1.0.1</version> + <executions> + <execution> + <phase>none</phase> + <goals> + <goal>jdeb</goal> + </goals> + </execution> + </executions> + <configuration> + <controlDir>${basedir}/../../ambari-project/src/main/package/deb/control</controlDir> + </configuration> + </plugin> </plugins> </build> -</project> \ No newline at end of file +</project> http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-client/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-client/pom.xml b/ambari-client/pom.xml index e4cb8fb..e489d92 100755 --- a/ambari-client/pom.xml +++ b/ambari-client/pom.xml @@ -54,6 +54,22 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.vafer</groupId> + <artifactId>jdeb</artifactId> + <version>1.0.1</version> + <executions> + <execution> + <phase>none</phase> + <goals> + <goal>jdeb</goal> + </goals> + </execution> + </executions> + <configuration> + <controlDir>${basedir}/../ambari-project/src/main/package/deb/control</controlDir> + </configuration> + </plugin> </plugins> </build> </project> http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-client/python-client/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-client/python-client/pom.xml b/ambari-client/python-client/pom.xml index d700839..8438b80 100644 --- a/ambari-client/python-client/pom.xml +++ b/ambari-client/python-client/pom.xml @@ -40,6 +40,9 @@ <install.dir>/usr/lib/python2.6/site-packages/ambari_client</install.dir> <lib.dir>/usr/lib/ambari-client/lib</lib.dir> <python.ver>python >= 2.6</python.ver> + <deb.python.ver>python (>= 2.6)</deb.python.ver> + <deb.architecture>amd64</deb.architecture> + <deb.dependency.list>openssl, zlibc, ${deb.python.ver}</deb.dependency.list> </properties> <build> <plugins> @@ -72,7 +75,7 @@ <executions> <execution> <configuration> - <executable>python2.6</executable> + <executable>${project.basedir}/../../ambari-common/src/main/unix/ambari-python-wrap</executable> <workingDirectory>src/test/python</workingDirectory> <arguments> <argument>unitTests.py</argument> @@ -90,7 +93,7 @@ </execution> <execution> <configuration> - <executable>python2.6</executable> + <executable>${project.basedir}/../../ambari-common/src/main/unix/ambari-python-wrap</executable> <workingDirectory>target/python-client-${project.version}</workingDirectory> <arguments> <argument>${project.basedir}/src/main/python/setup.py</argument> @@ -141,7 +144,6 @@ </source> </sources> </mapping> - <!-- --> </mappings> </configuration> </plugin> @@ -180,8 +182,18 @@ </execution> </executions> <configuration> - <skip>true</skip> - <submodules>false</submodules> + <controlDir>${basedir}/src/main/package/deb/control</controlDir> + <deb>${basedir}/target/${artifactId}_${package-version}-${package-release}.deb</deb> + <dataSet> + <data> + <src>${project.build.directory}/${project.artifactId}-${project.version}/ambari_client</src> + <type>directory</type> + <mapper> + <type>perm</type> + <prefix>${install.dir}</prefix> + </mapper> + </data> + </dataSet> </configuration> </plugin> </plugins> http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-client/python-client/src/main/package/deb/control/control ---------------------------------------------------------------------- diff --git a/ambari-client/python-client/src/main/package/deb/control/control b/ambari-client/python-client/src/main/package/deb/control/control new file mode 100644 index 0000000..40cd855 --- /dev/null +++ b/ambari-client/python-client/src/main/package/deb/control/control @@ -0,0 +1,22 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF 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 +Package: [[artifactId]] +Version: [[package-version]]-[[package-release]] +Section: [[deb.section]] +Priority: [[deb.priority]] +Depends: [[deb.dependency.list]] +Architecture: [[deb.architecture]] +Description: [[description]] +Maintainer: [[deb.publisher]] http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-client/python-client/src/main/package/deb/control/postinst ---------------------------------------------------------------------- diff --git a/ambari-client/python-client/src/main/package/deb/control/postinst b/ambari-client/python-client/src/main/package/deb/control/postinst new file mode 100644 index 0000000..21a01fa --- /dev/null +++ b/ambari-client/python-client/src/main/package/deb/control/postinst @@ -0,0 +1,15 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF 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 http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-client/python-client/src/main/package/deb/control/postrm ---------------------------------------------------------------------- diff --git a/ambari-client/python-client/src/main/package/deb/control/postrm b/ambari-client/python-client/src/main/package/deb/control/postrm new file mode 100644 index 0000000..21a01fa --- /dev/null +++ b/ambari-client/python-client/src/main/package/deb/control/postrm @@ -0,0 +1,15 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF 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 http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-client/python-client/src/main/package/deb/control/posttrm ---------------------------------------------------------------------- diff --git a/ambari-client/python-client/src/main/package/deb/control/posttrm b/ambari-client/python-client/src/main/package/deb/control/posttrm new file mode 100644 index 0000000..21a01fa --- /dev/null +++ b/ambari-client/python-client/src/main/package/deb/control/posttrm @@ -0,0 +1,15 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF 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 http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-client/python-client/src/main/package/deb/control/preinst ---------------------------------------------------------------------- diff --git a/ambari-client/python-client/src/main/package/deb/control/preinst b/ambari-client/python-client/src/main/package/deb/control/preinst new file mode 100644 index 0000000..21a01fa --- /dev/null +++ b/ambari-client/python-client/src/main/package/deb/control/preinst @@ -0,0 +1,15 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF 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 http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-client/python-client/src/main/package/deb/control/prerm ---------------------------------------------------------------------- diff --git a/ambari-client/python-client/src/main/package/deb/control/prerm b/ambari-client/python-client/src/main/package/deb/control/prerm new file mode 100644 index 0000000..21a01fa --- /dev/null +++ b/ambari-client/python-client/src/main/package/deb/control/prerm @@ -0,0 +1,15 @@ +#!/bin/bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF 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 http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-common/src/main/unix/ambari-python-wrap ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/unix/ambari-python-wrap b/ambari-common/src/main/unix/ambari-python-wrap index 6494d79..40dc785 100755 --- a/ambari-common/src/main/unix/ambari-python-wrap +++ b/ambari-common/src/main/unix/ambari-python-wrap @@ -37,4 +37,4 @@ if [[ -z "$PYTHON" ]]; then fi # execute script -$PYTHON $@ +$PYTHON "$@" http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-shell/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-shell/pom.xml b/ambari-shell/pom.xml index 80e7cad..6f78db5 100644 --- a/ambari-shell/pom.xml +++ b/ambari-shell/pom.xml @@ -115,6 +115,24 @@ <mainClass>${start-class}</mainClass> </configuration> </plugin> + <plugin> + <groupId>org.vafer</groupId> + <artifactId>jdeb</artifactId> + <version>1.0.1</version> + <executions> + <execution> + <phase>none</phase> + <goals> + <goal>jdeb</goal> + </goals> + </execution> + </executions> + <configuration> + <controlDir>${basedir}/../../ambari-project/src/main/package/deb/control</controlDir> + <skip>true</skip> + <submodules>false</submodules> + </configuration> + </plugin> </plugins> </build> -</project> \ No newline at end of file +</project> http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/ambari-web/pom.xml ---------------------------------------------------------------------- diff --git a/ambari-web/pom.xml b/ambari-web/pom.xml index 5396d5e..527f92e 100644 --- a/ambari-web/pom.xml +++ b/ambari-web/pom.xml @@ -117,7 +117,7 @@ <configuration> <target name="ambari-web-compile"> <exec dir="${basedir}" executable="npm" failonerror="false"> - <env key="PYTHON" value="python2.6" /> + <env key="PYTHON" value="${project.basedir}/../ambari-common/src/main/unix/ambari-python-wrap" /> <arg value="install"/> </exec> <exec dir="${basedir}" executable="brunch" failonerror="false"> http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/contrib/views/files/pom.xml ---------------------------------------------------------------------- diff --git a/contrib/views/files/pom.xml b/contrib/views/files/pom.xml index 7a243a6..8194fc7 100644 --- a/contrib/views/files/pom.xml +++ b/contrib/views/files/pom.xml @@ -21,13 +21,13 @@ <artifactId>files</artifactId> <version>0.1.0-SNAPSHOT</version> <name>Files</name> - + <parent> <groupId>org.apache.ambari.views</groupId> <artifactId>ambari-contrib-views</artifactId> <version>0.1.0-SNAPSHOT</version> </parent> - + <dependencies> <dependency> <groupId>org.apache.hadoop</groupId> @@ -155,7 +155,7 @@ <!-- optional: The default argument is actually "install", so unless you need to run some other npm command, you can remove this whole <configuration> section. --> - <arguments>install --python=python2.6 --unsafe-perm --registry=http://registry.npmjs.eu</arguments> + <arguments>install --python="${project.basedir}/../src/main/unix/ambari-python-wrap" --unsafe-perm --registry=http://registry.npmjs.eu</arguments> </configuration> </execution> </executions> http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/contrib/views/pig/pom.xml ---------------------------------------------------------------------- diff --git a/contrib/views/pig/pom.xml b/contrib/views/pig/pom.xml index f8ffc04..f1ec302 100644 --- a/contrib/views/pig/pom.xml +++ b/contrib/views/pig/pom.xml @@ -147,7 +147,7 @@ <goal>npm</goal> </goals> <configuration> - <arguments>install --python=python2.6 --unsafe-perm</arguments> + <arguments>install --python="${project.basedir}/../src/main/unix/ambari-python-wrap" --unsafe-perm</arguments> </configuration> </execution> </executions> http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/contrib/views/slider/pom.xml ---------------------------------------------------------------------- diff --git a/contrib/views/slider/pom.xml b/contrib/views/slider/pom.xml index a4e2539..f2279d1 100644 --- a/contrib/views/slider/pom.xml +++ b/contrib/views/slider/pom.xml @@ -1,12 +1,12 @@ -<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor - license agreements. See the NOTICE file distributed with this work for additional - information regarding copyright ownership. The ASF 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 +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor + license agreements. See the NOTICE file distributed with this work for additional + information regarding copyright ownership. The ASF 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. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> @@ -415,7 +415,7 @@ <configuration> <target name="slider-ui-compile"> <exec dir="${ui.directory}" executable="npm" failonerror="false"> - <env key="PYTHON" value="python2.6" /> + <env key="PYTHON" value="${project.basedir}/../src/main/unix/ambari-python-wrap" /> <arg value="install" /> </exec> <exec dir="${ui.directory}" executable="brunch" @@ -438,7 +438,7 @@ </goals> <configuration> <target name="slider-ui-test"> - <!-- <exec dir="${ui.directory}" executable="brunch" failonerror="false"> + <!-- <exec dir="${ui.directory}" executable="brunch" failonerror="false"> <arg value="test"/> </exec> --> </target> </configuration> @@ -451,7 +451,7 @@ </goals> <configuration> <target name="slider-ui-package"> - <!-- <copy toDir="${project.build.directory}/ambari-server-${project.version}-dist/ambari-server-${project.version}/web/"> + <!-- <copy toDir="${project.build.directory}/ambari-server-${project.version}-dist/ambari-server-${project.version}/web/"> <fileset dir="${ui.directory}/../ambari-web/public"/> </copy> --> </target> </configuration> @@ -510,7 +510,7 @@ </resources> <pluginManagement> <plugins> - <!--This plugin's configuration is used to store Eclipse m2e settings + <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. --> <plugin> <groupId>org.eclipse.m2e</groupId> http://git-wip-us.apache.org/repos/asf/ambari/blob/1eab85a4/contrib/views/src/main/unix/ambari-python-wrap ---------------------------------------------------------------------- diff --git a/contrib/views/src/main/unix/ambari-python-wrap b/contrib/views/src/main/unix/ambari-python-wrap new file mode 100755 index 0000000..4aade93 --- /dev/null +++ b/contrib/views/src/main/unix/ambari-python-wrap @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Copyright 2011 The Apache Software Foundation +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF 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. + +# reset settings +unset PYTHON + +# checking for preferable python versions +if [ -a /usr/bin/python2.7 ] && [ -z "$PYTHON" ]; then + PYTHON=/usr/bin/python2.7 +fi + +if [ -a /usr/bin/python2.6 ] && [ -z "$PYTHON" ]; then + PYTHON=/usr/bin/python2.6 +fi + +# if no preferable python versions found, try to use system one +if [[ -z "$PYTHON" ]]; then + PYTHON=/usr/bin/python +fi + +# execute script +$PYTHON "$@"
