aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Sennhauser <sera@gentoo.org>2013-02-12 16:06:27 +0000
committerRalph Sennhauser <sera@gentoo.org>2013-02-12 16:06:27 +0000
commit8cd7f691028da63728831fa537a7048de6eee2a9 (patch)
tree9a954761c8661e34391012edc00d4d67cb0d3cbe
parentHave a single obvious location for specifing the package version (diff)
downloadjava-config-8cd7f691028da63728831fa537a7048de6eee2a9.tar.gz
java-config-8cd7f691028da63728831fa537a7048de6eee2a9.tar.bz2
java-config-8cd7f691028da63728831fa537a7048de6eee2a9.zip
Generate jdk-defaults.conf at install, if nothing else thist least this is a lot more maintainable than two dozen files.
svn path=/projects/java-config-2/trunk/; revision=9198
-rw-r--r--config/jdk-defaults-alpha.conf2
-rw-r--r--config/jdk-defaults-amd64-fbsd.conf2
-rw-r--r--config/jdk-defaults-amd64.conf2
-rw-r--r--config/jdk-defaults-arm.conf2
-rw-r--r--config/jdk-defaults-hppa.conf2
-rw-r--r--config/jdk-defaults-hpux.conf2
-rw-r--r--config/jdk-defaults-ia64.conf2
-rw-r--r--config/jdk-defaults-mips.conf2
-rw-r--r--config/jdk-defaults-ppc-aix.conf2
-rw-r--r--config/jdk-defaults-ppc-linux.conf2
-rw-r--r--config/jdk-defaults-ppc-macos.conf2
-rw-r--r--config/jdk-defaults-ppc.conf2
-rw-r--r--config/jdk-defaults-ppc64.conf2
-rw-r--r--config/jdk-defaults-sparc-solaris.conf2
-rw-r--r--config/jdk-defaults-sparc.conf2
-rw-r--r--config/jdk-defaults-sparc64-solaris.conf2
-rw-r--r--config/jdk-defaults-x64-freebsd.conf2
-rw-r--r--config/jdk-defaults-x64-macos.conf2
-rw-r--r--config/jdk-defaults-x64-solaris.conf2
-rw-r--r--config/jdk-defaults-x86-fbsd.conf2
-rw-r--r--config/jdk-defaults-x86-freebsd.conf2
-rw-r--r--config/jdk-defaults-x86-macos.conf2
-rw-r--r--config/jdk-defaults-x86-solaris.conf2
-rw-r--r--config/jdk-defaults-x86.conf2
-rw-r--r--setup.py48
25 files changed, 47 insertions, 49 deletions
diff --git a/config/jdk-defaults-alpha.conf b/config/jdk-defaults-alpha.conf
deleted file mode 100644
index fe21913..0000000
--- a/config/jdk-defaults-alpha.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= compaq-jdk
diff --git a/config/jdk-defaults-amd64-fbsd.conf b/config/jdk-defaults-amd64-fbsd.conf
deleted file mode 100644
index 2af5546..0000000
--- a/config/jdk-defaults-amd64-fbsd.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= diablo-jdk
diff --git a/config/jdk-defaults-amd64.conf b/config/jdk-defaults-amd64.conf
deleted file mode 100644
index ba50185..0000000
--- a/config/jdk-defaults-amd64.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= icedtea6 icedtea6-bin sun-jdk blackdown-jdk ibm-jdk-bin jrockit-jdk-bin
diff --git a/config/jdk-defaults-arm.conf b/config/jdk-defaults-arm.conf
deleted file mode 100644
index b7be0b4..0000000
--- a/config/jdk-defaults-arm.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= icedtea-7 icedtea-6 icedtea-bin-7 icedtea-bin-6
diff --git a/config/jdk-defaults-hppa.conf b/config/jdk-defaults-hppa.conf
deleted file mode 100644
index 4480996..0000000
--- a/config/jdk-defaults-hppa.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= kaffe
diff --git a/config/jdk-defaults-hpux.conf b/config/jdk-defaults-hpux.conf
deleted file mode 100644
index d54419b..0000000
--- a/config/jdk-defaults-hpux.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= hp-jdk-bin
diff --git a/config/jdk-defaults-ia64.conf b/config/jdk-defaults-ia64.conf
deleted file mode 100644
index 89c48a7..0000000
--- a/config/jdk-defaults-ia64.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= jrockit-jdk-bin
diff --git a/config/jdk-defaults-mips.conf b/config/jdk-defaults-mips.conf
deleted file mode 100644
index c649d0e..0000000
--- a/config/jdk-defaults-mips.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= blackdown-jdk
diff --git a/config/jdk-defaults-ppc-aix.conf b/config/jdk-defaults-ppc-aix.conf
deleted file mode 100644
index 31a46e3..0000000
--- a/config/jdk-defaults-ppc-aix.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= ibm-jdk-bin
diff --git a/config/jdk-defaults-ppc-linux.conf b/config/jdk-defaults-ppc-linux.conf
deleted file mode 100644
index 31a46e3..0000000
--- a/config/jdk-defaults-ppc-linux.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= ibm-jdk-bin
diff --git a/config/jdk-defaults-ppc-macos.conf b/config/jdk-defaults-ppc-macos.conf
deleted file mode 100644
index c1f8d96..0000000
--- a/config/jdk-defaults-ppc-macos.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= apple-jdk-bin
diff --git a/config/jdk-defaults-ppc.conf b/config/jdk-defaults-ppc.conf
deleted file mode 100644
index 31a46e3..0000000
--- a/config/jdk-defaults-ppc.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= ibm-jdk-bin
diff --git a/config/jdk-defaults-ppc64.conf b/config/jdk-defaults-ppc64.conf
deleted file mode 100644
index 31a46e3..0000000
--- a/config/jdk-defaults-ppc64.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= ibm-jdk-bin
diff --git a/config/jdk-defaults-sparc-solaris.conf b/config/jdk-defaults-sparc-solaris.conf
deleted file mode 100644
index c82e429..0000000
--- a/config/jdk-defaults-sparc-solaris.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= sun-jdk
diff --git a/config/jdk-defaults-sparc.conf b/config/jdk-defaults-sparc.conf
deleted file mode 100644
index c649d0e..0000000
--- a/config/jdk-defaults-sparc.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= blackdown-jdk
diff --git a/config/jdk-defaults-sparc64-solaris.conf b/config/jdk-defaults-sparc64-solaris.conf
deleted file mode 100644
index c82e429..0000000
--- a/config/jdk-defaults-sparc64-solaris.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= sun-jdk
diff --git a/config/jdk-defaults-x64-freebsd.conf b/config/jdk-defaults-x64-freebsd.conf
deleted file mode 100644
index 2af5546..0000000
--- a/config/jdk-defaults-x64-freebsd.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= diablo-jdk
diff --git a/config/jdk-defaults-x64-macos.conf b/config/jdk-defaults-x64-macos.conf
deleted file mode 100644
index c1f8d96..0000000
--- a/config/jdk-defaults-x64-macos.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= apple-jdk-bin
diff --git a/config/jdk-defaults-x64-solaris.conf b/config/jdk-defaults-x64-solaris.conf
deleted file mode 100644
index c82e429..0000000
--- a/config/jdk-defaults-x64-solaris.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= sun-jdk
diff --git a/config/jdk-defaults-x86-fbsd.conf b/config/jdk-defaults-x86-fbsd.conf
deleted file mode 100644
index 2af5546..0000000
--- a/config/jdk-defaults-x86-fbsd.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= diablo-jdk
diff --git a/config/jdk-defaults-x86-freebsd.conf b/config/jdk-defaults-x86-freebsd.conf
deleted file mode 100644
index 2af5546..0000000
--- a/config/jdk-defaults-x86-freebsd.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= diablo-jdk
diff --git a/config/jdk-defaults-x86-macos.conf b/config/jdk-defaults-x86-macos.conf
deleted file mode 100644
index c1f8d96..0000000
--- a/config/jdk-defaults-x86-macos.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= apple-jdk-bin
diff --git a/config/jdk-defaults-x86-solaris.conf b/config/jdk-defaults-x86-solaris.conf
deleted file mode 100644
index c82e429..0000000
--- a/config/jdk-defaults-x86-solaris.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= sun-jdk
diff --git a/config/jdk-defaults-x86.conf b/config/jdk-defaults-x86.conf
deleted file mode 100644
index ba50185..0000000
--- a/config/jdk-defaults-x86.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-# This files contain the default support jdk's
-*= icedtea6 icedtea6-bin sun-jdk blackdown-jdk ibm-jdk-bin jrockit-jdk-bin
diff --git a/setup.py b/setup.py
index b725cf3..0cba601 100644
--- a/setup.py
+++ b/setup.py
@@ -5,6 +5,7 @@ package_version = '2.2.0'
#######################################
from distutils.command.build import build
+from distutils.command.install import install
import fileinput, os, sys
class my_build(build):
@@ -21,10 +22,55 @@ class my_build(build):
sys.stdout.write(line.replace('@GENTOO_PORTAGE_EPREFIX@', eprefix))
+class my_install(install):
+ """
+ Generate and install the jdk defaults configuration file.
+
+ For the most part useless, wasn't updated in a long time either and doesn't
+ reflect reality anymore. Doing it here is at least a lot more maintainable
+ then a couple dozen files where it was defined before.
+ Also what should be default is a downstream decision and java-config
+ shouldn't have any business here. Still keeping it for the time being.
+ """
+
+ def run(self):
+ install.run(self)
+
+ arch = os.getenv('ARCH', 'unknown')
+ defaults = '*= icedtea'
+ if arch in ['amd64', 'x86']:
+ defaults = '*= icedtea6 icedtea6-bin sun-jdk blackdown-jdk ibm-jdk-bin jrockit-jdk-bin'
+ elif arch in ['ppc-macos', 'x64-macos', 'x86-macos']:
+ defaults = '*= apple-jdk-bin'
+ elif arch in ['amd64-fbsd', 'x86-fbsd', 'x64-freebsd', 'x86-freebsd']:
+ defaults = '*= diablo-jdk'
+ elif arch in ['sparc-solaris', 'sparc64-solaris', 'x64-solaris', 'x86-solaris']:
+ defaults = '*= sun-jdk'
+ elif arch in ['mips', 'sparc']:
+ defaults = '*= blackdown-jdk'
+ elif arch in ['ppc', 'ppc64', 'ppc-linux', 'ppc-aix']:
+ defaults = '*= ibm-jdk-bin'
+ elif arch in ['alpha']:
+ defaults = '*= compaq-jdk'
+ elif arch in ['arm']:
+ defaults = '*= icedtea-7 icedtea-6 icedtea-bin-7 icedtea-bin-6'
+ elif arch in ['ia64']:
+ defaults = '*= jrockit-jdk-bin'
+ elif arch in ['hppa']:
+ defaults = '*= kaffe'
+ elif arch in ['hpux']:
+ defaults = '*= hp-jdk-bin'
+
+ os.mkdir(self.root + '/usr/share/java-config-2/config/')
+ with open(self.root + '/usr/share/java-config-2/config/jdk-defaults.conf', 'w') as f:
+ f.write("# This files contain the default support jdk's\n")
+ f.write(defaults + "\n")
+
+
from distutils.core import setup
setup (
- cmdclass={'build' : my_build},
+ cmdclass={'build' : my_build, 'install' : my_install},
name = 'java-config',
version = package_version,
description = 'java enviroment configuration tool',