source: trunk/dports/net/pure-ftpd/Portfile

Last change on this file was 146956, checked in by pixilla@…, 18 months ago

net/pure-ftpd: add mariadb, mysql51, mysql55, mysql56, mysql57 and percona. Update version to 1.0.42. Closes #50883

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 10.0 KB
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# $Id: Portfile 146956 2016-03-22 04:47:48Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                pure-ftpd
7set pretty_name     Pure-FTPd
8version             1.0.42
9
10categories          net
11platforms           darwin
12maintainers         pixilla openmaintainer
13license             BSD
14
15homepage            http://pureftpd.org/
16description         ${pretty_name} is a fast, production-quality, standard-conformant FTP (SSL/TLS) \
17                    server, based upon Troll-FTPd.
18
19long_description    ${pretty_name} has been designed to be secure in default configuration\; it has no\
20                    known vulnerabilities. Features include: virtual domains, built-in 'ls', \
21                    anti-warez system, configurable ports for passive downloads, FXP protocol, \
22                    bandwidth throttling, ratios, LDAP / MySQL / PostgreSQL-based authentication,\
23                    fortune files, Apache-like log files, text / HTML / XML real-time status report,\
24                    virtual users, virtual quotas, privilege separation, SSL/TLS and more.
25
26master_sites        ftp://ftp.pureftpd.org/pure-ftpd/releases/ \
27                    ftp://ftp.fr.pureftpd.org/pure-ftpd/releases/ \
28                    http://download.pureftpd.org/pub/pure-ftpd/releases/
29
30use_bzip2           yes
31
32checksums           rmd160  9e169a59846be32006842f5fb575f98657ffa26f \
33                    sha256  efd11295998453e31dbeef9159624beabbac2643a338134ae8c2ef529aa2ec10
34
35livecheck.type      regex
36livecheck.url       http://download.pureftpd.org/pub/${name}/releases/
37livecheck.regex     ${name}-(\[0-9.\]+)\\.tar
38
39configure.args      --with-everything \
40                    --with-pam \
41                    --with-virtualchroot \
42                    --with-paranoidmsg \
43                    --with-bonjour \
44                    --without-inetd \
45                    --mandir=${prefix}/share/man \
46                    --infodir=${prefix}/share/info \
47                    --sysconfdir=${prefix}/etc/${name}/conf \
48                    --localstatedir=${prefix}/var
49
50destroot.destdir    prefix=${destroot}${prefix} \
51                    mandir=${destroot}${prefix}/share/man
52
53destroot.keepdirs   ${destroot}${prefix}/etc/${name}/ssl \
54                    ${destroot}${prefix}/etc/${name}/conf \
55                    ${destroot}${prefix}/var/log/${name}
56
57post-destroot {
58    file mkdir ${destroot}${prefix}/etc/${name}/ssl
59    file mkdir ${destroot}${prefix}/etc/${name}/conf
60    file mkdir ${destroot}${prefix}/var/log/${name}
61    file mkdir ${destroot}${prefix}/share/doc/${name}
62   
63    # Install the notes and readme files
64    xinstall -m 644 -W ${worksrcpath} \
65        AUTHORS ChangeLog CONTACT COPYING FAQ HISTORY INSTALL NEWS README \
66        pureftpd-ldap.conf pureftpd-mysql.conf pureftpd-pgsql.conf pureftpd.schema \
67        README.Authentication-Modules README.Configuration-File \
68        README README.Authentication-Modules README.Configuration-File README.Contrib \
69        README.Donations README.LDAP README.PGSQL README.TLS \
70        README.MySQL README.Virtual-Users README.MySQL README.PGSQL README.TLS README.Virtual-Users \
71        THANKS \
72        ${destroot}${prefix}/share/doc/${name}
73   
74    # Install in the modified README.MacOS-X file
75    xinstall -m 644 ${filespath}/README.MacOS-X ${destroot}${prefix}/share/doc/${name}/README.MacOS-X
76    reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${prefix}/share/doc/${name}/README.MacOS-X
77   
78    # Copy in the sample launchd plists item
79    file copy ${filespath}/org.pure-ftpd.ftpd.plist.basic.sample.in ${destroot}${prefix}/share/doc/${name}/org.pure-ftpd.ftpd.plist.basic.sample
80    reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${prefix}/share/doc/${name}/org.pure-ftpd.ftpd.plist.basic.sample
81   
82    # Copy in the sample pure-ftpd pam file
83    file copy ${filespath}/pure-ftpd.pam.10.5.sample ${destroot}${prefix}/share/doc/${name}/pure-ftpd.pam.10.5.sample
84    file copy ${filespath}/pure-ftpd.pam.10.6.sample ${destroot}${prefix}/share/doc/${name}/pure-ftpd.pam.10.6.sample
85   
86}
87
88# Variants
89variant uploadscript description "Configures ${name} to support post processing of uploaded files" {
90    configure.args-append --with-uploadscript
91}
92variant mysql5 \
93    conflicts mysql51 mysql55 mysql56 mysql57 mariadb percona \
94    description "Enable MySQL 5.1 support" {
95
96    depends_lib-append          port:mysql5
97    configure.env-append        PATH=${prefix}/lib/mysql5/bin:$env(PATH)
98    configure.args-append       --with-mysql
99}
100
101variant mysql51 \
102    conflicts mysql5 mysql55 mysql56 mysql57 mariadb percona \
103    description "Enable MySQL 5.1 support" {
104
105    depends_lib-append          port:mysql51
106    configure.env-append        PATH=${prefix}/lib/mysql51/bin:$env(PATH)
107    configure.args-append       --with-mysql
108}
109
110variant mysql55 \
111    conflicts mysql5 mysql51 mysql56 mysql57 mariadb percona \
112    description "Enable MySQL 5.5 support" {
113
114    depends_lib-append          port:mysql55
115    configure.env-append        PATH=${prefix}/lib/mysql55/bin:$env(PATH)
116    configure.args-append       --with-mysql
117}
118
119variant mysql56 \
120    conflicts mysql5 mysql51 mysql55 mysql57 mariadb percona \
121    description "Enable MySQL 5.6 support" {
122
123    depends_lib-append          port:mysql56
124    configure.env-append        PATH=${prefix}/lib/mysql56/bin:$env(PATH)
125    configure.args-append       --with-mysql
126}
127
128variant mysql57 \
129    conflicts mysql5 mysql51 mysql55 mysql56 mariadb percona \
130    description "Enable MySQL 5.6 support" {
131
132    depends_lib-append          port:mysql57
133    configure.env-append        PATH=${prefix}/lib/mysql57/bin:$env(PATH)
134    configure.args-append       --with-mysql
135}
136
137variant mariadb \
138    conflicts mysql5 mysql51 mysql55 mysql56 mysql57 percona \
139    description "Enable MariaDB (MySQL) support" {
140
141    depends_lib-append          port:mariadb
142    configure.env-append        PATH=${prefix}/lib/mariadb/bin:$env(PATH)
143    configure.args-append       --with-mysql
144}
145
146variant percona \
147    conflicts mysql5 mysql51 mysql55 mysql56 mysql57 mariadb \
148    description "Enable Percona (MySQL) support" {
149
150    depends_lib-append          port:percona
151    configure.env-append        PATH=${prefix}/lib/percona/bin:$env(PATH)
152    configure.args-append       --with-mysql=yes
153}
154
155variant postgresql82 \
156    conflicts mysql5 postgresql83 postgresql84 \
157    description "Enable PostgreSQL 8.2 support" {
158
159    depends_lib-append port:postgresql82
160    configure.args-append --with-pgsql
161    configure.env-append PATH=${prefix}/lib/postgresql82/bin:$env(PATH)
162}
163
164variant postgresql83 \
165    conflicts mysql5 postgresql82 postgresql84 \
166    description "Enable PostgreSQL 8.3 support" {
167
168    depends_lib-append port:postgresql83
169    configure.args-append --with-pgsql
170    configure.env-append PATH=${prefix}/lib/postgresql83/bin:$env(PATH)
171}
172
173variant postgresql84 \
174    conflicts mysql5 postgresql82 postgresql83 \
175    description "Enable PostgreSQL 8.4 support" {
176
177    depends_lib-append port:postgresql84
178    configure.args-append --with-pgsql
179    configure.env-append PATH=${prefix}/lib/postgresql84/bin:$env(PATH)
180}
181
182variant tls \
183    description "Encryption of ftp control and data channels using SSL/TLS" {
184
185    depends_lib-append      path:lib/libssl.dylib:openssl
186    configure.args-append   --with-tls \
187                            --with-certfile=${prefix}/etc/${name}/ssl/pure-ftpd.pem
188}
189
190# Language variants, should only be able to choose one.
191set variants {
192    lang_brazilian
193    lang_czech
194    lang_danish
195    lang_dutch
196    lang_french
197    lang_french_funny
198    lang_german
199    lang_italian
200    lang_korean
201    lang_norwegian
202    lang_polish
203    lang_romanian
204    lang_russian
205    lang_simplified_chinese
206    lang_slovak
207    lang_spanish
208    lang_swedish
209    lang_trad_chinese
210}
211
212foreach variant_name $variants {
213    # Quick way to remove the working variant from the list
214    set the_conflicts [lsearch -all -inline -not -exact $variants $variant_name]
215    # String replace away the lang_ part, as that is not part of the name used for the compile args
216    set variant_configure_name [string map {"lang_" ""} $variant_name]
217    set variant_line "variant $variant_name conflicts $the_conflicts description \"Use $variant_name for server messages\" {
218        configure.args-append --with-language=$variant_configure_name }"
219    eval $variant_line
220
221}
222
223# Notify the user how to launch the ftpd
224post-activate {
225    ui_msg "========================================================================"
226    ui_msg "${pretty_name} documentation is located in: ${prefix}/share/doc/${name}"
227    ui_msg ""
228   
229    ui_msg "You can start ${pretty_name} from the command line with:"
230    ui_msg "    sudo ${prefix}/sbin/${name} &"
231   
232    ui_msg "A future release of ${pretty_name} will no longer support"
233    ui_msg "xinetd, and has been removed from this version.  If you are using that"
234    ui_msg "method to start ${pretty_name} now, please switch to using launchd(8)."
235    ui_msg ""
236   
237    ui_msg "A sample launchd plist has been created to get you started."
238    ui_msg "    1) org.pure-ftpd.ftpd.plist.basic.sample"
239    ui_msg "        Basic but secure chrooted ftp server"
240    ui_msg ""
241   
242    ui_msg "To install the launchd item, issue the following commands:"
243    ui_msg "cd ${prefix}/share/doc/${name}/"
244    ui_msg "sudo cp org.pure-ftpd.ftpd.plist.basic.sample /Library/LaunchDaemons/org.pure-ftpd.ftpd.plist"
245    ui_msg "  - and then load the launchd item - "
246    ui_msg "sudo launchctl load -w /Library/LaunchDaemons/org.pure-ftpd.ftpd.plist"
247    ui_msg ""
248   
249    ui_msg "If you intend to use pure-FTPd with PAM, meaning you want to authenticate against Mac OS X"
250    ui_msg "user accounts, please copy the pure-ftpd.pam.10.x.sample file to /etc/pam.d/pure-ftpd"
251    ui_msg "cd ${prefix}/share/doc/${name}/"
252    ui_msg "sudo cp pure-ftpd.pam.10.x.sample /etc/pam.d/pure-ftpd"
253   
254    ui_msg "You can now test the server with:"
255    ui_msg "    ftp localhost"
256    ui_msg "You should see a Welcome to ${pretty_name} message."
257    ui_msg ""
258   
259    ui_msg "See ${homepage} for more information."
260    ui_msg "========================================================================"
261}
Note: See TracBrowser for help on using the repository browser.