source: trunk/dports/sysutils/backuppc/Portfile

Last change on this file was 154375, checked in by mojca@…, 9 months ago

backuppc: remove the perl5.22 variant (#52081) and fix paths to perl

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