| 1 |
<project name="JetspeedInstaller" default="install" basedir="${basedir}"> |
| 2 |
|
| 3 |
<!--property name="jetspeedDir" value="${installDir}/webapps/palportal" /--> |
| 4 |
<!--property name="portletAppsDir" value="${installDir}/portlet_apps"/--> |
| 5 |
<property name="dbName" value="derby"/> |
| 6 |
<property name="dbUser" value=""/> |
| 7 |
<property name="dbPassword" value=""/> |
| 8 |
<property name="jdbcUrl" value="jdbc:derby:${installDir}/webapps/palportal/WEB-INF/productiondb;create=true"/> |
| 9 |
<property name="jdbcDriverClass" value="org.apache.derby.jdbc.EmbeddedDriver"/> |
| 10 |
|
| 11 |
<target name="install" > |
| 12 |
<echo>basic install starting</echo> |
| 13 |
<mkdir dir="${basedir}/temp"/> |
| 14 |
<unzip src="installpack.zip" dest="${basedir}/temp"/> |
| 15 |
<echo>install unpack done</echo> |
| 16 |
|
| 17 |
<echo> moving stuff from the temp dir </echo> |
| 18 |
<echo>now configuring</echo> |
| 19 |
<copy todir="${installDir}" overwrite="true"> |
| 20 |
<fileset dir="${basedir}/temp"> |
| 21 |
<exclude name="**/palportal.xml"/> |
| 22 |
</fileset> |
| 23 |
</copy> |
| 24 |
|
| 25 |
<echo>unpacking palportal war</echo> |
| 26 |
<!--unwar src="${installDir}/webapps/palportal.war" dest="${installDir}/webapps/palportal" /--> |
| 27 |
<copy file="temp/jetspeed-tomcat-5.5.xml" |
| 28 |
tofile="${installDir}/conf/Catalina/localhost/palportal.xml" overwrite="true"> |
| 29 |
<filterset begintoken="@" endtoken="@"> |
| 30 |
<filter token="CONTEXT" value="palportal"/> |
| 31 |
<filter token="USERNAME" value="${dbUser}"/> |
| 32 |
<filter token="PASSWORD" value="${dbPassword}"/> |
| 33 |
<filter token="DRIVER" value="${jdbcDriverClass}"/> |
| 34 |
<filter token="URL" value="${jdbcUrl}"/> |
| 35 |
</filterset> |
| 36 |
</copy> |
| 37 |
<delete file="${installDir}/jetspeed-tomcat-5.5.xml" failonerror="false"/> |
| 38 |
|
| 39 |
<echo>copying database driver jar</echo> |
| 40 |
<!-- place db jar in shared.. we assume the Catalina will not need to talk to this --> |
| 41 |
<copy failonerror="false" file="${jdbcDriverJar}" todir="${installDir}/shared/lib" overwrite="true" /> |
| 42 |
<echo>fixing permissions</echo> |
| 43 |
<chmod perm="700" dir="${installDir}/bin" includes="**/*.sh"/> |
| 44 |
|
| 45 |
<echo>unzip portlet pack file</echo> |
| 46 |
<unzip src="${portletPackFile}" dest="${installDir}/webapps/palportal/WEB-INF/deploy"/> |
| 47 |
|
| 48 |
<echo>basic install finished</echo> |
| 49 |
</target> |
| 50 |
|
| 51 |
<target name="generateDb"> |
| 52 |
<echo>starting Db generation</echo> |
| 53 |
<sql driver="${jdbcDriverClass}" url="${jdbcUrl}" userid="${dbUser}" |
| 54 |
password="${dbPassword}" |
| 55 |
src="${basedir}/database/${dbName}/schema/phase1-schema.sql" |
| 56 |
print="yes" output="outputfile.txt"> |
| 57 |
<classpath> |
| 58 |
<pathelement location="${jdbcDriverJar}"/> |
| 59 |
</classpath> |
| 60 |
</sql> |
| 61 |
<sql driver="${jdbcDriverClass}" url="${jdbcUrl}" userid="${dbUser}" |
| 62 |
password="${dbPassword}" |
| 63 |
src="${basedir}/database/${dbName}/schema/phase2-schema.sql" |
| 64 |
print="yes" output="outputfile.txt"> |
| 65 |
<classpath> |
| 66 |
<pathelement location="${jdbcDriverJar}"/> |
| 67 |
</classpath> |
| 68 |
</sql> |
| 69 |
<sql driver="${jdbcDriverClass}" url="${jdbcUrl}" userid="${dbUser}" |
| 70 |
password="${dbPassword}" |
| 71 |
src="${basedir}/database/${dbName}/schema/phase3ojb-schema.sql" |
| 72 |
print="yes" output="outputfile.txt"> |
| 73 |
<classpath> |
| 74 |
<pathelement location="${jdbcDriverJar}"/> |
| 75 |
</classpath> |
| 76 |
</sql> |
| 77 |
<sql driver="${jdbcDriverClass}" url="${jdbcUrl}" userid="${dbUser}" |
| 78 |
password="${dbPassword}" |
| 79 |
src="${basedir}/database/${dbName}/schema/prefs-schema.sql" |
| 80 |
print="yes" output="outputfile.txt"> |
| 81 |
<classpath> |
| 82 |
<pathelement location="${jdbcDriverJar}"/> |
| 83 |
</classpath> |
| 84 |
</sql> |
| 85 |
<sql driver="${jdbcDriverClass}" url="${jdbcUrl}" userid="${dbUser}" |
| 86 |
password="${dbPassword}" |
| 87 |
src="${basedir}/database/${dbName}/schema/registry-schema.sql" |
| 88 |
print="yes" output="outputfile.txt"> |
| 89 |
<classpath> |
| 90 |
<pathelement location="${jdbcDriverJar}"/> |
| 91 |
</classpath> |
| 92 |
</sql> |
| 93 |
<sql driver="${jdbcDriverClass}" url="${jdbcUrl}" userid="${dbUser}" |
| 94 |
password="${dbPassword}" |
| 95 |
src="${basedir}/database/${dbName}/schema/security-schema.sql" |
| 96 |
print="yes" output="outputfile.txt"> |
| 97 |
<classpath> |
| 98 |
<pathelement location="${jdbcDriverJar}"/> |
| 99 |
</classpath> |
| 100 |
</sql> |
| 101 |
<sql driver="${jdbcDriverClass}" url="${jdbcUrl}" userid="${dbUser}" |
| 102 |
password="${dbPassword}" |
| 103 |
src="${basedir}/database/${dbName}/populate-userinfo-for-default-psml.sql" |
| 104 |
print="yes" output="outputfile.txt"> |
| 105 |
<classpath> |
| 106 |
<pathelement location="${jdbcDriverJar}"/> |
| 107 |
</classpath> |
| 108 |
</sql> |
| 109 |
<sql driver="${jdbcDriverClass}" url="${jdbcUrl}" userid="${dbUser}" |
| 110 |
password="${dbPassword}" |
| 111 |
src="${basedir}/database/populate-db-default.sql" print="yes" |
| 112 |
output="outputfile.txt"> |
| 113 |
<classpath> |
| 114 |
<pathelement location="${jdbcDriverJar}"/> |
| 115 |
</classpath> |
| 116 |
</sql> |
| 117 |
<echo>DB generation done!</echo> |
| 118 |
</target> |
| 119 |
|
| 120 |
<target name="mailServerConfiguration"> |
| 121 |
<echo>starting Mail server configuration</echo> |
| 122 |
<copy file="temp/administration.xml" |
| 123 |
tofile="${installDir}/webapps/palportal/WEB-INF/assembly/administration.xml" overwrite="true"> |
| 124 |
<filterset begintoken="@" endtoken="@"> |
| 125 |
<filter token="MAIL_SERVER" value="${mailServer}"/> |
| 126 |
<filter token="MAIL_USERNAME" value="${msUsername}"/> |
| 127 |
<filter token="MAIL_PASSWORD" value="${msPassword}"/> |
| 128 |
<filter token="MAIL_AUTH" value="${msAuth}"/> |
| 129 |
</filterset> |
| 130 |
</copy> |
| 131 |
<delete file="${installDir}/administration.xml" failonerror="false"/> |
| 132 |
<echo>Mail server configuration done!</echo> |
| 133 |
</target> |
| 134 |
</project> |