Opened 17 years ago

Closed 15 years ago

Last modified 15 years ago

#12756 closed submission (wontfix)

new port submission: amanda

Reported by: lists@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 1.5.0
Keywords: Cc: lists@…, ryandesign (Ryan Carsten Schmidt)
Port:

Description

Here is my initial submission of porting Amanda (www.amanda.org) to MacPorts. I welcome any comments as this is my first port to MacPorts and there are probably things I am doing in a non-conformant way.

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#       amanda
#       amanda/files
#       amanda/files/amandad-xinetd.in
#       amanda/files/org.amanda.amandad.bsdtcp.plist.in
#       amanda/files/org.amanda.amandad.bsdudp.plist.in
#       amanda/Portfile
#
echo c - amanda
mkdir -p amanda > /dev/null 2>&1
echo c - amanda/files
mkdir -p amanda/files > /dev/null 2>&1
echo x - amanda/files/amandad-xinetd.in
sed 's/^X//' >amanda/files/amandad-xinetd.in << 'END-of-amanda/files/amandad-xinetd.in'
Xservice amanda
X{
X        socket_type             = dgram
X        protocol                = udp
X        wait                    = yes
X        user                    = __USER__
X        server                  = __PREFIX__/libexec/amandad
X        server_args             = amandad
X        groups                  = yes
X        disable                 = no
X}
END-of-amanda/files/amandad-xinetd.in
echo x - amanda/files/org.amanda.amandad.bsdtcp.plist.in
sed 's/^X//' >amanda/files/org.amanda.amandad.bsdtcp.plist.in << 'END-of-amanda/files/org.amanda.amandad.bsdtcp.plist
.in'
X<?xml version="1.0" encoding="UTF-8"?>
X<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
X<plist version="1.0">
X<dict>
X       <key>Label</key>
X       <string>org.amanda.amandad.bsdtcp</string>
X       <key>UserName</key>
X       <string>__USER__</string>
X       <key>GroupName</key>
X       <string>wheel</string>
X       <key>InitGroups</key>
X       <true/>
X       <key>ProgramArguments</key>
X       <array>
X               <string>__PREFIX__/libexec/amandad</string>
X               <string>-auth=bsdtcp</string>
X       </array>
X       <key>Sockets</key>
X       <dict>
X               <key>ipv4</key>
X               <dict>
X                       <key>SockFamily</key>
X                       <string>IPv4</string>
X                       <key>SockServiceName</key>
X                       <string>amanda</string>
X                       <key>SockType</key>
X                       <string>stream</string>
X               </dict>
X               <key>ipv6</key>
X               <dict>
X                       <key>SockFamily</key>
X                       <string>IPv6</string>
X                       <key>SockServiceName</key>
X                       <string>amanda</string>
X                       <key>SockType</key>
X                       <string>stream</string>
X               </dict>
X       </dict>
X       <key>inetdCompatibility</key>
X       <dict>
X               <key>Wait</key>
X               <false/>
X       </dict>
X</dict>
X</plist>
END-of-amanda/files/org.amanda.amandad.bsdtcp.plist.in
echo x - amanda/files/org.amanda.amandad.bsdudp.plist.in
sed 's/^X//' >amanda/files/org.amanda.amandad.bsdudp.plist.in << 'END-of-amanda/files/org.amanda.amandad.bsdudp.plist
.in'
X<?xml version="1.0" encoding="UTF-8"?>
X<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
X<plist version="1.0">
X<dict>
X       <key>GroupName</key>
X       <string>wheel</string>
X       <key>InitGroups</key>
X       <true/>
X       <key>Label</key>
X       <string>org.amanda.amandad.bsdudp</string>
X       <key>ProgramArguments</key>
X       <array>
X               <string>__PREFIX__/libexec/amandad</string>
X               <string>-auth=bsdudp</string>
X       </array>
X       <key>Sockets</key>
X       <dict>
X               <key>ipv4</key>
X               <dict>
X                       <key>SockFamily</key>
X                       <string>IPv4</string>
X                       <key>SockServiceName</key>
X                       <string>amanda</string>
X                       <key>SockType</key>
X                       <string>dgram</string>
X               </dict>
X               <key>ipv6</key>
X               <dict>
X                       <key>SockFamily</key>
X                       <string>IPv6</string>
X                       <key>SockServiceName</key>
X                       <string>amanda</string>
X                       <key>SockType</key>
X                       <string>dgram</string>
X               </dict>
X       </dict>
X       <key>UserName</key>
X       <string>__USER__</string>
X       <key>inetdCompatibility</key>
X       <dict>
X               <key>Wait</key>
X               <true/>
X       </dict>
X</dict>
X</plist>
END-of-amanda/files/org.amanda.amandad.bsdudp.plist.in
echo x - amanda/Portfile
sed 's/^X//' >amanda/Portfile << 'END-of-amanda/Portfile'
X# $Id$
X
XPortSystem 1.0
X
Xname                   amanda
Xversion                        2.5.2p1
Xcategories             net
Xplatforms              darwin
Xmaintainers            jdunn@aquezada.com
Xdescription            The Advanced Maryland Automatic Network Disk Archiver (client)
Xlong_description       AMANDA, the Advanced Maryland Automatic Network Disk \
X                       Archiver, is a backup system that allows the \
X                       administrator to set up a single master backup server \
X                       to back up multiple hosts over network to tape \
X                       drives/changers or disks or optical media. \
X                       Amanda uses native dump and/or GNU tar facilities \
X                       and can back up a large number of workstations \
X                       running multiple versions of Unix. Amanda uses \
X                       Samba or Cygwin to back up Microsoft Windows desktops \
X                       and servers. 
X
Xhomepage               http://www.amanda.org/
Xmaster_sites           sourceforge
X
Xchecksums              md5 da1234b12e1e34f8535f1c6269d27788 \
X                       sha1 0969376590a93b2c060dbe9d2573bf335614a4c2 \
X                       rmd160 31a81a7c5c0d953a6dffa575a7c3edc14d41f236
X
Xset amandauser         amandabackup
X
Xconfigure.args --with-user=${amandauser} \
X               --with-group=wheel \
X               --sysconfdir=${prefix}/etc/${name} \
X               --localstatedir=${prefix}/var/amanda
X
Xdefault_variants       +client
X
Xvariant client { configure.args-append --without-server }
Xvariant server { configure.args-append --without-client }
X
X# because amanda installs its own dumper
Xdestroot.violate_mtree yes
X
X# cribbed from http://wiki.zmanda.com/index.php/Installation/OS_Specific_Notes/Installing_Amanda_on_Mac_OS_X
Xpre-destroot {
X       adduser         ${amandauser} gid=0 realname=Amanda\ User home=/Users/amandabackup shell=/bin/bash
X}
X
Xplatform darwin 7 {
X       post-destroot {
X               xinstall -d -m 755 -d ${destroot}/etc/xinetd.d
X               xinstall -m 755 ${portpath}/${filesdir}/amandad-xinetd.in ${destroot}/etc/xinetd.d/amanda
X               reinplace "s|__PREFIX__|${prefix}|g" ${destroot}/etc/xinetd.d/amanda
X               reinplace "s|__USER__|${amandauser}|g" ${destroot}/etc/xinetd.d/amanda
X       }
X}
X
Xplatform darwin 8 {
X       post-destroot {
X               xinstall -d -m 755 -d ${destroot}/Library/LaunchDaemons 
X               xinstall -m 755 ${portpath}/${filesdir}/org.amanda.amandad.bsdudp.plist.in ${destroot}/Library/Launch
Daemons/org.amanda.amandad.bsdudp.plist
X               xinstall -m 755 ${portpath}/${filesdir}/org.amanda.amandad.bsdtcp.plist.in ${destroot}/Library/Launch
Daemons/org.amanda.amandad.bsdtcp.plist
X               reinplace "s|__PREFIX__|${prefix}|g" ${destroot}/Library/LaunchDaemons/org.amanda.amandad.bsdudp.plis
t
X               reinplace "s|__USER__|${amandauser}|g" ${destroot}/Library/LaunchDaemons/org.amanda.amandad.bsdudp.pl
ist
X               reinplace "s|__PREFIX__|${prefix}|g" ${destroot}/Library/LaunchDaemons/org.amanda.amandad.bsdtcp.plis
t
X               reinplace "s|__USER__|${amandauser}|g" ${destroot}/Library/LaunchDaemons/org.amanda.amandad.bsdtcp.pl
ist
X       }
X       post-install {
X               ui_msg "Don't forget to use launchctl to load the files that we installed into ${destroot}/Library/La
unchDaemons so that amanda will start up."
X       }
X}
X
Xpost-destroot {
X       xinstall -d -m 755 -d ${destroot}/etc
X       touch ${destroot}/etc/amandates
X       system "chmod 660 ${destroot}/etc/amandates"
X       system "chown ${amandauser}:wheel ${destroot}/etc/amandates"
X}
X
Xpost-install {
X        ui_msg "\nDon't forget to create an .amandahosts in ${amandauser}'s home directory"
X}
END-of-amanda/Portfile
exit

Change History (10)

comment:1 Changed 17 years ago by nox@…

Milestone: Port Submissions

comment:2 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: lists@… ryandesign@… added
Owner: changed from macports-dev@… to ryandesign@…

comment:3 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Thanks for your contribution! Some comments:

  • Shell archives are weird; in the future, please just attach files to the ticket.
  • The use of default_variants is not recommended. It causes problems when upgrading, due to a MacPorts base bug.
  • Disabling the client features in the server variant and vice versa for the client variant is weird. It would be more usual to include --without-client and --without-server in the default configure.args, and remove one or the other in the appropriate variant with configure.args-delete.
  • Why are there both client and server variants? Is there ever a case when you would want neither? Is there ever a case when you would want both? Is there any reason why for example the client features couldn't be on all the time, and the server features would be a variant?
  • Is there any reason why you're providing launchd plists and xinetd scripts instead of using startupitem.create and related MacPorts commands? Are the startup scripts needed for the client, or the server, or both? I note that you provide two launchd plists, and that MacPorts currently only supports one plist per port. Do you really need two launchd plists?
  • I believe user creation should happen in pre-destroot instead of post-install. Looks like more ports are doing it around destroot time rather than install time.
  • In your xinstall commands, you're listing the -d option twice, which is redundant, and you're using -m 755, which is unnecessary because 755 is the default mode for directories.

Could you please attach revised files to this ticket?

comment:4 Changed 16 years ago by lists@…

I'll fix everything else but I did try to use startupitems but was told in IRC that xinetd scripts aren't supported by the startupitem.* framework:

16:53 < jools> specifically i'm trying to convert these -
16:53 < jools> http://wiki.zmanda.com/index.php/Installation/OS_Specific_Notes/I
nstalling_Amanda_on_Mac_OS_X
16:53 < sfiera> Hmm, I don't think MacPorts' startupitem support is able to deal
 with xinetd yet

Has this changed?

comment:5 Changed 16 years ago by lists@…

Also Version on this ticket needs to be set to 1.5.2 as destroot.violate_mtree is needed for this port.

comment:6 in reply to:  description ; Changed 16 years ago by paul.shemansky@…

Replying to lists@aquezada.com:

I was attempting to assemble a similar Port, when I realized that most of the work was already done.

Has this attempt been abandoned?

Is there an expected release date?

comment:7 in reply to:  6 Changed 16 years ago by lists@…

Replying to paul.shemansky@gmail.com:

I was attempting to assemble a similar Port, when I realized that most of the work was already done.

Has this attempt been abandoned?

Is there an expected release date?

Sadly I have had to abandon this effort because my test box died (and I am not actually a Mac user -- I was packaging this for someone else who has now found an alternate solution)

Feel free to take on what I've done, rework it and make it ready for inclusion!

comment:8 Changed 15 years ago by raimue (Rainer Müller)

Resolution: wontfix
Status: newclosed

Closing due to lack of interest.

comment:9 Changed 15 years ago by jmroot (Joshua Root)

Type: enhancementsubmission

comment:10 Changed 15 years ago by (none)

Milestone: Port Submissions

Milestone Port Submissions deleted

Note: See TracTickets for help on using tickets.