diff options
author | Miroslav Šulc <fordfrog@gentoo.org> | 2006-11-22 00:38:49 +0000 |
---|---|---|
committer | Miroslav Šulc <fordfrog@gentoo.org> | 2006-11-22 00:38:49 +0000 |
commit | 86fb7cf1b702e8230b97a5b6a92df4914693238c (patch) | |
tree | 44ff161385576c7dc8a782fa2046e7afad1230df /dev-util | |
parent | Added dev-util/idea, from bug #87419. (diff) | |
download | java-86fb7cf1b702e8230b97a5b6a92df4914693238c.tar.gz java-86fb7cf1b702e8230b97a5b6a92df4914693238c.tar.bz2 java-86fb7cf1b702e8230b97a5b6a92df4914693238c.zip |
netbeans/files/6.0/config.sh: Enhanced Netbeans configuration script so it can now auto-configure Netbeans for Tomcat 5.5 and JBoss 4 servers
svn path=/migrated-java-experimental-overlay/; revision=3281
Diffstat (limited to 'dev-util')
-rw-r--r-- | dev-util/netbeans/ChangeLog | 4 | ||||
-rw-r--r-- | dev-util/netbeans/Manifest | 8 | ||||
-rw-r--r-- | dev-util/netbeans/files/6.0/config.sh | 139 |
3 files changed, 136 insertions, 15 deletions
diff --git a/dev-util/netbeans/ChangeLog b/dev-util/netbeans/ChangeLog index 035bacbc..f10f371d 100644 --- a/dev-util/netbeans/ChangeLog +++ b/dev-util/netbeans/ChangeLog @@ -2,6 +2,10 @@ # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 22 Nov 2006; Miroslav Šulc <miroslav.sulc@startnet.cz> ChangeLog: + Enhanced Netbeans configuration script so it can now auto-configure Netbeans + for Tomcat 5.5 and JBoss 4 servers + 12 Nov 2006; Miroslav Šulc <miroslav.sulc@startnet.cz> ChangeLog: optimized 5.5-r1 ebuild for merge speed, changed jdk and jre to >=1.5, removed patches; nb 6.0: removed some repoman warnings diff --git a/dev-util/netbeans/Manifest b/dev-util/netbeans/Manifest index f4cdde1c..48c451f1 100644 --- a/dev-util/netbeans/Manifest +++ b/dev-util/netbeans/Manifest @@ -2,10 +2,10 @@ AUX 5.5/startscript.sh 421 RMD160 6494dc2a8d810d37f9eea36b4cf759aea8ec92d9 SHA1 MD5 06cb85e3af52ad431914dd95f3ed4eff files/5.5/startscript.sh 421 RMD160 6494dc2a8d810d37f9eea36b4cf759aea8ec92d9 files/5.5/startscript.sh 421 SHA256 dfd619a0a71b28e17facb015e8d4be79c495361f29e97da4cf55ced7f3f87b5f files/5.5/startscript.sh 421 -AUX 6.0/config.sh 3119 RMD160 9718b945d46ee03775e23a3be521b410130acbc2 SHA1 eb51274bdb2afe88701a601f66c9df4848f2681f SHA256 e90dd5403989ff748396b9528ccf14418a1a059328bb005dcbd056e6aab1fb2b -MD5 a4126ba2ab3ecc20a49a8298a4aa14bc files/6.0/config.sh 3119 -RMD160 9718b945d46ee03775e23a3be521b410130acbc2 files/6.0/config.sh 3119 -SHA256 e90dd5403989ff748396b9528ccf14418a1a059328bb005dcbd056e6aab1fb2b files/6.0/config.sh 3119 +AUX 6.0/config.sh 8047 RMD160 091344038bb330f36fbab2989b60c4cc7e4c697c SHA1 01180f091ee7ba52c819bf1a98b2aae27156acf9 SHA256 c6185df6af200e94b51425fa4b1498dddae1f5d8d52ae18f607cc6cc6449bcb7 +MD5 4de12ae0695df4ac533445cf62cbbf41 files/6.0/config.sh 8047 +RMD160 091344038bb330f36fbab2989b60c4cc7e4c697c files/6.0/config.sh 8047 +SHA256 c6185df6af200e94b51425fa4b1498dddae1f5d8d52ae18f607cc6cc6449bcb7 files/6.0/config.sh 8047 AUX 6.0/netbeans-6.0_alpha20061023-gentoo.patch 1373 RMD160 40bdeed6c42432f63a903aa9f22fd8a63d75bdab SHA1 d4f047fe35a1d0781eca1293db4e1197b719ca09 SHA256 29d284101bee8b3d4139c9f887814b88cf5e3f4da17d3839aff3a2475edf6d37 MD5 576bd3a67bb99c0b4ed84b590fa2d948 files/6.0/netbeans-6.0_alpha20061023-gentoo.patch 1373 RMD160 40bdeed6c42432f63a903aa9f22fd8a63d75bdab files/6.0/netbeans-6.0_alpha20061023-gentoo.patch 1373 diff --git a/dev-util/netbeans/files/6.0/config.sh b/dev-util/netbeans/files/6.0/config.sh index cc62dbd9..1b2f7489 100644 --- a/dev-util/netbeans/files/6.0/config.sh +++ b/dev-util/netbeans/files/6.0/config.sh @@ -7,17 +7,21 @@ function display_usage() { einfo einfo "Usage ${0} <action>" einfo "Actions:" - einfo " ant - Configures Netbeans 6.0 ant classpath. Useful if you want to use ant-1.7 with Netbeans." - einfo " Default Netbeans configuration doesn't work with Gentoo ant-1.7 because Gentoo ant-1.7" - einfo " is split into several packages in separate directories whereas default Netbeans" - einfo " configuration expects all these packages being in single directory. You must define" - einfo " paths to these packages in Netbeans ant configuration so ant can find them. This action" - einfo " configures Netbeans ant classpath for you so ant knows where these packages are. You" - einfo " can modify the classpath in Tools -> Options -> Miscellaneous -> Ant -> Manage Classpath." - einfo " lm - Copies settings of Library Manager from one version of Netbeans to another so you do not" - einfo " have to define/update it manually. It is useful if you are upgrading from 5.5 to 6.0 or" - einfo " you use both 5.5 and 6.0 and want to copy the settings from one version to the other." - einfo " Netbeans 5.5 and 6.0 are supported." + einfo " ant - Configures Netbeans 6.0 ant classpath. Useful if you want to use ant-1.7 with Netbeans." + einfo " Default Netbeans configuration doesn't work with Gentoo ant-1.7 because Gentoo ant-1.7" + einfo " is split into several packages in separate directories whereas default Netbeans" + einfo " configuration expects all these packages being in single directory. You must define" + einfo " paths to these packages in Netbeans ant configuration so ant can find them. This action" + einfo " configures Netbeans ant classpath for you so ant knows where these packages are. You" + einfo " can modify the classpath in Tools -> Options -> Miscellaneous -> Ant -> Manage Classpath." + einfo " lm - Copies settings of Library Manager from one version of Netbeans to another so you do not" + einfo " have to define/update it manually. It is useful if you are upgrading from 5.5 to 6.0 or" + einfo " you use both 5.5 and 6.0 and want to copy the settings from one version to the other." + einfo " Netbeans 5.5 and 6.0 are supported." + einfo " tomcat55 - Adds Tomcat 5.5 configuration to Netbeans Server Manager. Tomcat 5.5 must be installed" + einfo " before it can be used from Netbeans." + einfo " jboss4 - Adds JBoss 4.x configuration to Netbeans Server Manager. JBoss 4.x must be installed" + einfo " before it can be used from Netbeans." } function config_ant() { @@ -78,6 +82,111 @@ function config_lm() { einfo "Library Manager configuration files has been updated" } +config_tomcat55() { + SERVER_NAME="Tomcat 5.5" + INSTANCE_CONFIG=" <attr name=\"admin_port\" stringvalue=\"8005\"/> + <attr name=\"debug_type\" stringvalue=\"SEL_debuggingType_socket\"/> + <attr name=\"displayName\" stringvalue=\"Tomcat 5.5\"/> + <attr name=\"httpportnumber\" stringvalue=\"8080\"/> + <attr name=\"instance_id\" stringvalue=\"tomcat55\"/> + <attr name=\"monitor_enabled\" stringvalue=\"false\"/> + <attr name=\"password\" stringvalue=\"password\"/> + <attr name=\"runningCheckTimeout\" stringvalue=\"2000\"/> + <attr name=\"timestamp\" stringvalue=\"1161241641000\"/> + <attr name=\"url\" stringvalue=\"tomcat55:home=/usr/share/tomcat-5.5:base=/var/lib/tomcat-5.5\"/> + <attr name=\"username\" stringvalue=\"ide\"/>" + PROPERTIES_FILE="tomcat55.properties" + PROPERTIES="tomcat.home=/usr/share/tomcat-5.5\ntomcat.password=password\ntomcat.url=http://localhost:8080\ntomcat.username=ide" + SERVER_PACKAGE="www-servers/tomcat-5.5" + config_server +} + +config_jboss4() { + SERVER_NAME="JBoss 4" + INSTANCE_CONFIG=" <attr name=\"deploy-dir\" stringvalue=\"/usr/share/jboss-4/server/default/deploy\"/> + <attr name=\"displayName\" stringvalue=\"JBoss Application Server 4\"/> + <attr name=\"host\" stringvalue=\"localhost\"/> + <attr name=\"password\" stringvalue=\"\"/> + <attr name=\"port\" stringvalue=\"8080\"/> + <attr name=\"root-dir\" stringvalue=\"/usr/share/jboss-4\"/> + <attr name=\"server\" stringvalue=\"default\"/> + <attr name=\"server-dir\" stringvalue=\"/usr/share/jboss-4/server/default\"/> + <attr name=\"url\" stringvalue=\"jboss-deployer:localhost:8080#default&/usr/share/jboss-4\"/> + <attr name=\"username\" stringvalue=\"\"/>" + PROPERTIES_FILE="config/J2EE/jb.properties" + PROPERTIES="#\n#Tue Nov 21 23:34:10 CET 2006\ninstallRoot=/usr/share/jboss-4" + SERVER_PACKAGE="www-servers/jboss-4" + config_server +} + +# These variables must be set before this function is called: +# SERVER_NAME +# INSTANCE_CONFIG +# PROPERTIES_FILE +# PROPERTIES +# SERVER_PACKAGE +# See config_tomcat55 for content. + +config_server() { + einfo "Gentoo Netbeans 6.0 Configuration Utility - ${SERVER_NAME} Configuration" + einfo + einfo "Provide path to your Netbeans home dir." + einfo "Default is [${HOME}/.netbeans/dev]:" + read USERDIR + if [ -z "${USERDIR}" ]; then + USERDIR="${HOME}/.netbeans/dev" + fi + + FILE="${USERDIR}/config/J2EE/InstalledServers/.nbattrs" + if [ ! -d "${USERDIR}/config/J2EE/InstalledServers" ]; then + mkdir -p ${USERDIR}/config/J2EE/InstalledServers + fi + + if [ ! -f "${FILE}" ]; then + echo -e "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE attributes PUBLIC \"-//NetBeans//DTD DefaultAttributes 1.0//EN\" \"http://www.netbeans.org/dtds/attributes-1_0.dtd\">\n<attributes version=\"1.0\">\n</attributes>" > ${FILE} + fi + + EXISTS=`grep "\"${SERVER_NAME}\"" ${FILE}` + if [ -n "${EXISTS}" ]; then + ewarn + ewarn "Netbeans configuration file already contains \"${SERVER_NAME}\" configuration. Doing nothing." + else + get_j2ee_instance ${FILE} + + sed -i -e "s%</attributes>%%" ${FILE} + get_j2ee_instance + echo " <fileobject name=\"${INSTANCE}\">" >> ${FILE} + echo ${INSTANCE_CONFIG} >> ${FILE} + echo -e " </fileobject>\n</attributes>" >> ${FILE} + touch ${USERDIR}/config/J2EE/InstalledServers/${INSTANCE} + + echo -e ${PROPERTIES} > ${USERDIR}/${PROPERTIES_FILE} + + einfo + einfo "Netbeans has been configured for ${SERVER_NAME}." + + if ! portageq has_version / =${SERVER_PACKAGE}*; then + ewarn "You do not have ${SERVER_NAME} emerged. Run" + ewarn "emerge =${SERVER_PACKAGE}*" + ewarn "to have ${SERVER_NAME} installed." + fi + fi +} + +get_j2ee_instance() { + INSTANCE_FILE="${USERDIR}/config/J2EE/InstalledServers/.nbattrs" + INSTANCE=`grep "\"instance\"" ${INSTANCE_FILE}` + if [ -z "${INSTANCE}" ]; then + INSTANCE="instance" + else + COUNTER=0 + while [ -n "${INSTANCE}" ]; do + COUNTER=$((${COUNTER} + 1)) + INSTANCE=`grep "\"instance_${COUNTER}\"" ${INSTANCE_FILE}` + done + INSTANCE="instance_${COUNTER}" + fi +} case ${1} in ant) @@ -88,6 +197,14 @@ case ${1} in config_lm ;; + tomcat55) + config_tomcat55 + ;; + + jboss4) + config_jboss4 + ;; + *) display_usage ;; |