* relocated current package database to the trunk of the package sub-project

git-svn-id: svn://svn.opensde.net/opensde/package/trunk@20072 10447126-35f2-4685-b0cf-6dd780d3921f
This commit is contained in:
Alejandro Mery
2007-01-27 18:03:57 +00:00
commit 12b79fecfa
8806 changed files with 372084 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/sh
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../java-dirtree/java-common-conf.in
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- T2-COPYRIGHT-NOTE-END ---
pkgprefix -t java-dirtree
prefix=$( pkgprefix java-dirtree )
set_confopt
+214
View File
@@ -0,0 +1,214 @@
#!/bin/sh
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../java-dirtree/java-conf.in
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- T2-COPYRIGHT-NOTE-END ---
# Common java configuration is needed as well.
. $base/package/*/*/java-common-conf.in
# Defaults
auto_detect=on
build_type=
# Prevent executing normal make and install build steps.
# Java packages have custom make and install.
makeopt=''
makeinstopt=''
# Set variables used for building java sources to there default values.
# builddocdir - Location where documentation can be found after building.
# buildjardir - Location where build results (jarfiles) can be found.
# buildtarget - target(Ant)/goal(Maven) to be used for building.
# buildfile - buildfile containing the build rules.
builddocdir=dist/docs
buildjardir=dist
buildtarget=dist
buildfile=
# -------------------------------------------------------------------------
#
# -------------------------------------------------------------------------
maven1_build() {
echo_status "Java buildstyle: Maven (version 1)"
# Maven 2 needs to be installed to be able to use it.
pkgprefix -t maven1
# Invoke maven to start building. However, we strictly
# forbid downloading dependancies from remote repositories.
# All dependancies should be build locally and added to
# the local repository.
$root/$(pkgprefix bindir maven1)/maven \
-Dmaven.repo.remote.enabled=false \
$mavengoals --pom $1
}
# -------------------------------------------------------------------------
#
# -------------------------------------------------------------------------
maven2_build() {
echo_status "Java buildstyle: Maven (version 2)"
# Maven 2 needs to be installed to be able to use it.
pkgprefix -t maven
abort "MAVEN2 building NOT yet implemented."
}
# -------------------------------------------------------------------------
# ant_build: Starts the apache ant build tool.
#
# Besides starting the apache build tool. The results of building are
# gathered and moved to right place. For this two things are considered.
# dist/docs for documentation.
# dist/*.jar for java jar files/libraries.
#
# IMPORTANT VARIABLES:
# builddocdir - Location where documentation will be.
# buildjardir - Location where build result will be.
# buildtarget - Ant target to be used for building.
# -------------------------------------------------------------------------
ant_build() {
echo_status "Java buildstyle: Apache Ant"
# Ant needs to be installed to be able to use it.
pkgprefix -t apache-ant
# Invoke Ant to start building.
$root/$(pkgprefix bindir apache-ant)/ant -buildfile $1 \
-lib $(pkgprefix libdir java-dirtree) \
$antopt $buildtarget
# Copy all created jar files to the package libdir.
echo "Trying to copy package jar files."
if ls $buildjardir/*.jar 2> /dev/null ; then
cp -v $buildjardir/*.jar $root/$libdir
else
# Strange. No jar files available?
echo "Package $pkg produces no jar files in $buildjardir/."
fi
# Copy all documentation to the package docdir.
echo "Trying to copy package documentaion."
tempdir=$builddocdir
if [ -d $tempdir ] ; then
( cd $tempdir; tar -c * | tar -x -C $root/$docdir )
fi
unset tempdir
}
# -------------------------------------------------------------------------
# set_build_type: Sets the java build type.
#
# Sets the java build type to be used for building the current package.
# -------------------------------------------------------------------------
set_build_type() {
local builder_func=
# Build type can only be set once per package, check if it
# has already been set.
if [ -n "$build_type" ] ; then
echo "Buildtype already set ($build_type), can't set it to '$1'"
Abort "java-conf.in: Buildtype can only be set once."
fi
build_type="$1"
case "$build_type" in
ANT) builder_func="ant_build ${buildfile:-build.xml}" ;;
MAVEN) todo ;;
SCRIPT) todo ;;
*) abort "java-conf.in: Unknown buildtype $1 specified." ;;
esac
# Since the built type is set, auto detection is no longer needed.
auto_detect=off
# Set the inmake hook to use the given builder type.
hook_add inmake 5 "$builder_func"
}
# Before we continue lets process all command line options.
while [ "$1" ] ; do
case "$1" in
NO_AUTO_DETECT) auto_detect=off ;
echo_status "Java buildstyle: Autodetect disabled." ;;
BUILD_TYPE=*) set_build_type ${1#*=} ;;
BUILD_FILE=*) buildfile=${1#*=} ;;
*) abort "java-conf.in: Unknown arguments" ;;
esac
shift
done
# Check if at least one of the jdk's is available right now.
if [ -z $JAVA_HOME ]; then
# No jdk available, continueing is pointless.
abort "At least one of the JDK's need to be installed."
fi
# This function determines the maven version to be used on
# the given input file.
# param: pom/project filename
# return: the pom/project file major version number.
detect_maven_version() {
# Todo: look inside the file to determine the version.
echo "3"
}
# We know how to build Ant, Maven and Maven 2 style projects.
# build and build.sh scripts are ignored on purpose. By controlling
# the build in here we might make it easier to build packages using
# exotic compilers like gcj or jikes.
determine_build_type() {
local buildtype=
# Check if the Ant build.xml file is available.
if [ -f build.xml ]; then
# Package can be build using Ant. However this might be
# overruled by any of the others.
buildtype="ANT"
fi
# Check if the Maven pom.xml or project.xml file is available.
for mavenfile in pom.xml project.xml; do
# Check if the maven file exists
if [ -f $mavenfile ]; then
# A maven file is available, but what maven
# version should be used? The projectfile
# version can tell us.
pomversion=`detect_maven_version $mavenfile`
case "$pomversion" in
4*) builder_func="maven2_build $mavenfile" ;;
# In all other cases we use maven 1.
*) builder_func="maven1_build $mavenfile" ;;
esac
fi
done
# Check if we have found an appropriate java builder.
if [ -n "$buildtype" ]; then
# Set the selected build type.
set_build_type $buildtype
else
# Auto detection of the build style resulted into
# nothing. So from here on it is up to the package
# to decide how to continue building the package.
echo_status "Java buildstyle: Unknown buildstyle"
fi
}
# Check if autodetection of the build process is required.
if [ "$auto_detect" == "on" ] ; then
# We use a postpatch hook to determine what kind of build process
# is needed. When we know we set the inmake hook appropriately.
hook_add postpatch 5 determine_build_type
fi
+12
View File
@@ -0,0 +1,12 @@
[TIMESTAMP] 1133855360 Tue Dec 6 08:49:20 2005
[BUILDTIME] 5 (9)
[SIZE] 0.02 MB, 15 files
[DEP] bash
[DEP] coreutils
[DEP] diffutils
[DEP] gcc
[DEP] glibc
[DEP] grep
[DEP] sed
+43
View File
@@ -0,0 +1,43 @@
#!/bin/sh
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../java-dirtree/java-dirtree.conf
# Copyright (C) 2006 The OpenSDE Project
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
prefix=opt/java
set_confopt
libdir=${libdir%64}
srctar=none
makeopt=
makeinstopt=
hook_add postmake 5 'java_profile'
java_profile() {
cat <<-EOT > $root/etc/profile.d/java
for jdk in kaffe sun-jdk-6 sun-jdk-150 sun-jdk-142 ibm-jdk-150 ibm-jdk-142 blackdown-jdk sun-jre-6 sun-jre-150 sun-jre-142 ibm-jre-150 ibm-jre-142 blackdown-jre; do
if [ -f $sysconfdir/\$jdk.in ]; then
. $sysconfdir/\$jdk.in
break
fi
done
unset jdk
CLASSPATH=$libdir:\$CLASSPATH
export CLASSPATH
EOT
}
hook_add postdoc 9 'rmemptydir='
+31
View File
@@ -0,0 +1,31 @@
[COPY] --- SDE-COPYRIGHT-NOTE-BEGIN ---
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch.
[COPY]
[COPY] Filename: package/.../java-dirtree/java-dirtree.desc
[COPY] Copyright (C) 2006 The OpenSDE Project
[COPY] Copyright (C) 2004 - 2006 The T2 SDE Project
[COPY]
[COPY] More information can be found in the files COPYING and README.
[COPY]
[COPY] This program is free software; you can redistribute it and/or modify
[COPY] it under the terms of the GNU General Public License as published by
[COPY] the Free Software Foundation; version 2 of the License. A copy of the
[COPY] GNU General Public License can be found in the file COPYING.
[COPY] --- SDE-COPYRIGHT-NOTE-END ---
[I] Java tree framework
[T] This Package contains the java directory tree.
[A] The T2 Project <t2@exactcode.de>
[M] The OpenSDE Community <list@opensde.org>
[C] base/system
[F] DIETLIBC
[L] GPL
[S] Stable
[V] 0000
[P] X -1-------9 100.000
+46
View File
@@ -0,0 +1,46 @@
#!/bin/sh
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../java-dirtree/java-jdk-conf.in
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- T2-COPYRIGHT-NOTE-END ---
pkgprefix -t java-dirtree
prefix=$( pkgprefix java-dirtree )/$pkg
set_confopt
if [ "$1" = "jre" ]; then
hook_add postmake 5 'jre_populate_profile'
else
hook_add postmake 5 'jdk_populate_profile'
fi
jdk_populate_profile() {
cat <<-EOT > $root/`pkgprefix sysconfdir java-dirtree`/$pkg.in
JAVA_HOME=/$prefix
CLASSPATH=$libdir:/$prefix/jre/lib:\$CLASSPATH
MANPATH=$mandir:\$MANPATH
PATH=$bindir:/$prefix/jre/bin:\$PATH
export JAVA_HOME CLASSPATH MANPATH PATH
EOT
}
jre_populate_profile() {
cat <<-EOT > $root/`pkgprefix sysconfdir java-dirtree`/$pkg.in
JRE_HOME=/$prefix
CLASSPATH=$libdir:\$CLASSPATH
MANPATH=$mandir:\$MANPATH
PATH=$bindir:\$PATH
export JRE_HOME CLASSPATH MANPATH PATH
EOT
}
+58
View File
@@ -0,0 +1,58 @@
#!/bin/sh
# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# T2 SDE: package/.../java-dirtree/parse-config
# Copyright (C) 2004 - 2006 The T2 SDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- T2-COPYRIGHT-NOTE-END ---
if [ -f $root/var/adm/packages/java-dirtree ]; then
# We have to set JAVA_HOME environment variable. For this we
# check every jdk we know and verify if it is installed.
JAVA_EVERYJDK="sun-jdk-142 ibm-jdk-142 blackdown-jdk"
# ooo doesn't build with java 1.5+
[ "$pkg" != "ooo" ] &&
JAVA_EVERYJDK="sun-jdk-150 ibm-jdk-150 $JAVA_EVERYJDK"
# use kaffe only for marked packages
if hasflag KAFFE; then
JAVA_EVERYJDK="kaffe $JAVA_EVERYJDK"
fi
# clean the enviroment
unset JAVA_HOME CLASSPATH
for jdk in $JAVA_EVERYJDK; do
if [ -f $root$( pkgprefix sysconfdir java-dirtree )/$jdk.in ]; then
pkgprefix -t $jdk
# Make java home available to java packages.
JAVA_HOME=$root/$( pkgprefix $jdk )
CLASSPATH="$root$( pkgprefix libdir java-dirtree ):$CLASSPATH"
CLASSPATH="$root/$( pkgprefix $jdk )/jre/lib:$CLASSPATH"
CLASSPATH="$root/$( pkgprefix $jdk )/lib:$CLASSPATH"
PATH="$root/$( pkgprefix $jdk )/jre/bin:$PATH"
PATH="$root/$( pkgprefix $jdk )/bin:$PATH"
echo_status "JAVA_HOME set to $jdk"
export JAVA_HOME CLASSPATH PATH
# Determine the java version.
# Todo: might be important to some packages.
break
fi
done
# and remove the junk i injected
unset jdk JAVA_EVERYJDK
fi