1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id: $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name mod_hfs_apple |
---|
7 | version 14 |
---|
8 | categories www |
---|
9 | platforms darwin |
---|
10 | maintainers nomaintainer |
---|
11 | description mod_hfs_apple is an apache2 module to fix some pecularities with HFS |
---|
12 | long_description Apache module (to enforce casing in URLs which need it).\ |
---|
13 | Version 14 also prevents vulnerabilities like "index.p%E2%80%8Chp" access. |
---|
14 | |
---|
15 | set aname apache_${name} |
---|
16 | license APSL-2 |
---|
17 | distname ${aname}-${version} |
---|
18 | homepage http://opensource.apple.com/source/${aname}/ |
---|
19 | master_sites http://opensource.apple.com/tarballs/${aname} |
---|
20 | worksrcdir ${distname} |
---|
21 | |
---|
22 | checksums rmd160 1d3605e9a35f111ed076d03cb9791760b77bfbb4 \ |
---|
23 | sha256 9b9b1896829e5eba0864d1539b4c57a071cff3fc6ccdf8757b89efc2ebf7e4e6 |
---|
24 | |
---|
25 | depends_lib port:apache2 |
---|
26 | |
---|
27 | set apath ${prefix}/apache2 |
---|
28 | set amods ${apath}/modules |
---|
29 | |
---|
30 | use_configure no |
---|
31 | |
---|
32 | build.cmd ${apath}/bin/apxs |
---|
33 | build.target |
---|
34 | build.args -c -Wc,\" -Wall -Wextra -Os -g\" \ |
---|
35 | -Wl,\" -framework CoreFoundation\" \ |
---|
36 | -o ${name}.so ${name}2.c |
---|
37 | |
---|
38 | destroot.violate_mtree yes |
---|
39 | |
---|
40 | destroot { |
---|
41 | xinstall -m 755 -d ${destroot}${amods} |
---|
42 | xinstall -m 644 ${worksrcpath}/.libs/${name}.so ${destroot}${amods} |
---|
43 | } |
---|
44 | |
---|
45 | variant auto description { Automatically add ${name} to apache2 configuration and restart apache2 } { |
---|
46 | } |
---|
47 | |
---|
48 | default_variants +auto |
---|
49 | |
---|
50 | if {[variant_isset auto]} { |
---|
51 | notes "Enable/disable ${name} automatically (with apxs and apachectl)." |
---|
52 | } else { |
---|
53 | notes "The variant +auto has been disabled, so, |
---|
54 | after installation/activation, |
---|
55 | ${apath}/bin/apxs -e -a -n \"hfs_apple\" ${amods}/${name}.so |
---|
56 | needs to be run, or the line |
---|
57 | --- |
---|
58 | LoadModule hfs_apple_module modules/mod_hfs_apple.so |
---|
59 | --- |
---|
60 | manually added to the apache2 configuration file |
---|
61 | ${apath}/conf/httpd.conf |
---|
62 | and then, if the apache2 server is running, the command |
---|
63 | --- |
---|
64 | ${apath}/bin/apachectl -k graceful |
---|
65 | --- |
---|
66 | issued to restart the apache2 server. |
---|
67 | |
---|
68 | If ${name} is ever deactivated/uninstalled, |
---|
69 | the above mentioned line in the configuration file |
---|
70 | will be commented out - for apache2 to start - |
---|
71 | but apache2 needs to be restarted manually." |
---|
72 | } |
---|
73 | |
---|
74 | post-activate { |
---|
75 | if {[variant_isset auto]} { |
---|
76 | ui_msg "Enabling ${name} in the apache2 configuration" |
---|
77 | system "${apath}/bin/apxs -e -a -n \"hfs_apple\" ${amods}/${name}.so" |
---|
78 | if {[file exists ${apath}/logs/httpd.pid]} { |
---|
79 | ui_msg "Restarting apache2 gracefully" |
---|
80 | system "${apath}/bin/apachectl -k graceful" |
---|
81 | ui_msg "apache2 is now secure on HFS" |
---|
82 | } |
---|
83 | } |
---|
84 | } |
---|
85 | |
---|
86 | pre-deactivate { |
---|
87 | ui_msg "Disabling ${name} in the apache2 configuration" |
---|
88 | system "${apath}/bin/apxs -e -A -n \"hfs_apple\" ${amods}/${name}.so" |
---|
89 | if {[variant_isset auto] && [file exists ${apath}/logs/httpd.pid]} { |
---|
90 | ui_msg "Restarting apache2 gracefully" |
---|
91 | system "${apath}/bin/apachectl -k graceful" |
---|
92 | ui_msg "apache2 on HFS is not secure anymore" |
---|
93 | } |
---|
94 | } |
---|