| 1 |
#! /bin/sh |
| 2 |
# A deprecated interface to GNU Mailutils configuration facilities. |
| 3 |
# Copyright (C) 2010-2025 Free Software Foundation, Inc. |
| 4 |
# |
| 5 |
# GNU Mailutils is free software; you can redistribute it and/or |
| 6 |
# modify it under the terms of the GNU General Public License as |
| 7 |
# published by the Free Software Foundation; either version 2, or (at |
| 8 |
# your option) any later version. |
| 9 |
# |
| 10 |
# GNU Mailutils is distributed in the hope that it will be useful, but |
| 11 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
# General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU General Public License |
| 16 |
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
|
| 18 |
# Despite being deprecated, this script is retained as an intermediate |
| 19 |
# layer between mu and the AM_GNU_MAILUTILS macro. This is important, |
| 20 |
# because some distros prefer to rename mu when installing. Using this |
| 21 |
# script allows AM_GNU_MAILUTILS to find mu even if it was renamed. |
| 22 |
|
| 23 |
mode= |
| 24 |
file= |
| 25 |
dir=`expr "$0" : '\(.*\)/.*'` |
| 26 |
muname=mailutils |
| 27 |
|
| 28 |
test -n "$dir" && PATH=$dir:$PATH |
| 29 |
|
| 30 |
usage() { |
| 31 |
cat <<EOT |
| 32 |
This is a deprecated interface to GNU Mailutils configuration facilities. |
| 33 |
It will be removed in future versions. Please, consider using these |
| 34 |
alternatives instead: |
| 35 |
|
| 36 |
Traditional usage | Use instead |
| 37 |
------------------------------+------------------- |
| 38 |
mailutils-config --compile | $muname cflags |
| 39 |
mailutils-config --link | $muname ldflags |
| 40 |
mailutils-config --info | $muname info |
| 41 |
mailutils-config --query | $muname query |
| 42 |
mailutils-config --query=FILE | $muname query -f FILE |
| 43 |
|
| 44 |
For more information, try \`$muname --help'. |
| 45 |
|
| 46 |
EOT |
| 47 |
exit 0 |
| 48 |
} |
| 49 |
|
| 50 |
while test $# -ne 0 |
| 51 |
do |
| 52 |
arg=$1 |
| 53 |
shift |
| 54 |
case $arg in |
| 55 |
-c|--c|--co|--com|--comp|--compil|--compile) |
| 56 |
mode=cflags |
| 57 |
break |
| 58 |
;; |
| 59 |
-i|--i|--in|--inf|--info) |
| 60 |
mode=info |
| 61 |
break |
| 62 |
;; |
| 63 |
-l|--l|--li|--lin|--link) |
| 64 |
mode=ldflags |
| 65 |
break |
| 66 |
;; |
| 67 |
--) |
| 68 |
break |
| 69 |
;; |
| 70 |
-q*=*|--q*=*) |
| 71 |
opt=`expr "$arg" : '\(.*\)='` |
| 72 |
arg=`expr "$arg" : '.*=\(.*\)'` |
| 73 |
case $opt in |
| 74 |
-q|--q|--qu|--que|--quer|--query) |
| 75 |
mode=query |
| 76 |
file=arg |
| 77 |
break |
| 78 |
;; |
| 79 |
*) |
| 80 |
echo >&2 "$0: invalid option: $1" |
| 81 |
exit 1 |
| 82 |
esac |
| 83 |
;; |
| 84 |
-q|--q|--qu|--que|--quer|--query) |
| 85 |
mode=query |
| 86 |
break |
| 87 |
;; |
| 88 |
-q*) |
| 89 |
mode=query |
| 90 |
file=`expr "$arg" : '-q\(.*\)'` |
| 91 |
break |
| 92 |
;; |
| 93 |
--usage|--u|--us|--usa|--usag|--help|--hel|--he|--h) |
| 94 |
usage |
| 95 |
;; |
| 96 |
-V|--version|--versio|--versi|--vers|--ver|--ve|--v) |
| 97 |
$muname --version | sed -n '1{s/^mailutils/mailutils-config/;s/(\(GNU Mailutils\)) \([0-9][0-9.]*\).*/(\1 \2)/;p}' |
| 98 |
exit 0 |
| 99 |
;; |
| 100 |
*) |
| 101 |
echo >&2 "$0: unexpected argument; try \`$0 --usage' for help" |
| 102 |
exit 1 |
| 103 |
;; |
| 104 |
esac |
| 105 |
done |
| 106 |
|
| 107 |
if test -z "$mode"; then |
| 108 |
usage |
| 109 |
fi |
| 110 |
|
| 111 |
if test -n "$file"; then |
| 112 |
set -- -f"$file" $* |
| 113 |
fi |
| 114 |
|
| 115 |
$muname $mode $* |