Ticket #57919: Portfile.3

File Portfile.3, 2.5 KB (added by iEFdev, 6 years ago)
Line 
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
3PortSystem          1.0
4PortGroup           github 1.0
5
6github.setup        maxmind mod_maxminddb 1.1.0
7revision            0
8checksums           rmd160  bab39c27d8aba3e6a6cb8f010ebdab3ef23575da \
9                    sha256  b31e63764ddcc1379229059a4726c733ee0538018727b1336d02afaaa8940782 \
10                    size    99821
11
12categories          www
13platforms           darwin
14maintainers         nomaintainer
15license             Apache-2
16
17description         This module allows you to query MaxMind DB files from Apache 2.2+ \
18                    using the libmaxminddb library.
19
20long_description    ${description}
21
22homepage            https://maxmind.github.io/mod_maxminddb/
23github.tarball_from releases
24
25depends_lib         port:apache2 \
26                    port:libmaxminddb
27
28set apxs            ${prefix}/bin/apxs
29set ddir            ${prefix}/share/doc/${name}
30set dbdir           ${prefix}/share/GeoIP
31set mdir            ${prefix}/lib/apache2/modules
32
33patchfiles          patch-Wl.diff
34
35configure.args      --with-apxs=${apxs} \
36                    --disable-dependency-tracking
37
38test.run            yes
39test.target         check
40
41destroot {
42    xinstall -d -m 0755 ${destroot}${mdir} ${destroot}${ddir}
43    xinstall -m 0644 -W ${worksrcpath} Changes.md CONTRIBUTING.md \
44        LICENSE README.md TESTING.md ${destroot}${ddir}
45    xinstall -m 0755 ${worksrcpath}/src/.libs/${name}.so ${destroot}${mdir}
46}
47
48post-destroot {
49    xinstall -d -m 0755 ${destroot}${dbdir}
50    set plist [open "${destroot}${dbdir}/ReadMe_DBFiles.md" w 0644]
51    puts ${plist} "## MaxMindDB Files"
52    puts ${plist} ""
53    puts ${plist} "The database files can be downloaded from here:"
54    puts ${plist} ""
55    puts ${plist} "  - <https://dev.maxmind.com/geoip/geoip2/geolite2/#Downloads>"
56    puts ${plist} ""
57    puts ${plist} "There are 2 versions, and a MD5 checksum file of each."
58    puts ${plist} ""
59    close ${plist}
60}
61
62notes "
63If this your first install, you might want to enable ${name} in Apache:
64
65    cd ${mdir}
66    sudo ${apxs} -a -e -n \"maxminddb\" mod_maxminddb.so
67
68And then relaunch Apache:
69
70    $ sudo apachectl restart
71
72- - -
73
74Examples/setup: ${ddir}/README.md
75                https://github.com/maxmind/mod_maxminddb#examples
76
77Database files: https://dev.maxmind.com/geoip/geoip2/geolite2/#Downloads
78Put them in:    ${dbdir}
79
80    MaxMindDBEnable On
81    MaxMindDBFile COUNTRY_DB ${dbdir}/GeoLite2-Country.mmdb
82    MaxMindDBFile CITY_DB    ${dbdir}/GeoLite2-City.mmdb
83"