Ticket #19745: Portfile

File Portfile, 2.8 KB (added by fracai, 15 years ago)

GNU netcat Portfile

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id$
3
4PortSystem      1.0
5
6name            gnetcat
7set my_name     netcat
8version         0.7.1
9homepage        http://netcat.sourceforge.net/
10description     A rewrite of the well-known networking tool, but more portable, with new features and fully GNU compliant.
11long_description \
12    Netcat is a featured networking utility which reads and writes data \
13    across network connections, using the TCP/IP protocol.  It is designed to \
14    be a reliable "back-end" tool that can be used directly or easily driven \
15    by other programs and scripts. At the same time, it is a feature-rich \
16    network debugging and exploration tool, since it can create almost any \
17    kind of connection you would need and has several interesting built-in \
18    capabilities.
19
20categories      net
21platforms       darwin
22maintainers     arno+macports@alum.wpi.edu
23master_sites    sourceforge:${my_name}
24distname        ${my_name}-${version}
25
26checksums \
27    md5 088def25efe04dcdd1f8369d8926ab34 \
28        sha1 b5cbc52a7ceed2fd5c4f5081f5747130b2d0fe01 \
29        rmd160 9eabed2b4b5585a55062b4a82c8c6aee1b01e3b7
30
31depends_lib     \
32        port:gettext \
33        port:getopt \
34        port:libiconv
35
36configure.args \
37    --program-prefix=g \
38    --infodir=${prefix}/share/info \
39    --mandir=${prefix}/share/man
40
41use_parallel_build  yes
42
43set docdir  ${prefix}/share/doc/${my_name}-${version}
44
45test.run    yes
46test.target check
47
48variant with_default_names description {Install files without 'g' prefix} {
49    configure.args-delete --program-prefix=g
50}
51
52post-configure {
53    # prefix the shortname
54    if { ! [variant_isset with_default_names] } {
55        reinplace "s|netcat_nc = \$(DESTDIR)\$(bindir)/nc|netcat_nc = \$(DESTDIR)\$(bindir)/gnc|" ${worksrcpath}/src/Makefile
56        reinplace "s|ln -s netcat \$(netcat_nc);|ln -s gnetcat \$(netcat_nc);|" ${worksrcpath}/src/Makefile
57    }
58}
59
60post-destroot {
61    if { ! [variant_isset with_default_names] } {
62        # prefix the info files
63        foreach {f} [glob -tails -directory ${destroot}${prefix}/share/info *.info] {
64            move ${destroot}${prefix}/share/info/${f} ${destroot}${prefix}/share/info/g${f}
65        }
66        # prefix the locale files
67        foreach {d} [glob -tails -directory ${destroot}${prefix}/share/locale */] {
68            foreach {f} [glob -tails -directory ${destroot}${prefix}/share/locale/${d}/LC_MESSAGES *.mo] {
69                move ${destroot}${prefix}/share/locale/${d}/LC_MESSAGES/${f} ${destroot}${prefix}/share/locale/${d}/LC_MESSAGES/g${f}
70            }
71        }
72    }
73   
74    # create and copy the port docs
75    xinstall -d ${destroot}${docdir}
76    xinstall -m 0644 -W ${worksrcpath} ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS README TODO \
77        ${destroot}${docdir}
78}