[65901] trunk/dports/databases/cassandra/Portfile

singingwolfboy at macports.org singingwolfboy at macports.org
Fri Apr 2 11:54:41 PDT 2010


Revision: 65901
          http://trac.macports.org/changeset/65901
Author:   singingwolfboy at macports.org
Date:     2010-04-02 11:54:39 -0700 (Fri, 02 Apr 2010)
Log Message:
-----------
Integrated Cassandra dependencies into Macports management

Modified Paths:
--------------
    trunk/dports/databases/cassandra/Portfile

Modified: trunk/dports/databases/cassandra/Portfile
===================================================================
--- trunk/dports/databases/cassandra/Portfile	2010-04-02 17:54:49 UTC (rev 65900)
+++ trunk/dports/databases/cassandra/Portfile	2010-04-02 18:54:39 UTC (rev 65901)
@@ -5,7 +5,7 @@
 
 name                    cassandra
 version                 0.5.1
-revision                1
+revision                2
 categories              databases
 maintainers             singingwolfboy openmaintainer
 homepage                http://cassandra.apache.org/
@@ -28,14 +28,17 @@
                         rmd160  259ecf4de5c3293b307662db0bd9cdb5bd8fb3e4
 
 depends_build           bin:ant:apache-ant
+depends_run             port:antlr3 port:junit port:jline port:slf4j \
+                        port:commons-cli port:commons-lang port:commons-collections \
+                        port:jakarta-log4j port:google-collections 
+set mp_libs {antlr junit jline slf4j-api slf4j-log4j12 commons-cli \
+    commons-lang commons-collections jakarta-log4j google-collect }
 
 use_configure           no
 
 build.cmd               ${prefix}/bin/ant
 build.target            jar
 
-proc touch name {close [open $name a]}
-
 destroot {
     # create directories
     set cas_home ${destroot}${prefix}/share/java/${name}
@@ -56,8 +59,17 @@
     eval xinstall -m 755 [glob ${worksrcpath}/bin/*] ${destroot}${prefix}/bin
 
     # install jars
-    xinstall -m 755 ${worksrcpath}/build/apache-${name}-${version}.jar ${cas_home}/${name}.jar
-    eval xinstall -m 755 [glob ${worksrcpath}/lib/*.jar] ${cas_home}/lib/
+    xinstall -m 644 ${worksrcpath}/build/apache-${name}-${version}.jar \
+        ${destroot}${prefix}/share/java/${name}.jar
+    if {[variant_isset no_deps]} {
+        eval xinstall -m 644 [glob ${worksrcpath}/lib/*.jar] ${cas_home}/lib/
+    } else {
+        foreach lib $mp_libs {
+            ln -s ${prefix}/share/java/$lib.jar ${cas_home}/lib/$lib.jar
+            file delete ${worksrcpath}/lib/$lib.jar
+        }
+        eval xinstall -m 644 [glob ${worksrcpath}/lib/*.jar] ${cas_home}/lib/
+    }
     
     # install conf, contrib, interface
     move ${worksrcpath}/conf ${worksrcpath}/contrib ${worksrcpath}/interface ${cas_home}
@@ -71,3 +83,53 @@
 }
 destroot.keepdirs   ${destroot}${prefix}/var/log/cassandra/ \
                     ${destroot}${prefix}/var/lib/cassandra/
+
+
+pre-build {
+    if {[variant_isset no_deps]} {} else {
+        file delete ${worksrcpath}/lib/antlr-3.1.3.jar
+        ln -s ${prefix}/share/java/antlr.jar ${worksrcpath}/lib/antlr.jar
+        reinplace "s|antlr-3.1.3.jar|antlr.jar|" ${worksrcpath}/build.xml
+        
+        file delete ${worksrcpath}/lib/junit-4.6.jar
+        ln -s ${prefix}/share/java/junit.jar ${worksrcpath}/lib/junit.jar
+        reinplace "s|junit-4.6.jar|junit.jar|" ${worksrcpath}/build.xml
+        
+        file delete ${worksrcpath}/lib/commons-cli-1.1.jar
+        ln -s ${prefix}/share/java/commons-cli.jar ${worksrcpath}/lib/commons-cli.jar
+        reinplace "s|commons-cli-1.1.jar|commons-cli.jar|" ${worksrcpath}/build.xml
+        
+        file delete ${worksrcpath}/lib/commons-lang-2.4.jar
+        ln -s ${prefix}/share/java/commons-lang.jar ${worksrcpath}/lib/commons-lang.jar
+        reinplace "s|commons-lang-2.4.jar|commons-lang.jar|" ${worksrcpath}/build.xml
+        
+        file delete ${worksrcpath}/lib/commons-collections-3.2.1.jar
+        ln -s ${prefix}/share/java/commons-collections.jar ${worksrcpath}/lib/commons-collections.jar
+        reinplace "s|commons-collections-3.2.1.jar|commons-collections.jar|" ${worksrcpath}/build.xml
+        
+        file delete ${worksrcpath}/lib/log4j-1.2.15.jar
+        ln -s ${prefix}/share/java/jakarta-log4j.jar ${worksrcpath}/lib/jakarta-log4j.jar
+        reinplace "s|log4j-1.2.15.jar|jakarta-log4j.jar|" ${worksrcpath}/build.xml
+        
+        file delete ${worksrcpath}/lib/google-collect-1.0-rc1.jar
+        ln -s ${prefix}/share/java/google-collect.jar ${worksrcpath}/lib/google-collect.jar
+        reinplace "s|google-collect-1.0-rc1.jar|google-collect.jar|" ${worksrcpath}/build.xml
+        
+        file delete ${worksrcpath}/lib/jline-0.9.94.jar
+        ln -s ${prefix}/share/java/jline.jar ${worksrcpath}/lib/jline.jar
+        reinplace "s|jline-0.9.94.jar|jline.jar|" ${worksrcpath}/build.xml
+        
+        file delete ${worksrcpath}/lib/slf4j-api-1.5.8.jar
+        ln -s ${prefix}/share/java/slf4j-api.jar ${worksrcpath}/lib/slf4j-api.jar
+        reinplace "s|slf4j-api-1.5.8.jar|slf4j-api.jar|" ${worksrcpath}/build.xml
+        
+        file delete ${worksrcpath}/lib/slf4j-log4j12-1.5.8.jar
+        ln -s ${prefix}/share/java/slf4j-log4j12.jar ${worksrcpath}/lib/slf4j-log4j12.jar
+        reinplace "s|slf4j-log4j12-1.5.8.jar|slf4j-log4j12.jar|" ${worksrcpath}/build.xml
+    }
+}
+
+variant no_deps description {Use jar files that came with Cassandra distribution for dependencies, instead of using Macports to install dependencies} {
+    # clear all runtime deps
+    depends_run
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100402/232ee801/attachment.html>


More information about the macports-changes mailing list