浏览代码

commit 92effbf44e7212d81f30501d73d675ae098cbc8f
Author: Jitendra Nath Pandey <jitendra@sufferhome-lm.(none)>
Date: Tue May 18 18:21:06 2010 -0700

HDFS-1150 building jsvc from source tar.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077475 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 年之前
父节点
当前提交
eb80cdfbcf
共有 4 个文件被更改,包括 64 次插入55 次删除
  1. 7 11
      build.xml
  2. 0 44
      src/c++/jsvc/build.sh
  3. 57 0
      src/c++/jsvc/build.xml
  4. 二进制
      src/c++/jsvc/commons-daemon-1.0.2-src.tar.gz

+ 7 - 11
build.xml

@@ -179,9 +179,6 @@
   <!-- jsvc properties set here -->
   <property name="c++.jsvc.src" 
     value="${basedir}/src/c++/jsvc" />
-  <property name="build.c++.jsvc"
-    value="${build.c++}/jsvc" />
-  <property name="jsvc.install.dir" value="${dist.dir}/bin" />
 	
   <!-- IVY properteis set here -->
   <property name="ivy.dir" location="ivy" />
@@ -2260,14 +2257,13 @@
   <!-- end of task-controller targets -->
 
   <!-- jsvc targets -->
-  <target name="jsvc">
-    <mkdir dir="${build.c++.jsvc}" />
-    <exec executable="sh" dir="${build.c++.jsvc}"
-        failonerror="yes">
-        <arg value="${c++.jsvc.src}/build.sh" />
-    </exec>
-    <copy file="${build.c++.jsvc}/jsvc" todir="${jsvc.install.dir}" 
-        verbose="true" />
+  <target name="jsvc" if="compile.c++">
+    <subant target="jsvc">
+      <property name="c++.jsvc.src" value="${c++.jsvc.src}" />
+      <property name="build.c++.jsvc" value="${build.c++}/jsvc" />
+      <property name="jsvc.install.dir" value="${dist.dir}/bin" /> 
+      <fileset file="${c++.jsvc.src}/build.xml"/>
+    </subant>
   </target>
 
 </project>

+ 0 - 44
src/c++/jsvc/build.sh

@@ -1,44 +0,0 @@
-#!/bin/sh
-
-# 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.
-
-###Define variables###
-
-#This variable defines the name of the jsvc tar file.
-#It should be modified if a different version of jsvc is needed.
-JSVC_SRC_DIR=commons-daemon-1.0.2-src
-JSVC_SRC_TAR_FILE=${JSVC_SRC_DIR}.tar.gz
-
-#This variable defines the link where the jsvc source tar is located.
-JSVC_SRC_TAR_LOCATION=http://www.apache.org/dist/commons/daemon/source/${JSVC_SRC_TAR_FILE}
-
-JSVC_SRC_CODE_DIR=src/native/unix
-JSVC_EXECUTABLE=jsvc
-
-###Download and untar###
-
-wget --no-check-certificate $JSVC_SRC_TAR_LOCATION
-tar zxf $JSVC_SRC_TAR_FILE
-
-###Now build###
-
-cd $JSVC_SRC_DIR/$JSVC_SRC_CODE_DIR
-sh support/buildconf.sh
-./configure 
-make clean
-make
-cd -
-cp $JSVC_SRC_DIR/$JSVC_SRC_CODE_DIR/$JSVC_EXECUTABLE .

+ 57 - 0
src/c++/jsvc/build.xml

@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+
+<!--
+   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 name="hadoopjsvc" default="compile">
+
+  <property name="jsvc.version" value="1.0.2" />
+  <property name="jsvc.tar.ball" value="commons-daemon-${jsvc.version}-src.tar.gz" />
+  <property name="jsvc.src.code.dir" value="commons-daemon-${jsvc.version}-src/src/native/unix" />
+
+  <target name="jsvc">
+    <mkdir dir="${build.c++.jsvc}" />
+
+    <untar src="${c++.jsvc.src}/${jsvc.tar.ball}" compression="gzip" dest="${build.c++.jsvc}" />
+
+    <exec executable="sh" dir="${build.c++.jsvc}/${jsvc.src.code.dir}"
+        failonerror="yes">
+        <arg value="support/buildconf.sh" />
+    </exec>
+
+    <exec executable="sh" dir="${build.c++.jsvc}/${jsvc.src.code.dir}"
+        failonerror="yes">
+        <arg value="configure" />
+    </exec>
+
+    <exec executable="make" dir="${build.c++.jsvc}/${jsvc.src.code.dir}"
+        failonerror="yes">
+        <arg value="clean" />
+    </exec>
+
+    <exec executable="make" dir="${build.c++.jsvc}/${jsvc.src.code.dir}"
+        failonerror="yes">
+    </exec>
+
+    <copy file="${build.c++.jsvc}/${jsvc.src.code.dir}/jsvc" todir="${jsvc.install.dir}"
+        verbose="true" />
+    <chmod perm="ugo+x" type="file">
+      <fileset file="${jsvc.install.dir}/jsvc"/>
+    </chmod>
+  </target>
+
+</project>

二进制
src/c++/jsvc/commons-daemon-1.0.2-src.tar.gz