Ticket #1260: Portfile

File Portfile, 4.2 KB (added by simon@…, 20 years ago)

Portfile

Line 
1# $Id: $
2
3PortSystem 1.0
4name                            htdig
5version                         3.1.6
6categories                      www
7platforms                       darwin freebsd
8maintainers                     simon@cotsworth.com
9description                     WWW Search Engine Software
10
11long_description        The ht://Dig system is a complete world wide web indexing and searching system \
12                                        for a domain or intranet. This system is not meant to replace the need for \
13                                        powerful internet-wide search systems like Lycos, Infoseek, Google and AltaVista. \
14                                        Instead it is meant to cover the search needs for a single company, campus, or \
15                                        even a particular sub section of a web site. As opposed to some WAIS-based or \
16                                        web-server based search engines, ht://Dig can easily span several web servers. \
17                                        The type of these different web servers doesn't matter as long as they \
18                                        understand common protocols like HTTP.
19
20homepage                        http://www.htdig.org/
21master_sites            ${homepage}files/
22checksums                       md5 7a2f20d8d6149efd8d119bb2ebf55f23
23patchfiles                      patch-metadate.0 \
24                                          patch-Makefile.0 \
25                                          patch-documentation.1 \
26                                          patch-documentation.2 \
27                                          patch-Date-viewing.0 \
28                                          patch-ExternalParser-max_doc_size.0 \
29                                          patch-htnotifyNull.0 \
30                                          patch-JavaScript.0 \
31                                          patch-CONFIG.in
32
33set doc_path            "${prefix}/share/doc/${name}"
34set conf_path           "${prefix}/etc/${name}"
35set share_path          "${prefix}/share/${name}"
36set db_path                     "${prefix}/var/${name}"
37set cgi_path            ""
38set httpd_doc_path      ""
39set httpd_conf_path ""
40
41destroot.destdir        prefix=${destroot}${prefix}
42variant darwin          { global cgi_path httpd_conf_path httpd_doc_path
43                                        set cgi_path "/Library/WebServer/CGI-Executables"
44                                        set httpd_doc_path "/Library/WebServer/Documents"
45                                        set httpd_conf_path "/private/etc/httpd"
46
47                                        # apache darwinport interop
48                                        if {[ file exists ${prefix}/sbin/httpd]} {
49                                                set cgi_path "${prefix}/www/cgi-bin"
50                                                set httpd_doc_path "${prefix}/www/htdocs"
51                                                set httpd_conf_path "${prefix}/etc/apache"
52                                        }
53                                        configure.args  --with-cgi-bin-dir=${destroot}${cgi_path} }
54
55variant freebsd         { global cgi_path httpd_conf_path httpd_doc_path
56                                        set cgi_path "/usr/local/www/cgi-bin"
57                                        set httpd_doc_path "/usr/local/www/data"
58                                        set httpd_conf_path "/usr/local/etc/apache"
59
60                                        # apache darwinport interop
61                                        if {[ file exists ${prefix}/sbin/httpd]} {
62                                                set cgi_path "${prefix}/www/cgi-bin"
63                                                set httpd_doc_path "${prefix}/www/htdocs"
64                                                set httpd_conf_path "${prefix}/etc/apache"
65                                        }
66                                        configure.args  --with-cgi-bin-dir=${destroot}${cgi_path} }
67
68post-destroot           { # Empty directory hack
69                                        file mkdir ${destroot}${db_path}
70                                        system "touch ${destroot}${db_path}/.turd"
71
72                                        # Install documentation
73                                        file mkdir ${destroot}${doc_path}
74                                        system "cd ${worksrcpath}/htdoc && \
75                                          tar -cf - *.html *.gif *.css | \
76                                          tar -xf - -C ${destroot}${doc_path}"
77                                        system "chown -R `id -u`:`id -g` \
78                                          ${destroot}${doc_path}"
79
80                                        # Create symbolic link in web server doc root
81                                        file mkdir ${destroot}${httpd_doc_path}
82                                        system "cd ${destroot}${httpd_doc_path} && \
83                                          ln -s ${share_path}/search.html"
84       
85                                        # Fix paths in rundig script
86                                        reinplace "s|${destroot}${prefix}|${prefix}|g" \
87                                          "${destroot}${prefix}/bin/rundig"
88
89                                        # Fix paths in htdig config file
90                                        reinplace "s|${destroot}${prefix}|${prefix}|g" \
91                                          "${destroot}${conf_path}/${name}.conf"
92
93                                        # Make copy of htdig config file
94                                        system "install -m 644 ${destroot}${conf_path}/${name}.conf \
95                                          ${destroot}${share_path}/${name}.conf.default"
96
97                                        # Install default htdig apache config file
98                                        file mkdir ${destroot}${httpd_conf_path}
99                                        system "install -m 644 ${portpath}/${filedir}/httpd.conf \
100                                          ${destroot}${httpd_conf_path}/httpd_${name}.conf"
101                                        reinplace "s|DP_PREFIX|${prefix}|g" \
102                                          "${destroot}${httpd_conf_path}/httpd_${name}.conf"
103                                        reinplace "s|NAME|${name}|g" \
104                                          "${destroot}${httpd_conf_path}/httpd_${name}.conf"
105                                        reinplace "s|VERSION|${version}|g" \
106                                          "${destroot}${httpd_conf_path}/httpd_${name}.conf"
107
108                                        # Install contributed scripts
109                                        file mkdir ${destroot}${share_path}/contrib
110                                        system "cd ${worksrcpath}/contrib && \
111                                          tar -cf - * | \
112                                          tar -xf - -C ${destroot}${share_path}/contrib"
113                                        system "chown -R `id -u`:`id -g` \
114                                          ${destroot}${share_path}/contrib" }