public
Description: Git mirror of the MacPorts svn repo
Homepage: http://www.macports.org
Clone URL: git://github.com/kballard/macports.git
Takanori Yamamoto (author)
Thu May 15 08:18:19 -0700 2008
commit  258a28287f06079576debac5da7cf2ca0fb157a7
tree    99f253ba680219fe889a251d1cbe18648777de45
parent  09ae89f631f953b08ad5cbd75c4572c0c198526e
macports / dports / games / jnethack / Portfile
100644 124 lines (97 sloc) 3.446 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# $Id$
 
PortSystem 1.0
 
name jnethack
version 3.4.3-0.10
categories games japanese
maintainers rutiler.net:kyut takanori
description Classic dungeon adventure game, translated in Japanese.
long_description \
                ${description}
platforms darwin
homepage http://jnethack.sourceforge.jp/
master_sites sourceforge_jp:${name}/9091/:nh \
                sourceforge_jp:${name}/30862/:jnh
set nethacksrc "nethack-343-src.tgz"
set jnethackpatch "${name}-${version}.diff.gz"
distfiles ${nethacksrc}:nh \
                ${jnethackpatch}:jnh
patchfiles patch-sys_unix_Makefile.doc.diff \
                patch-sys_unix_Makefile.src.diff \
                patch-sys_unix_Makefile.top.diff \
                patch-sys_unix_Makefile.utl.diff \
                patch-sys_unix_nethack.sh.diff \
                patch-win_tty_termcap.c.diff \
                patch-src_options.c.diff
checksums ${nethacksrc} sha1 c26537093c38152bc0fbcec20468d975b35f59fd \
                ${jnethackpatch} sha1 68c6f118d7cef4776a9283b37f15c5c3a60873e8
 
depends_build port:bison \
                port:flex \
                port:ncurses
depends_run port:cocot
 
## extract ##
 
extract.only ${nethacksrc}
worksrcdir nethack-3.4.3
post-extract {
    system "cd ${worksrcpath} && gunzip -dc ${distpath}/${jnethackpatch} | patch -p 1"
}
 
## patch ##
 
pre-patch {
    if {[variant_isset x11]} {
        patchfiles-append x11/patch-include_config.h.diff \
                          x11/patch-sys_unix_Makefile.top.diff \
                          x11/patch-sys_unix_Makefile.src.diff \
                          x11/patch-win_X11_JNetHack.ad.diff
    }
}
 
## configure ##
 
pre-configure {
    set jn_cflags "${configure.cflags} ${configure.cppflags}"
    set jn_ldflags ${configure.ldflags}
 
    if {[variant_isset universal]} {
        set jn_cflags "${jn_cflags} ${configure.universal_cflags}"
    }
 
    if {[variant_isset x11]} {
        set jn_cflags "${jn_cflags} -I${x11prefix}/include"
        set jn_ldflags "${jn_ldflags} -L${x11prefix}/lib"
    }
 
    foreach f {sys/unix/Makefile.doc
               sys/unix/Makefile.src
               sys/unix/Makefile.top
               sys/unix/Makefile.utl
               sys/unix/nethack.sh} {
        reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/${f}
        reinplace "s|__CFLAGS__|${jn_cflags}|" ${worksrcpath}/${f}
        reinplace "s|__LDFLAGS__|${jn_ldflags}|" ${worksrcpath}/${f}
    }
}
 
configure.dir ${worksrcpath}/sys/unix
configure.cmd /bin/sh
configure.pre_args setup.sh
 
## build ##
 
use_parallel_build no
 
## destroot ##
 
pre-destroot {
    addgroup games
    adduser games gid=[existsgroup games]
 
    xinstall -m 755 -d "${destroot}${prefix}/share/man/man6"
    xinstall -m 755 -d "${destroot}${prefix}/share/jnethackdir/save"
}
 
destroot.target install manpages
destroot.keepdirs "${destroot}${prefix}/share/jnethackdir/save/"
 
post-destroot {
    reinplace "s|${destroot}||" "${destroot}${prefix}/bin/jnethack"
    if {[variant_isset x11]} {
        copy ${worksrcpath}/win/X11/JNetHack.ad ${destroot}${prefix}/share/jnethackdir/
    }
}
 
## install ##
 
pre-install {
    addgroup games
    adduser games gid=[existsgroup games]
}
 
## variants ##
 
variant x11 {}
 
variant universal {}
 
livecheck.check regex
livecheck.url ${homepage}
livecheck.regex <li>\\(\[0-9/\]+\\) (\[0-9.-\]+)