1 | # $Id: Portfile,v 1.3 2005/02/28 22:26:40 rshaw Exp $ |
---|
2 | PortSystem 1.0 |
---|
3 | |
---|
4 | name mediawiki |
---|
5 | version 1.4.9 |
---|
6 | categories www |
---|
7 | maintainers joe@netmusician.org |
---|
8 | description The wiki engine used by Wikipedia |
---|
9 | long_description MediaWiki is the collaborative editing software that runs Wikipedia, \ |
---|
10 | the free encyclopedia, and other projects. It's designed to \ |
---|
11 | handle a large number of users and pages without imposing too \ |
---|
12 | rigid a structure or workflow. |
---|
13 | |
---|
14 | homepage http://www.mediawiki.org |
---|
15 | master_sites sourceforge |
---|
16 | master_sites.mirror_subdir wikipedia |
---|
17 | distname mediawiki-${version} |
---|
18 | use_bzip2 no |
---|
19 | checksums md5 fae30b065d08152735b2c2edd61aadf4 |
---|
20 | platforms darwin freebsd |
---|
21 | |
---|
22 | depends_lib port:libiconv \ |
---|
23 | port:jpeg \ |
---|
24 | port:jasper \ |
---|
25 | port:tiff \ |
---|
26 | port:lcms \ |
---|
27 | port:libpng \ |
---|
28 | port:freetype \ |
---|
29 | port:libxml2 \ |
---|
30 | port:jbigkit \ |
---|
31 | port:expat \ |
---|
32 | port:fontconfig \ |
---|
33 | port:gnughostscript \ |
---|
34 | port:ImageMagick \ |
---|
35 | port:pkgconfig |
---|
36 | |
---|
37 | # Not sure this is the best way to handle this, but it works for now |
---|
38 | # if no apache variant is set, force set it |
---|
39 | if { ![variant_isset apache] && ![variant_isset apache2] } { |
---|
40 | set variations(apache) + |
---|
41 | } |
---|
42 | # if no mysql variant is set, force set it |
---|
43 | if { ![variant_isset mysql] && ![variant_isset mysql4] } { |
---|
44 | set variations(mysql4) + |
---|
45 | } |
---|
46 | # if no php variant is set, force set it |
---|
47 | if { ![variant_isset php4] && ![variant_isset php5] } { |
---|
48 | set variations(php4) + |
---|
49 | } |
---|
50 | |
---|
51 | variant apache conflicts apache2 { |
---|
52 | depends_lib-append port:apache |
---|
53 | } |
---|
54 | |
---|
55 | variant apache2 conflicts apache { |
---|
56 | depends_lib-append port:apache2 |
---|
57 | } |
---|
58 | |
---|
59 | variant php4 conflicts php5 { |
---|
60 | if { [variant_isset apache2] } { |
---|
61 | depends_lib-append path:${prefix}/apache2/modules/libphp4.so:php4 |
---|
62 | } else { |
---|
63 | depends_lib-append path:${prefix}/apache/libexec/libphp4.so:php4 |
---|
64 | } |
---|
65 | } |
---|
66 | |
---|
67 | variant php5 conflicts php4 { |
---|
68 | if { [variant_isset apache2] } { |
---|
69 | depends_lib-append path:${prefix}/apache2/modules/libphp5.so:php5 |
---|
70 | } else { |
---|
71 | depends_lib-append path:${prefix}/apache/libexec/libphp5.so:php5 |
---|
72 | } |
---|
73 | } |
---|
74 | |
---|
75 | variant mysql conflicts mysql4 { |
---|
76 | depends_lib-append port:mysql |
---|
77 | } |
---|
78 | |
---|
79 | variant mysql4 conflicts mysql { |
---|
80 | depends_lib-append port:mysql4 |
---|
81 | } |
---|
82 | |
---|
83 | use_configure no |
---|
84 | configure {} |
---|
85 | build {} |
---|
86 | |
---|
87 | destroot { |
---|
88 | if { [variant_isset apache] } { |
---|
89 | set docpath ${destroot}${prefix}/www/data |
---|
90 | } elseif { [variant_isset apache2] } { |
---|
91 | set docpath ${destroot}${prefix}/apache2/htdocs |
---|
92 | } |
---|
93 | xinstall -d -m 0755 ${docpath} |
---|
94 | system "cp -R ${worksrcpath} ${docpath}/mediawiki" |
---|
95 | if {$env(USER) == "root"} { |
---|
96 | system "chown -R root:wheel ${docpath}/mediawiki" |
---|
97 | } |
---|
98 | } |
---|
99 | |
---|
100 | post-activate { |
---|
101 | # Make sure initial conf file is present and setup correctly |
---|
102 | if { [variant_isset apache] } { |
---|
103 | set docpath ${prefix}/www/data |
---|
104 | } elseif { [variant_isset apache2] } { |
---|
105 | set docpath ${prefix}/apache2/htdocs |
---|
106 | } |
---|
107 | foreach confname {config config.footer config.header} { |
---|
108 | if {![file exists ${docpath}/mediawiki/config/index.php]} { |
---|
109 | xinstall -m 0644 ${docpath}/mediawiki/config/index.php \ |
---|
110 | } |
---|
111 | } |
---|
112 | } |
---|
113 | |
---|