# -*- 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 # $Id$ PortSystem 1.0 PortGroup active_variants 1.1 PortGroup perl5 1.0 name backuppc categories sysutils version 3.3.1 revision 4 maintainers nomaintainer license GPL-2+ homepage http://backuppc.sourceforge.net/ description BackupPC is a high-performance, enterprise-grade system for backing up Linux, WinXX and Mac OS X PCs and laptops to a server. long_description ${description} BackupPC is highly configurable and easy to install and maintain. platforms darwin master_sites sourceforge # TODO: # - remove the variants once mod_perl2 switches to 5.24 only perl5.require_variant yes perl5.conflict_variants yes perl5.branches 5.24 perl5.create_variants ${perl5.branches} # TODO: this has to be the same branch as for mod_perl2 perl5.default_branch 5.24 require_active_variants mod_perl2 ${perl5.variant} depends_lib port:bzip2 \ port:gnutar \ port:gzip \ port:mod_perl2 \ port:openssh \ port:p${perl5.major}-archive-zip \ port:p${perl5.major}-compress-raw-zlib \ port:p${perl5.major}-file-rsyncp \ port:par2 \ port:perl${perl5.major} \ port:rsync \ port:samba3 distname BackupPC-${version} checksums rmd160 3db4d6a54c9cde61fa434292b53f18ded73dbb83 \ sha256 c9cc4aec28a7474a68d40f4bc460ff15140e05c96900c7f98ff3ef06c4f6ae4c configure.args --batch \ --backuppc-user=backuppc \ --cgi-dir ${prefix}/var/wwwbackup/cgi-bin \ --data-dir ${prefix}/var/backups \ --dest-dir ${destroot} \ --html-dir ${prefix}/var/wwwbackup/htdocs/backuppc \ --html-dir-url /backuppc \ --install-dir ${prefix} \ --config-dir ${prefix}/etc/BackupPC \ --log-dir ${prefix}/var/log/BackupPC patchfiles patch-docdir.diff \ patch-progs.diff destroot.violate_mtree yes destroot.keepdirs ${destroot}${prefix}/var/backups \ ${destroot}${prefix}/var/backups/cpool \ ${destroot}${prefix}/var/backups/log \ ${destroot}${prefix}/var/backups/trash \ ${destroot}${prefix}/var/backups/pool \ ${destroot}${prefix}/var/backups/pc \ ${destroot}${prefix}/var/backups/ \ ${destroot}${prefix}/var/log/BackupPC \ ${destroot}${prefix}/var/wwwbackup/htdocs\ ${destroot}${prefix}/var/wwwbackup/logs set hostname [exec "hostname"] post-patch { reinplace "s|@@PERL@@|perl${perl5.major}|g" ${worksrcpath}/configure.pl reinplace "s|@@PERL_FULL@@|${perl5.bin}|g" ${worksrcpath}/configure.pl } pre-configure { ui_debug "Hostname: ${hostname}" configure.args-append --hostname ${hostname} } configure { addgroup backuppc set gid [existsgroup backuppc] adduser backuppc gid=${gid} realname=BackupPC } build {} destroot { # destroot for the web skeleton xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup/cgi-bin xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup/conf xinstall -m 600 -g backuppc -o backuppc ${filespath}/httpd.conf ${destroot}${prefix}/var/wwwbackup/conf/ xinstall -m 600 -g backuppc -o backuppc ${filespath}/mime.types ${destroot}${prefix}/var/wwwbackup/conf xinstall -m 600 -g backuppc -o backuppc ${filespath}/magic ${destroot}${prefix}/var/wwwbackup/conf xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup/htdocs xinstall -m 600 -g backuppc -o backuppc ${filespath}/favicon.ico ${destroot}${prefix}/var/wwwbackup/htdocs/ xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/wwwbackup/logs # destroot for backuppc xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/backups xinstall -d -m 770 -g backuppc -o backuppc ${destroot}${prefix}/var/log/BackupPC # create backup directory system -W ${worksrcpath} "${prefix}/bin/perl${perl5.major} configure.pl ${configure.args}" # done with a patch for now: #xinstall -d -m 755 ${destroot}${prefix}/share/doc/ #move ${destroot}${prefix}/doc ${destroot}${prefix}/share/doc/BackupPC # install the launch scripts xinstall -d -m 755 ${destroot}/Library/LaunchDaemons xinstall ${filespath}/net.sourceforge.backuppc.plist \ ${destroot}/Library/LaunchDaemons/ # Install extras xinstall -d -m 755 ${destroot}${prefix}/share/BackupPC/extras xinstall ${filespath}/backuppc_config_template.rb \ ${destroot}${prefix}/share/BackupPC/extras xinstall ${filespath}/backuppc_auth.conf ${destroot}${prefix}/share/BackupPC/extras reinplace "s|@@PREFIX@@|${prefix}|g" ${destroot}${prefix}/share/BackupPC/extras/backuppc_auth.conf xinstall ${filespath}/org.macports.backuppc.apache2.plist \ ${destroot}/Library/LaunchDaemons/ reinplace "s|@@PREFIX@@|${prefix}|g" ${destroot}/Library/LaunchDaemons/org.macports.backuppc.apache2.plist reinplace "s|@@CONFPATH@@|${prefix}/var/wwwbackup/conf/|g" ${destroot}/Library/LaunchDaemons/org.macports.backuppc.apache2.plist reinplace "s|@@PREFIX@@|${prefix}|g" ${destroot}${prefix}/var/wwwbackup/conf/httpd.conf reinplace "s|@@HOSTNAME@@|${hostname}|g" ${destroot}${prefix}/var/wwwbackup/conf/httpd.conf reinplace "s|@@PREFIX@@|${prefix}|g" ${destroot}/Library/LaunchDaemons/net.sourceforge.backuppc.plist } notes "There are several more things you will need to do: - Browse through the config file, ${prefix}/etc/BackupPC/config.pl, and make sure all the settings are correct. In particular, you will need to set \$Conf{CgiAdminUsers} so you have administration privileges in the CGI interface. - Change the \$Conf{} - Edit the list of hosts to backup in ${prefix}/etc/BackupPC/hosts. - Read the documentation in ${prefix}/share/doc/BackupPC/BackupPC.html. Please pay special attention to the security section. - Verify that the CGI script BackupPC_Admin runs correctly. You might need to change the permissions or group ownership of BackupPC_Admin. If this is an upgrade and you are using mod_perl, you will need to restart Apache. Otherwise it will have stale code. - BackupPC should be ready to start. Don't forget to run it as user backuppc! The installation also contains an /Library/LaunchDaemons/net.sourceforge.backuppc.plist launchd so that BackupPC can auto-start on boot. To enable this daemon execute the following command: cd /Library/LaunchDaemons sudo launchctl load net.sourceforge.backuppc.plist - The data directory is set to ${prefix}/var/backups. Please ensure You have enough space for your backups at this location. You may wish to create a custom mount point point for you backup volume if necessary. - To hide the backuppc user in the login window, you may execute defaults write /Library/Preferences/com.apple.loginwindow - Please see the ${prefix}/share/BackupPC/extras directory for client setup scripts, sample apache.conf files, and more. "