diff options
author | Chris Severance | 2017-07-26 23:12:44 -0400 |
---|---|---|
committer | Chris Severance | 2017-07-26 23:12:44 -0400 |
commit | 9f7be1da6028a9d7815e0765dff947d8ab1cd347 (patch) | |
tree | 65e0692f20fd382ef480401e846045a380829827 | |
parent | c151dfe39676236a847dab2a74bbab4187cdd893 (diff) | |
download | aur-9f7be1da6028a9d7815e0765dff947d8ab1cd347.tar.gz |
hook, fix remove, remove cover page
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 52 | ||||
-rwxr-xr-x | avantfaxsetup.sh | 47 |
3 files changed, 65 insertions, 40 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Sat May 20 00:31:48 UTC 2017 +# Fri Jul 21 22:01:20 UTC 2017 pkgbase = avantfax pkgdesc = a web-based application for managing faxes on HylaFAX fax servers pkgver = 3.3.5 - pkgrel = 2 + pkgrel = 3 url = http://www.avantfax.com/ install = avantfax.install arch = any @@ -38,7 +38,7 @@ pkgbase = avantfax source = avantfax.phb.service source = avantfax.phb.timer sha256sums = 7dc6cfbaea9e27d6ef696611dad79f50cbaa61be6e3b59ce25fa124af0cf1269 - sha256sums = 615fcba915da20c10614c618dfc6a4d55ed526d2b689947c104102e3cc37e18c + sha256sums = ebd4fb7dd1b5ec7f9ad4f5ec03dcfaa9fde32c3137d52656007bf2df94b28670 sha256sums = 2c633cd03dd234cfbcf6d0530be573e9eaa2b1e92876faa946895bf99bfb3ebc sha256sums = 057be12012e2bd10c8400cac9a2612b9d66ea1535476671f28dbf633c8eb6972 sha256sums = 51b4bcf2e26418f8392f765c7d0f363fe3c842ddfbefb8c950f484f4ce4a179a @@ -1,5 +1,4 @@ # Maintainer: Chris Severance aur.severach aATt spamgourmet dott com -# Category: daemons # Note: These TODO may not be things I'm planning to fix. Some of them are just # notes to be fixed by someone else who wants that functionality and warnings @@ -17,7 +16,7 @@ # TODO: We should stop using hard links. They won't update as the system updates. # See avantfaxsetup.sh for more todo -# VERIFIED: Upon remove (and cleanup) 'avantfax' isn't found in /etc /var/spool/hylafax +# VERIFIED: Upon remove (and cleanup) 'avantfax' isn't found in /etc /var/spool/hylafax /usr/lib/fax # other than in the logs for faxes sent by AvantFAX. # VERIFIED: AvantFAX integration for HylaFAX+ upgrades @@ -34,7 +33,7 @@ _opt_phpver='php56' # php56 for now, php when avantfax is php7 compatible # Add mysql root password then finish install. -# avantfaxsetup.sh install +# sudo avantfaxsetup.sh install # Check settings in /usr/share/webapps/avantfax/includes/local_config.php @@ -46,7 +45,7 @@ set -u pkgname='avantfax' _pkgnick="${pkgname}" # 'ArchFAX' # Changing this for an upgrade leaves cruft in many files. pkgver='3.3.5' -pkgrel='2' +pkgrel='3' pkgdesc='a web-based application for managing faxes on HylaFAX fax servers' arch=('any') #('i686' 'x86_64') url='http://www.avantfax.com/' @@ -72,15 +71,16 @@ optdepends=('tesseract: OCR incoming faxes for document keyword searches' # not #makedepends=('smtp-server') # sendmail isn't required. It can be used on another server. install="${pkgname}.install" _verwatch=("${url}/changelog.php" 'AvantFAX\s\([0-9\.]\+\)\s*' 'f') -source=("http://downloads.sourceforge.net/project/${pkgname}/${pkgname}-${pkgver}.tgz" - 'avantfaxsetup.sh' - 'avantfax.cron.service' - 'avantfax.cron.timer' - 'avantfax.phb.service' - 'avantfax.phb.timer') - +source=( + "http://downloads.sourceforge.net/project/${pkgname}/${pkgname}-${pkgver}.tgz" + 'avantfaxsetup.sh' + 'avantfax.cron.service' + 'avantfax.cron.timer' + 'avantfax.phb.service' + 'avantfax.phb.timer' +) sha256sums=('7dc6cfbaea9e27d6ef696611dad79f50cbaa61be6e3b59ce25fa124af0cf1269' - '615fcba915da20c10614c618dfc6a4d55ed526d2b689947c104102e3cc37e18c' + 'ebd4fb7dd1b5ec7f9ad4f5ec03dcfaa9fde32c3137d52656007bf2df94b28670' '2c633cd03dd234cfbcf6d0530be573e9eaa2b1e92876faa946895bf99bfb3ebc' '057be12012e2bd10c8400cac9a2612b9d66ea1535476671f28dbf633c8eb6972' '51b4bcf2e26418f8392f765c7d0f363fe3c842ddfbefb8c950f484f4ce4a179a' @@ -119,8 +119,7 @@ prepare() { # This PEAR bug will never be fixed but is also unlikely to be deprecated so we'll supress it. # http://pear.php.net/bugs/bug.php?id=17987 for _file in 'SQL.php' 'MDBO.php'; do - sed -e 's|(\(PEAR::isError\)|(@\1|g' \ - -i "${pkgname}/includes/${_file}" + sed -e 's|(\(PEAR::isError\)|(@\1|g' -i "${pkgname}/includes/${_file}" done # I don't see a fast way to fix this one so I'll just suppress the warning for now. @@ -203,7 +202,7 @@ package () { fi install -Dm644 <(cat <<EOF # Installed by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR -# http://aur.archlinux.org/ +# https://aur.archlinux.org/ Alias /${_pkgnick} "${_httpdir}/${_pkgnick}" <Directory "${_httpdir}/${_pkgnick}"> AllowOverride All @@ -232,7 +231,7 @@ EOF local _opt_SOURCEONLY=1; . "${_shellfile}"; unset _opt_SOURCEONLY install -Dm644 <(cat << EOF ; Installed by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR -; http://aur.archlinux.org/ +; https://aur.archlinux.org/ extension=mysql.so EOF ) "${pkgdir}/etc/${_opt_phpver}/conf.d/${_pkgnick}.ini" @@ -246,7 +245,7 @@ EOF install -dm750 "${pkgdir}/etc/sudoers.d" install -Dm644 <(cat << EOF # Installed by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR -# http://aur.archlinux.org/ +# https://aur.archlinux.org/ ${_opt_SUDO_LINE} -u * -p * * ${_opt_AVANT_CMTTAG} EOF ) "${pkgdir}/etc/sudoers.d/${_pkgnick}.sudo" @@ -254,6 +253,25 @@ EOF # We run the shell script modified with pkgdir _opt_DESTDIR="${pkgdir}" \ "${_shellfile}" 0 'package' # package ignores the flag + + # pacman hook for automatic update on HylaFax Upgrade + install -Dm644 <(cat << EOF +# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR +# https://aur.archlinux.org/ + +[Trigger] +Operation = Upgrade +Type = Package +Target = hylafax +Target = hylafaxplus + +[Action] +Description = AvantFAX: Update with HylaFax+ +When = PostTransaction +Exec = /usr/bin/bash /usr/bin/${_shellfile##*/} 2 install +EOF + ) "${pkgdir}/usr/share/libalpm/hooks/avantfax-hylafax.hook" + set +u } diff --git a/avantfaxsetup.sh b/avantfaxsetup.sh index 90c1bf55b768..64f49ecf339c 100755 --- a/avantfaxsetup.sh +++ b/avantfaxsetup.sh @@ -36,6 +36,7 @@ _opt_HYLA_BIN_DIR="/usr/bin" # reboot, halt, # I'm not the only one who thinks that this is a bad idea. _opt_SUDO_LINE="${_opt_WWWUSER} ALL = NOPASSWD: ${_opt_HYLA_BIN_DIR}/faxdeluser, ${_opt_HYLA_BIN_DIR}/faxadduser" _opt_AVANT_CMTTAG="##AvantFAX##" +_opt_AVANT_FAXCOVER=0 if [ ! -z "${_opt_SOURCEONLY}" ]; then return 0 @@ -248,13 +249,13 @@ _fn_setup_pre() { if [ "$?" -ne 0 ]; then _fn_sql_boom "Can't create ${_opt_ADFB_USER} user" fi - echo "### Creating ${_opt_ADFB_USER} account with password ${_opt_ADFB_PASS} for DB ${_opt_AFDB_NAME}" - ${_opt_MYSQL} --user='root' --password="${_opt_ROOTMYSQLPWD}" 'mysql' -e "GRANT ALL PRIVILEGES ON ${_opt_AFDB_NAME}.* TO '${_opt_ADFB_USER}'@'localhost' IDENTIFIED BY \"${_opt_ADFB_PASS}\"" - if [ "$?" -ne 0 ]; then - _fn_sql_boom "Can't grant to ${_opt_ADFB_USER} user" - fi - echo "`basename "$0"`: SQL configuration complete." fi + echo "### Creating ${_opt_ADFB_USER} account with password ${_opt_ADFB_PASS} for DB ${_opt_AFDB_NAME}" + ${_opt_MYSQL} --user='root' --password="${_opt_ROOTMYSQLPWD}" 'mysql' -e "GRANT ALL PRIVILEGES ON ${_opt_AFDB_NAME}.* TO '${_opt_ADFB_USER}'@'localhost' IDENTIFIED BY \"${_opt_ADFB_PASS}\"" + if [ "$?" -ne 0 ]; then + _fn_sql_boom "Can't grant to ${_opt_ADFB_USER} user" + fi + echo "`basename "$0"`: SQL configuration complete." elif [ "$1" -eq 2 ]; then echo '### Backing up old AvantFAX into /root/avantfaxbackup' mkdir -p '/root/avantfaxbackup' @@ -379,11 +380,14 @@ EOF ####### SYMLINK AVANTFAX SCRIPTS ####### - _var_file="${_var_HYLACONF_DIR}/sendfax.conf" - if ! grep -q "^CoverCmd:\s\+${_opt_INST_DIR}/" "${_var_file}" >/dev/null 2>&1; then - echo "CoverCmd: ${_opt_INST_DIR}/includes/faxcover.php ${_opt_AVANT_CMTTAG}" >> "${_var_file}" + # AvantFAX subs it's own faxcover in for ours + if [ "${_opt_AVANT_FAXCOVER}" -ne 0 ]; then + _var_file="${_var_HYLACONF_DIR}/sendfax.conf" + if ! grep -q "^CoverCmd:\s\+${_opt_INST_DIR}/" "${_var_file}" >/dev/null 2>&1; then + echo "CoverCmd: ${_opt_INST_DIR}/includes/faxcover.php ${_opt_AVANT_CMTTAG}" >> "${_var_file}" + fi + chmod 644 "${_var_file}" fi - chmod 644 "${_var_file}" _var_file="${_opt_INST_DIR}/includes/local_config.php" cp -p "${_opt_INST_DIR}/includes/local_config-example.php" "${_var_file}" @@ -540,15 +544,16 @@ _fn_setup_preun() { # For files that don't have a .d folder, clean out our tagged lines, preserving permissions. _fn_cleanfile() { if [ -s "$1" ]; then - rm -f '/tmp/avantfax.cleanfile' + #rm -f '/tmp/avantfax.cleanfile' if grep -q "${_opt_AVANT_CMTTAG}"'$' "$1" >/dev/null 2>&1; then - cp -p "$1" '/tmp/avantfax.cleanfile' - grep -v "${_opt_AVANT_CMTTAG}"'$' '/tmp/avantfax.cleanfile' > "$1" - rm -f '/tmp/avantfax.cleanfile' - if [ ! -s "$1" ]; then - rm -f "$1" - fi - return 0 + # cp -p "$1" '/tmp/avantfax.cleanfile' + # grep -v "${_opt_AVANT_CMTTAG}"'$' '/tmp/avantfax.cleanfile' > "$1" + # rm -f '/tmp/avantfax.cleanfile' + # if [ ! -s "$1" ]; then + # rm -f "$1" + # fi + sed -e "/${_opt_AVANT_CMTTAG}"'$/ d' -i "$1" + # return 0 fi fi return 1 @@ -571,8 +576,10 @@ _fn_setup_postun() { rm -f "/etc/cron.d/${_opt_AVANTFAX_SERVERNAME}" "${_opt_HYLASPOOL}/bin/notify.php" "${_opt_HYLASPOOL}/bin/faxrcvd.php" "${_opt_HYLASPOOL}/bin/dynconf.php" # Clean up modem files - for _var_file in "${_opt_HYLASPOOL}/etc/config"*; do - _fn_cleanfile "${_var_file}" + for _var_file in "${_opt_HYLASPOOL}/etc/config"* '/usr/lib/fax'/*; do + if [ ! -L "${_var_file}" ]; then + _fn_cleanfile "${_var_file}" + fi done _var_file='/etc/mail/trusted-users' |