Ticket #4187: Portfile.3

File Portfile.3, 4.0 KB (added by dports@…, 19 years ago)

Revised sendpage Portfile

Line 
1# $Id: Portfile,v 1.4 2004/12/03 19:41:51 jberry Exp $
2
3PortSystem      1.0
4
5name                    sendpage
6version                 1.000001
7categories              net
8maintainers             machowtos@mac.com
9platforms               darwin
10
11description             Sendpage sends alphanumeric pages via a modem, receives via SNPP
12
13long_description        An SNPP client, SNPP server, a queuing engine, \
14                        a modem control engine, a TAP communication system, \
15                        and an email notification system.
16
17homepage                http://www.sendpage.org/
18                                       
19master_sites            sourceforge
20checksums               md5 4dc9115ad984408e0400241341341b99
21
22depends_lib             port:p5-net-snpp \
23                        port:p5-device-serialport \
24                        port:p5-mailtools \
25                        port:p5-dbi
26
27use_configure           no
28build {}
29
30# Maintain empty directories
31destroot.keepdirs       ${destroot}${prefix}/var/sendpage \
32                        ${destroot}${prefix}/var/sendpage/lock
33
34variant startup  {
35        depends_run path:/Library/StartupItems/DarwinPortsStartup:DarwinPortsStartup
36}
37
38pre-destroot {
39                adduser sendpage realname=MySQL
40                reinplace "s|Win32|Device|g" ${worksrcpath}/Makefile.PL
41
42                reinplace "s|/etc/sendpage.cf|${prefix}/etc/sendpage/sendpage.cf|g" ${worksrcpath}/sendpage
43                reinplace "s|/var/lock|${prefix}/var/sendpage/lock|g" ${worksrcpath}/sendpage
44
45                reinplace "s|/usr/local/bin|${prefix}/bin|g" ${worksrcpath}/sendpage.init
46                reinplace "s|/etc/sendpage.cf|${prefix}/etc/sendpage/sendpage.cf|g" ${worksrcpath}/sendpage.init
47
48                reinplace "s|/var/spool|${prefix}/var|g" \
49                        ${worksrcpath}/sendpage
50
51                reinplace "s|/etc|${prefix}/etc/sendpage|g" ${worksrcpath}/snpp
52
53                reinplace "s|#pidfileprefix = /tmp/var/spool/sendpage/sendpage| \
54                        pidfileprefix = ${prefix}/var/sendpage/sendpage|g" ${worksrcpath}/sendpage.cf
55
56                reinplace "s|#lockprefix = /tmp/var/lock/LCK..| \
57                        lockprefix = ${prefix}/var/sendpage/lock/LCK..|g" ${worksrcpath}/sendpage.cf
58
59                reinplace "s|#queuedir = /tmp/var/spool/sendpage| \
60                        queuedir = ${prefix}/var/sendpage|g" ${worksrcpath}/sendpage.cf
61}
62
63destroot {
64                system "cd ${worksrcpath} && perl Makefile.PL"
65                system "cd ${worksrcpath} && make"
66                system "cd ${worksrcpath} && make install"
67}
68
69post-destroot {
70
71# Copy sendpage configuration files
72                xinstall -m 755 -d ${destroot}${prefix}/etc/sendpage
73                xinstall -m 755 ${worksrcpath}/sendpage.cf ${destroot}${prefix}/etc/sendpage
74                xinstall -m 755 ${worksrcpath}/email2page.conf ${destroot}${prefix}/etc/sendpage
75                xinstall -m 755 ${worksrcpath}/snpp.conf ${destroot}${prefix}/etc/sendpage
76
77# Copy sendpage documentation & examples
78                xinstall -m 755 -d ${destroot}${prefix}/share/doc/sendpage
79                xinstall -m 755 ${worksrcpath}/README ${destroot}${prefix}/share/doc/sendpage
80                xinstall -m 755 ${worksrcpath}/FEATURES ${destroot}${prefix}/share/doc/sendpage
81                xinstall -m 755 ${worksrcpath}/TODO ${destroot}${prefix}/share/doc/sendpage
82
83                xinstall -m 755 -d ${destroot}${prefix}/share/sendpage/examples
84                eval xinstall -m 755 [glob ${worksrcpath}/examples/*] ${destroot}${prefix}/share/sendpage/examples
85                xinstall -m 755 ${worksrcpath}/${name}.init ${destroot}${prefix}/share/sendpage/examples
86
87# Make the sendpage queue area
88                xinstall -d ${destroot}${prefix}/var/sendpage/lock
89                system "chmod og-rwx ${destroot}${prefix}/var/sendpage"
90                system "chown sendpage ${destroot}${prefix}/var/sendpage"
91                system "chgrp tty ${destroot}${prefix}/var/sendpage"
92
93                system "chown sendpage ${destroot}${prefix}/var/sendpage/lock"
94                system "chgrp uucp ${destroot}${prefix}/var/sendpage/lock"
95
96# Use sendpage startup script & DarwinPortsStartup to startup sendpage at boot
97        if { [variant_isset startup] } {
98               
99                xinstall -o root -m 755 -d ${destroot}${prefix}/etc/rc.d
100                xinstall -o root -m 755 -c ${worksrcpath}/${name}.init ${destroot}${prefix}/etc/rc.d/${name}.sh
101                reinplace "s|/var/spool|${prefix}/var|g" ${destroot}${prefix}/etc/rc.d/${name}.sh
102        }
103}
104
105post-install {
106                ui_msg "\nREADME & docs --> ${prefix}/share/doc/sendpage
107Configuration files --> ${prefix}/etc/sendpage
108Examples  --> ${prefix}/share/sendpage/examples\n"
109}