source: trunk/dports/sysutils/backuppc/Portfile @ 144571

Last change on this file since 144571 was 144571, checked in by devans@…, 4 years ago

backuppc: remove reference to perl 5.16 branch, increment revision.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.5 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 144571 2016-01-13 02:28:48Z devans@macports.org $
3
4PortSystem          1.0
5PortGroup           active_variants 1.1
6PortGroup           perl5 1.0
7
8name                backuppc
9categories          sysutils
10version             3.3.1
11revision            2
12maintainers         nomaintainer
13license             GPL-2+
14homepage            http://backuppc.sourceforge.net/
15
16description         BackupPC is a high-performance, enterprise-grade system for backing up Linux, WinXX and Mac OS X PCs and laptops to a server.
17long_description    ${description} BackupPC is highly configurable and easy to install and maintain.
18
19platforms           darwin
20
21master_sites        sourceforge
22
23# TODO:
24# - remove 5.16 once we upgrade to 5.22 as default
25# - remove the variants once mod_perl2 switches to 5.22 only
26perl5.require_variant   yes
27perl5.conflict_variants yes
28perl5.branches          5.22
29perl5.create_variants   ${perl5.branches}
30# TODO: this has to be the same branch as for mod_perl2
31perl5.default_branch    5.22
32require_active_variants mod_perl2 ${perl5.variant}
33
34depends_lib         port:bzip2 \
35                    port:gnutar \
36                    port:gzip \
37                    port:mod_perl2 \
38                    port:openssh \
39                    port:p${perl5.major}-archive-zip \
40                    port:p${perl5.major}-compress-raw-zlib \
41                    port:p${perl5.major}-file-rsyncp \
42                    port:par2 \
43                    port:perl${perl5.major} \
44                    port:rsync \
45                    port:samba3
46
47distname            BackupPC-${version}
48
49checksums           rmd160  3db4d6a54c9cde61fa434292b53f18ded73dbb83 \
50                    sha256  c9cc4aec28a7474a68d40f4bc460ff15140e05c96900c7f98ff3ef06c4f6ae4c
51
52configure.args      --batch \
53                    --backuppc-user=backuppc \
54                    --cgi-dir ${prefix}/var/wwwbackup/cgi-bin \
55                    --data-dir ${prefix}/var/backups \
56                    --dest-dir ${destroot} \
57                    --html-dir ${prefix}/var/wwwbackup/htdocs/backuppc \
58                    --html-dir-url /backuppc \
59                    --install-dir ${prefix}  \
60                    --config-dir ${prefix}/etc/BackupPC \
61                    --log-dir ${prefix}/var/log/BackupPC
62
63patchfiles          patch-docdir.diff \
64                    patch-progs.diff
65
66destroot.violate_mtree  yes
67
68destroot.keepdirs   ${destroot}${prefix}/var/backups \
69                    ${destroot}${prefix}/var/backups/cpool \
70                    ${destroot}${prefix}/var/backups/log \
71                    ${destroot}${prefix}/var/backups/trash \
72                    ${destroot}${prefix}/var/backups/pool \
73                    ${destroot}${prefix}/var/backups/pc \
74                    ${destroot}${prefix}/var/backups/ \
75                    ${destroot}${prefix}/var/log/BackupPC \
76                    ${destroot}${prefix}/var/wwwbackup/htdocs\
77                    ${destroot}${prefix}/var/wwwbackup/logs
78
79set hostname [exec "hostname"]
80
81pre-configure {
82    ui_debug  "Hostname: ${hostname}"
83    configure.args-append --hostname ${hostname}
84}
85
86configure {
87    addgroup backuppc
88    set gid [existsgroup backuppc]
89    adduser backuppc gid=${gid} realname=BackupPC
90}
91
92build {}
93
94destroot {
95    # destroot for the web skeleton
96    xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup
97    xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup/cgi-bin
98    xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup/conf
99    xinstall -m 600 -g backuppc -o backuppc ${filespath}/httpd.conf ${destroot}${prefix}/var/wwwbackup/conf/
100
101    xinstall -m 600 -g backuppc -o backuppc ${filespath}/mime.types ${destroot}${prefix}/var/wwwbackup/conf
102    xinstall -m 600 -g backuppc -o backuppc ${filespath}/magic ${destroot}${prefix}/var/wwwbackup/conf
103
104    xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup/htdocs
105    xinstall -m 600 -g backuppc -o backuppc ${filespath}/favicon.ico ${destroot}${prefix}/var/wwwbackup/htdocs/
106
107    xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup/logs
108
109    # destroot for backuppc
110    xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/backups
111    xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/log/BackupPC
112
113    # create backup directory
114    system -W ${worksrcpath} "${prefix}/bin/perl${perl5.major} configure.pl ${configure.args}"
115    # done with a patch for now:
116    #xinstall -d -m 755 ${destroot}${prefix}/share/doc/
117    #move ${destroot}${prefix}/doc ${destroot}${prefix}/share/doc/BackupPC
118
119    # install the launch scripts
120    xinstall -d -m 755 ${destroot}/Library/LaunchDaemons
121
122    xinstall ${filespath}/net.sourceforge.backuppc.plist \
123            ${destroot}/Library/LaunchDaemons/
124
125    # Install extras
126    xinstall -d -m 755 ${destroot}${prefix}/share/BackupPC/extras
127    xinstall ${filespath}/backuppc_config_template.rb \
128            ${destroot}${prefix}/share/BackupPC/extras
129    xinstall ${filespath}/backuppc_auth.conf ${destroot}${prefix}/share/BackupPC/extras
130    reinplace "s|@@PREFIX@@|${prefix}|g" ${destroot}${prefix}/share/BackupPC/extras/backuppc_auth.conf
131
132    xinstall ${filespath}/org.macports.backuppc.apache2.plist \
133            ${destroot}/Library/LaunchDaemons/
134    reinplace "s|@@PREFIX@@|${prefix}|g" ${destroot}/Library/LaunchDaemons/org.macports.backuppc.apache2.plist
135    reinplace "s|@@CONFPATH@@|${prefix}/var/wwwbackup/conf/|g" ${destroot}/Library/LaunchDaemons/org.macports.backuppc.apache2.plist
136    reinplace "s|@@PREFIX@@|${prefix}|g" ${destroot}${prefix}/var/wwwbackup/conf/httpd.conf
137    reinplace "s|@@HOSTNAME@@|${hostname}|g" ${destroot}${prefix}/var/wwwbackup/conf/httpd.conf
138    reinplace "s|@@PREFIX@@|${prefix}|g" ${destroot}/Library/LaunchDaemons/net.sourceforge.backuppc.plist
139}
140
141notes "There are several more things you will need to do:
142
143    - Browse through the config file, ${prefix}/etc/BackupPC/config.pl,
144      and make sure all the settings are correct.  In particular,
145      you will need to set \$Conf{CgiAdminUsers} so you have
146      administration privileges in the CGI interface.
147
148    - Change the \$Conf{}
149
150    - Edit the list of hosts to backup in ${prefix}/etc/BackupPC/hosts.
151
152    - Read the documentation in ${prefix}/share/doc/BackupPC/BackupPC.html.
153      Please pay special attention to the security section.
154
155    - Verify that the CGI script BackupPC_Admin runs correctly.  You might
156      need to change the permissions or group ownership of BackupPC_Admin.
157      If this is an upgrade and you are using mod_perl, you will need
158      to restart Apache.  Otherwise it will have stale code.
159
160    - BackupPC should be ready to start.  Don't forget to run it
161      as user backuppc!  The installation also contains an
162      /Library/LaunchDaemons/net.sourceforge.backuppc.plist launchd
163      so that BackupPC can auto-start on boot. To enable this daemon
164      execute the following command:
165      cd /Library/LaunchDaemons
166      sudo launchctl load net.sourceforge.backuppc.plist
167
168    - The data directory is set to ${prefix}/var/backups. Please ensure
169      You have enough space for your backups at this location. You may
170      wish to create a custom mount point point for you backup volume
171      if necessary.
172
173    - To hide the backuppc user in the login window, you may execute
174
175      defaults write /Library/Preferences/com.apple.loginwindow
176
177    - Please see the ${prefix}/share/BackupPC/extras directory for client
178      setup scripts, sample apache.conf files, and more.
179    "
Note: See TracBrowser for help on using the repository browser.