Ticket #450: Portfile

File Portfile, 2.8 KB (added by blb@…, 21 years ago)

Portfile

Line 
1# $Id: $
2PortSystem                      1.0
3name                            analog
4version                         5.32
5categories                      www
6maintainers                     blb@pobox.com
7description                     A program which analyses logfiles from WWW servers
8
9long_description        \
10It is designed to be fast and to produce accurate and attractive statistics: \
11and combined with Report Magic, you can generate even prettier reports. \
12It's free software.
13
14homepage                        http://www.analog.cx/
15master_sites            http://www.analog.cx/ \
16                                        http://analog.linuxhelp.ca/ \
17                                        http://www.rge.com/pub/infosystems/statistics/analog/ \
18                                        http://sunsite.cnlab-switch.ch/www/mirror/analog/
19
20platforms                       darwin
21checksums                       md5 077a2d43c8f5c2bddf37129ca63ec1f8
22
23# Note, it'd be nice to use an already-installed version of jpeg and libpng
24# as well, but analog currently doesn't have a HAVE_ define for them, just
25# zlib (as well as gd, which should be here too if possible)
26depends_lib                     lib:libz.1:zlib
27
28use_configure           no
29
30set shareanalog         ${prefix}/share/analog
31# Note, we can also set these *DIR variables with the build.args, but
32# quoting gets really, really ugly (seven-backslashes-ugly)
33post-patch                      {
34        reinplace "s|#define IMAGEDIR \"images/\"|#define IMAGEDIR \"${shareanalog}/images/\"|" "${worksrcpath}/src/anlghead.h"
35        reinplace "s|#define LANGDIR NULL|#define LANGDIR \"${shareanalog}/lang/\"|" "${worksrcpath}/src/anlghead.h"
36        reinplace "s|#define CONFIGDIR NULL|#define CONFIGDIR \"\"|" "${worksrcpath}/src/anlghead.h"
37        reinplace "s|#define LOGSDIR NULL|#define LOGSDIR \"\"|" "${worksrcpath}/src/anlghead.h"
38        reinplace "s|#define CACHEDIR NULL|#define CACHEDIR \"\"|" "${worksrcpath}/src/anlghead.h"
39        reinplace "s|#define OUTDIR NULL|#define OUTDIR \"\"|" "${worksrcpath}/src/anlghead.h"
40        reinplace "s|#define HEADERDIR NULL|#define HEADERDIR \"\"|" "${worksrcpath}/src/anlghead.h"
41        reinplace "s|#define DNSDIR NULL|#define DNSDIR \"\"|" "${worksrcpath}/src/anlghead.h"
42        reinplace "s|#define LOCKDIR NULL|#define LOCKDIR \"\"|" "${worksrcpath}/src/anlghead.h"
43        reinplace "s|#define ERRDIR NULL|#define ERRDIR \"\"|" "${worksrcpath}/src/anlghead.h"
44}
45
46build.args                      DEFS="-DHAVE_ZLIB" LIBS="-lz" OS="OSX"
47build.target            analog
48build.cmd                       cd ${worksrcpath}/src && make
49
50pre-destroot            {
51        system "mkdir -p \"${destroot}/${prefix}/bin\""
52        system "mkdir -p \"${destroot}/${prefix}/share/doc/analog\""
53        system "mkdir -p \"${destroot}/${prefix}/share/man/man1\""
54        system "mkdir -p \"${destroot}/${shareanalog}\""
55}
56
57destroot                        {
58        system "cd \"${worksrcpath}\" && \
59                tar cf - examples how-to images lang | \
60            tar xf - -C \"${destroot}/${shareanalog}\""
61        system "cd \"${worksrcpath}/docs\" && \
62                tar cf - . | \
63                tar xf - -C \"${destroot}/${prefix}/share/doc/analog\""
64        system "install -m 644 \"${worksrcpath}/analog.man\" \"${destroot}/${prefix}/share/man/man1/analog.1\""
65        system "install -m 755 \"${worksrcpath}/analog\" \"${destroot}/${prefix}/bin\""
66}
67