---
name: aprsd
version: 2.2.515
origin: comms/aprsd
comment: Server daemon providing Internet access to APRS packet data
arch: freebsd:9:x86:64
www: http://sourceforge.net/projects/aprsd/
maintainer: db@FreeBSD.org
prefix: /usr/local
licenselogic: single
flatsize: 384712
desc: |
  aprsd is a server daemon that provides Internet gateway and client access
  to amateur radio APRS packet data.

  WWW: http://sourceforge.net/projects/aprsd/
categories: [hamradio, comms]
files:
  /usr/local/bin/aprsd: eb443b4b5c112a38e51934af58108b4021b6ea6ab083cbbfbf4b06ee9f513504
  /usr/local/bin/aprspass: b29682f7864a3a50542f2354bc6c80a76c43d4359597222f02b37b1301776fcc
  /usr/local/etc/aprsd/INIT.TNC.samp: 02ed622d76d9e8372026afd96845001b6ac414294e90e1f33c43e61964930090
  /usr/local/etc/aprsd/RESTORE.TNC.samp: ba36315e800f8525ae89f61a3ef584c57ff709bec24988280d62aa9d7ad3f233
  /usr/local/etc/aprsd/aprsd.conf.samp: 72b11fe92accea189ef22198617793140096abd227ca57a80a829b535aa61934
  /usr/local/etc/aprsd/user.deny.samp: 2c6c5effce0137f12c13fed9eaca445a2c062fcfea0deafd7fd67a4fc1eba735
  /usr/local/etc/aprsd/welcome.txt.samp: 8e12bf012697eb5b65a08a039309932c5020cd5f1723c0dfc6e8c54c736258d4
  /usr/local/etc/rc.d/aprsd: 89025eb82d236d3dafa083fece879b0e844a73580cb2f9091dbe518ff0dd560f
  /usr/local/share/doc/aprsd/aprsddoc.html: 2085be726f3cbdb1254c253d5ca8b051fedc05c8eb62d7ffc3ef8376530ffadb
  /usr/local/share/doc/aprsd/ports.html: 6545f04ef5bae30100ffa5f71efcfe0ed58bfdc09d874094091902b4fa0e44e9
  /usr/local/share/doc/aprsd/q.html: 531eb855818579140f4014b26d642e8d73affff66f2ec7241ee5328ca58003d5
  /usr/local/share/doc/aprsd/qalgorithm.html: c268b05d916b5b85f258455f99bc4fd2abce95c8f08b2e16f074bb42d3a46c57
  /usr/local/share/examples/aprsd/chkaprsd: dc0b7afbb2d7e6b9939908aa8580f55f021fcaecafb4f84079969d01405fa74d
  /usr/local/share/examples/aprsd/udp_example: 28dd71bbc392df2b2aba310e5189610ec3b888ee6b33a99117e83ee2e885464f
directories:
  /usr/local/share/examples/aprsd/: n
  /usr/local/share/doc/aprsd/: n
  /usr/local/etc/aprsd/: y
scripts:
  install: "#!/bin/sh\n\nUID=240\nGID=${UID}\nDAEMON_NAME=\"aprsd\"\nUID_NAME=${DAEMON_NAME}\nGID_NAME=${DAEMON_NAME}\n\nTNC_UID=241\nTNC_GID=${TNC_UID}\nTNC_UID_NAME=\"tnc\"\nTNC_GID_NAME=\"tnc\"\n\nif
    [ \"x$2\" != \"xPRE-INSTALL\" ]; then\n\texit 0;\nfi\n\nask() {\n\tlocal question
    default answer\n\n\tquestion=$1\n\tdefault=$2\n\tif [ -z \"${PACKAGE_BUILDING}\"
    ]; then\n\t\tread -p \"${question} [${default}]? \" answer\n\tfi\n\tif [ x${answer}
    = x ]; then\n\t\tanswer=${default}\n\tfi\n\techo ${answer}\n}\n\nyesno() {\n\tlocal
    dflt question answer\n\n\tquestion=$1\n\tdflt=$2\n\twhile :; do\n\t\tanswer=$(ask
    \"${question}\" \"${dflt}\")\n\t\tcase \"${answer}\" in\n\t\t[Yy]*)          return
    0;;\n\t\t[Nn]*)          return 1;;\n\t\tesac\n\t\techo \"Please answer yes or
    no.\"\n\tdone\n}\n\nadduser() {\n\tlocal uid gid uid_name gid_name daemon_name\n\n\tuid=$1\n\tgid=$2\n\tuid_name=$3\n\tgid_name=$4\n\tdaemon_name=$5\n\tif
    which -s pw ; then\n\t\t:\n\telse\n\t\tcat <<EOF\nYour system does not include
    the \"pw\" utility.  You should upgrade\nto a newer version of FreeBSD.  Without
    \"pw\" this script will not\nrun.\nEOF\n\t\texit 1\n\tfi\n\n\techo \"\"\n\tif
    pw groupshow ${gid_name} 2> /dev/null ; then\n\t\techo \"You already have a group
    \\\"${gid_name}\\\", so I will use it.\"\n\telse\n\t\tif pw groupshow ${gid} 2>
    /dev/null ; then\n\t\t\techo \"You already have a gid \\\"${gid}\\\".  Please
    create a user ${gid_name}\"\n\t\t\techo \"with a default group of \\\"${gid_name}\\\".\"\n\t\t\texit
    1\n\t\tfi\n\t\techo \"You need a group \\\"${gid_name}\\\".\"\n\t\tif which -s
    pw && yesno \"Would you like me to create it\" y; then\n\t\t    pw groupadd ${gid_name}
    -g ${gid} || exit\n\t\t    echo \"Done.\"\n\t\telse\n\t\t\techo \"Please create
    it, and try again.\"\n\t\t\tif ! pw usershow ${uid_name} 2> /dev/null ; then\n\t\t\t
    \   echo \"While you're at it, please create a user \\\"${uid_name}\\\"\"\n\t\t\t\techo
    'too, with a default group of \"${gid_name}\".'\n\t\t\tfi\n\t\t\texit 1\n\t\tfi\n\tfi\n\n\tif
    pw usershow ${uid_name} 2> /dev/null ; then\n\t\techo \"You already have a user
    \\\"${uid_name}\\\", so I will use it.\"\n\telse\n\t        if pw usershow ${uid}
    2> /dev/null ; then\n        \t        echo \"You already have a uid \\\"${uid}\\\".
    \ Please create a user \\\"${uid_name}\\\"\"\n                \techo \"with a
    default group of \\\"${gid_name}\\\".\"\n\t                exit 1\n\t\tfi\n\t\techo
    \"You need a user \\\"${uid_name}\\\".\"\n\t\tif which -s pw && yesno \"Would
    you like me to create it\" y; then\n\t\t    pw useradd ${uid_name} -g ${gid_name}
    -u ${uid} -h - -d /nonexistent \\\n\t\t\t\t-s /bin/sh -c \"${daemon_name}\" ||
    exit\n\t\t\techo \"Done.\"\n\t\telse\n\t\t\techo \"Please create it, and try again.\"\n\t\t\texit
    1\n\t\tfi\n\tfi\n}\n\n(adduser ${UID} ${GID} ${UID_NAME} ${GID_NAME} ${DAEMON_NAME})\n\necho
    `pw groupshow dialer`|grep -q ${UID_NAME}\nif [ $? -eq 0 ]; then\n\techo \"You
    already have \\\"${UID_NAME}\\\" in the dialer group, so I will use this.\"\nelse\ncat<<EOF\n${DAEMON_NAME}
    needs access to serial ports to talk to an\nexternal tnc. You will be asked if
    you wish to add ${DAEMON_NAME}\nto the dialer group for that purpose.\nEOF\n\tif
    pw usershow ${UID_NAME} 2> /dev/null ; then\n\t\tif which -s pw && yesno \"Would
    you like to add \\\"${UID_NAME}\\\" to the dialer group?\" y; then\n\t\t\tpw groupmod
    -n \"dialer\" -m ${UID_NAME} || exit\n\t\t\techo \"Done.\"\n\t\tfi\n\tfi\nfi\n\nif
    ! pw usershow ${TNC_UID_NAME} 2> /dev/null ; then\ncat<<EOF\n\"${DAEMON_NAME}\"
    has an optional login \"${TNC_UID_NAME}\",\n(This is described in the aprsd docs.)
    if you\nwish to allow remote logins. \"${DAEMON_NAME}\" needs to run as\nroot
    for this to work, if you do not plan to run\n\"${DAEMON_NAME}\" ever as root,
    you can skip this step.\nYou can always add it manually later if you change your
    mind.\nEOF\n        if which -s pw && yesno \"Would you like to add a ${TNC_UID_NAME}
    login\" y; then\n\t\t(adduser ${TNC_UID} ${TNC_GID} ${TNC_UID_NAME} ${TNC_GID_NAME}
    ${DAEMON_NAME})\n        fi\nelse\n\techo \"You already have an user \\\"${TNC_UID_NAME}\\\"
    so I will use it.\"\nfi\n"
  deinstall: "#!/bin/sh\n\nif [ \"x$2\" != \"xPOST-DEINSTALL\" ]; then\n\texit 0;\nfi\n\necho
    \"Killing aprsd if running\"\nkill -9 `cat /var/run/aprsd.pid`\nrm -f /var/run/aprsd.pid\n\ncat<<EOF\nIf
    you really want to remove this package completely\nremove what is left in /usr/local/etc/aprsd
    /var/log/aprsd.\nAlso be sure to remove user and groups aprsd and tnc \nand remember
    to remove aprsd from dialer group.\nEOF\n"
message: |
  aprsd is now installed

  aprsd has various config files to set up in /usr/local/etc/aprsd
  logs are kept in /var/log/aprsd

  To enable aprsd you need to add: aprsd_enable="YES" to /etc/rc.conf
  to run aprsd as UID aprsd   add: aprsd_root="NO" to /etc/rc.conf
