Port review of pure-ftpd
Ryan Schmidt
ryandesign at macports.org
Tue Oct 27 01:03:14 PDT 2009
On Oct 27, 2009, at 01:19, Scott Haneda wrote:
> I ran into an issue with a new configure arg that the devloper
> added, aside from that, things are going well, and wanted a review
> of my work if anyone has time.
>
> Is there any way, or any desire, to pretty up the long description?
> for example, the below, I would rather it be:
>
> foo has the following features:
> 1) anti-warez system
> 2) throttling
> 3) ratios
>
> I suspect you get the idea. I have a hard time getting it to all
> line up. Is this not even something that the I should be caring
> about?
I am not aware of any way to insert newlines into the long
description, or any other way for it to be anything other than a
single long block of text.
> use_bzip2 yes
> That was there before I took this portfile over, there is a tgz
> file, if I just remove that line, would I default to the tgz?
Yes, the default extract settings assume the extension is ".tar.gz"
and that the file should be treated as a gzipped tarball. Since there
continues to be a bzip2 distfile available for pureftpd, though, you
should prefer that to the tar.gz version, since the bzip2 is smaller.
> distname pure-ftpd-${version}
> Do I need distname at all in this portfile?
The default is ${name}-${version}, so I don't think so.
> My second livecheck, how did I do?
You cannot use the variable ${version} in the livecheck.regex,
otherwise the regex will only match the current version of the port,
and will never inform you of newer versions.
You want my standard livecheck.regex, which is ${name}-(\[0-9.\]+)\\.tar
> I am copying in a sample plist in the post-destroot, any comments on
> this?
Looks ok.
> All the ui_msg in the port-install, is that the right place?
You might want the instructions to be post-activate.
> The software only allows one language to be compiled in, but I
> suspect that MP would allow as many + variants as were listed, is
> there a way to solve this?
MacPorts has been a bit English-centric so far. In my minivmac
portfile, I didn't even attempt to offer options to compile for
different languages. I could have offered variants, but nobody has
requested it so far, so I haven't worried about it.
> Is there any way to order the variants as shown by `port info`, and
> if not, is it a bad idea to prefix the language variants with a "z"
> so they do not get in the way of letting people know there is myqsl
> and tls available for this?
The variants used to be listed in the order specified in the portfile.
MacPorts 1.8.0 changed this to alphabetical order. I would not
recommend using a "z" prefix or anything like that. Prefixing them
with "lang_" like you've done is what I would do.
As your comment says, you still need to make them conflict with one
another. You could construct the variants dynamically, like the swig
port does. The below seems to work. Unfortunately it makes the output
of "port variants" rather hard to read.
# Language name Configure arg
set languages {
{Brazilian} brazilian
{Czech} czech
{Danish} danish
{Dutch} dutch
{French} french
{funny French} french-funny
{German} german
{Italian} italian
{Korean} korean
{Norwegian} norwegian
{Polish} polish
{Romanian} romanian
{Russian} russian
{simplified Chinese} simplified-chinese
{Slovak} slovak
{Spanish} spanish
{Swedish} swedish
{traditional Chinese} traditional-chinese
}
# Add langugage variants
foreach {language arg} ${languages} {
set variant lang_[strsed ${arg} {g/-/_/}]
set conflicts {}
foreach {ignore conflicting_arg} ${languages} {
if {${conflicting_arg} != ${arg}} {
set conflicting_variant lang_[strsed ${conflicting_arg}
{g/-/_/}]
lappend conflicts ${conflicting_variant}
}
}
eval [subst {
variant ${variant} conflicts ${conflicts} description "Use $
{language} language for server messages" {
configure.args-append --with-language=${arg}
}
}]
}
> I guess I can remove the readme debian and windows files.
Please. :)
> Thanks for any suggestions.
>
> # $Id$
>
> PortSystem 1.0
>
> name pure-ftpd
> version 1.0.24
> categories net
> platforms darwin
> maintainers hostwizard.com:scott
> license BSD
>
> homepage http://pureftpd.org/
> description Pure-FTPd is a fast, production-quality,
> standard-conformant FTP (SSL/TLS)
Missing backslash at end of the above line.
> server, based upon Troll-FTPd.
>
> long_description ${name} has been designed to be secure in
> default configuration, it has no\
> known vulnerabilities. Features Include: virtual
> domains, built-in 'ls', \
> anti-warez system, configurable ports for passive
> downloads, FXP protocol, \
> bandwidth throttling, ratios, LDAP / MySQL /
> PostgreSQL-based authentication,\
> fortune files, Apache-like log files, text /
> HTML / XML real-time status report,\
> virtual users, virtual quotas, privilege
> separation, SSL/TLS and more.
>
> master_sites ftp://ftp.pureftpd.org/pure-ftpd/releases/ \
> ftp://ftp.fr.pureftpd.org/pure-ftpd/releases/
>
> distname pure-ftpd-${version}
> use_bzip2 yes
>
> checksums md5 2f0869166ddb3a9cbe5e4887eae6e74d \
> sha1 bf8d04d19a83d2bec214eaa38095a070d549d978 \
> rmd160 a320048289f22161c370e12a9253f314877903ba
>
> livecheck.type regex
> livecheck.url http://download.pureftpd.org/pub/${name}/releases/
> livecheck.regex ${name}-(${version})${extract.suffix}
>
> configure.args --with-cookie \
> --with-everything \
> --with-virtualchroot \
> --with-paranoidmsg \
> --without-inetd \
> --without-capabilities \
> --mandir=${prefix}/share/man \
> --infodir=${prefix}/share/info \
> --with-localstatedir=${prefix}
>
> destroot.destdir prefix=${destroot}${prefix} \
> mandir=${destroot}${prefix}/share/man
>
> post-destroot {
> file mkdir ${prefix}/etc/${name}/ssl
> file mkdir ${prefix}/etc/${name}/mysql
> file mkdir ${prefix}/var/log/${name}
> file mkdir ${destroot}${prefix}/share/doc/${name}
>
> # Install the notes and readme files
> xinstall -m 644 -v -W ${worksrcpath} \
> AUTHORS ChangeLog CONTACT COPYING FAQ HISTORY INSTALL NEWS
> README \
> README.Authentication-Modules README.Windows
> README.Configuration-File \
> README.Contrib README.Debian README.Donations README.LDAP
> README.MacOS-X \
> README.MySQL README.PGSQL README.TLS README.Virtual-Users THANKS \
> ${destroot}${prefix}/share/doc/${name}
>
> # Copy in the sample launchd plist item
> file copy ${filespath}/org.pure-ftpd.ftpd.plist.sample $
> {destroot}${prefix}/share/doc/${name}/org.pure-ftpd.ftpd.plist.sample
> }
>
> # Notify the user how to launch the ftpd
> post-install {
> ui_msg ""
> ui_msg "PureFTPd documentation is located in: ${prefix}/share/
> doc/${name}"
> ui_msg ""
> ui_msg "You can start PureFTPd from the command line with:"
> ui_msg " sudo ${prefix}/sbin/${name} &"
> ui_msg ""
> ui_msg "The next release of PureFTPd (1.0.25) will no longer
> support"
> ui_msg "xinetd, and has been removed from this version. If you"
> ui_msg "are using that method to start PureFTPd now, please
> switch"
> ui_msg "to using launcd(8)."
> ui_msg ""
> ui_msg "A sample launchd plist has been made to get your started,"
> ui_msg "to enable it, issue the following commands:"
> ui_msg " sudo cp ${prefix}/share/doc/${name}/org.pure-
> ftpd.ftpd.plist.sample /Library/LaunchDaemons/org.pure-
> ftpd.ftpd.plist"
> ui_msg " sudo launchctl load -w /Library/LaunchDaemons/
> org.pure-ftpd.ftpd.plist"
> }
>
> variant mysql5 description "Use native MySQL support for privelages
> database." {
> depends_lib-append path:bin/mysql_config5:mysql5
> configure.args-append --with-mysql
> configure.cflags-append "-I${prefix}/include/mysql5/mysql"
> configure.ldflags-append "-L${prefix}/lib/mysql5/mysql"
> }
>
> variant tls description "Encryption of the control channel using SSL/
> TLS" {
> depends_lib lib:libssl.dylib:openssl
> configure.args-append --with-tls \
> --with-certfile=${prefix}/etc/${name}/
> ssl/pure-ftpd.pem
> }
>
> # Langugage variants, should only be able to choose one.
> variant lang_brazilian description "Use Bazilian language for
> server messages" { configure.args-append --with-language=brazilian }
> variant lang_czech description "Use Czech language for
> server messages" { configure.args-append --with-language=czech }
> variant lang_danish description "Use Danish language for
> server messages" { configure.args-append --with-language=danish }
> variant lang_dutch description "Use Dutch language for
> server messages" { configure.args-append --with-language=dutch }
> variant lang_french description "Use French language for
> server messages" { configure.args-append --with-language=french }
> variant lang_french_funny description "Use French funny language
> for server messages" { configure.args-append --with-language=french-
> funny }
> variant lang_german description "Use German language for
> server messages" { configure.args-append --with-language=german }
> variant lang_italian description "Use Italian language for
> server messages" { configure.args-append --with-language=italian }
> variant lang_korean description "Use Korean language for
> server messages" { configure.args-append --with-language=korean }
> variant lang_norwegian description "Use Norwegian language
> for server messages" { configure.args-append --with-
> language=norwegian }
> variant lang_polish description "Use Polish language for
> server messages" { configure.args-append --with-language=polish }
> variant lang_romanian description "Use Romanian language for
> server messages" { configure.args-append --with-language=romanian }
> variant lang_russian description "Use Russian language for
> server messages" { configure.args-append --with-language=russian }
> variant lang_simpple_chinese description "Use simplified Chinese
> for server messages" { configure.args-append --with-
> language=simplified-chinese }
> variant lang_slovak description "Use Slovak language for
> server messages" { configure.args-append --with-language=slovak }
> variant lang_spanish description "Use Spanish language for
> server messages" { configure.args-append --with-language=spanish }
> variant lang_swedish description "Use Swedish language for
> server messages" { configure.args-append --with-language=swedish }
> variant lang_trad_chinese description "Use traditional Chinese
> language for server messages" { configure.args-append --with-
> language=traditional-chinese }
Some typos:
privelages should be privileges
Langugage should be Language
Bazilian should be Brazilian
simpple_chinese should be simplified_chinese
More information about the macports-dev
mailing list