source: trunk/dports/java/blojsom/Portfile

Last change on this file was 86632, checked in by ryandesign@…, 6 years ago

Rewrite master_sites to avoid redirects

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1# $Id: Portfile 86632 2011-10-30 12:24:57Z ryandesign@macports.org $
2
3PortSystem 1.0
4
5name                            blojsom
6version                         2.24
7
8categories                      java www
9maintainers                     nomaintainer
10platforms                       darwin
11
12description                     A blogging package written in Java.
13long_description        Blojsom is a full-featured, multi-user, multi-blog package written in Java \
14                                        that was inspired by blosxom. blojsom aims to retain the simplicity \
15                                        in design of its Perl-based "relative" while adding user flexibility \
16                                        in areas such as the flavors, templating, plugins, and the ability to \
17                                        run a multi-user blog with a single blojsom installation.
18homepage                        http://www.blojsom.com
19                               
20distname                        ${name}-${version}-source
21master_sites            sourceforge:project/blojsom/OldFiles
22checksums                       md5 b5aef7e3ebd5840e2d757c61f21df52b
23
24use_zip                         yes
25use_configure           no
26
27depends_build           bin:ant:apache-ant
28depends_lib                     bin:java:kaffe
29
30set blog_home           ${prefix}/var/db/${name}
31set blojsom_user        www
32set blojsom_group       www
33
34default_variants        +tomcat5
35
36variant tomcat5 {
37        depends_lib-append      port:tomcat5
38}
39
40extract.dir                     ${worksrcpath}
41pre-extract {
42        file mkdir "${worksrcpath}"
43}
44
45post-patch {
46        set webInf ${worksrcpath}/war/WEB-INF
47        reinplace s|blojsom-blog-home=|blojsom-blog-home=${blog_home}| ${webInf}/blojsom.properties
48}
49                               
50build.cmd                       ant
51build.target            war javadoc
52
53destroot        {
54        # Ensure needed directories
55        xinstall -m 755 -d \
56                ${destroot}${prefix}/share/java \
57                ${destroot}${prefix}/share/doc
58       
59        # Make a place to store blog entries
60        xinstall -m 775 -d ${destroot}${blog_home}/default
61        destroot.keepdirs-append ${destroot}${blog_home}/default
62        system "chown -R ${blojsom_user}:${blojsom_group} ${destroot}${blog_home}"
63        system "chmod -R 775 ${destroot}${blog_home}"
64               
65        # Install the war where it can be found
66        xinstall -m 644 \
67                ${worksrcpath}/distro/blojsom.war \
68                ${destroot}${prefix}/share/java
69               
70        # Install docs
71        file copy ${worksrcpath}/docs/content ${destroot}${prefix}/share/doc/${name}
72
73        # Install the war into the tomcat webapps directory
74        if {[variant_isset tomcat5]} {
75                set dest ${destroot}${prefix}/share/java/tomcat5/webapps/${name}
76               
77                # Extract the war into tomcat's webapps folder
78                xinstall -m 755 -d ${dest}
79                system "cd ${dest} && jar xf ${worksrcpath}/distro/blojsom.war"
80               
81                system "chown -R ${blojsom_user}:${blojsom_group} ${dest}"
82                system "chmod -R 775 ${dest}"           
83               
84                # Do some cleanup on the directory to so that it'll work across upgrades
85                set volatile "  WEB-INF/blojsom.properties
86                                                WEB-INF/plugin.properties
87                                                "
88                foreach { f } ${volatile} {
89                        file rename ${dest}/${f} ${dest}/${f}.sample
90                }
91                       
92                ui_info "#"
93                ui_info "# blojsom was copied into the tomcat5/webapps directory. "
94                ui_info "# You may need to kick tomcat so that it'll be deployed."
95                ui_info "#"
96                ui_info "# The following configuration files have been installed with "
97                ui_info "# a .sample suffix to prevent their being munged during upgrade. "
98                ui_info "# You'll want to copy them to a like name, without the suffix, during "
99                ui_info "# your configuration:"
100                ui_info "#      [join ${volatile}]"
101                ui_info "#"
102        }
103}
Note: See TracBrowser for help on using the repository browser.