| Back to the Main Page. | ax_spec_package_version |
Download the M4 Source. |
AX_SPEC_PACKAGE_AND_VERSION ([specfile])
AX_SPEC_PACKAGE_NAME ([shellvar],[defaultvalue])
AX_SPEC_PACKAGE_VERSION ([shellvar],[defaultvalue])
AX_SPEC_PACKAGE_SUMMARY ([shellvar],[defaultvalue])
AX_SPEC_PACKAGE_LICENSE ([shellvar],[defaultvalue])
AX_SPEC_PACKAGE_CATEGORY ([shellvar],[defaultvalue])
AX_SPEC_PACKAGE_ICON ([shellvar],[defaultvalue])
AX_SPEC_DEFAULTS([specfile])
1.1 (2003/10/18) 0.5.65 : guidod
Guido Draheim <guidod@gmx.de>
AC_DEFUN([AX_SPEC_PACKAGE_LICENSE],[AC_REQUIRE([AX_SPEC_FILE])dnl
AS_VAR_PUSHDEF([VAR],[PACKAGE_LICENSE])dnl
AC_MSG_CHECKING([for spec license type])
if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
then k="(w/o spec)"
else k=""
AX_SPEC_EXTRACT(VAR,[license],m4_ifval($1,$1))
VAR=`echo $VAR | sed -e 's/ *License//g'`
fi fi
test ".$VAR" = "." && k="(fallback)"
ifelse($2,,[dnl here the defaults for LICENSE / COPYRIGHT
if test ".$VAR" = "." ; then
for ac_file in "$srcdir/COPYING" "$srcdir/COPYING" "$srcdir/LICENSE" ; do
test -f "$ac_file" || continue
dnl http://www.ibiblio.org/osrt/omf/omf_elements "16. Rights"
if grep "GNU LESSER GENERAL PUBLIC LICENSE" "$ac_file" >/dev/null
then VAR="GNU LGPL" ; break
elif grep "GNU GENERAL PUBLIC LICENSE" "$ac_file" >/dev/null
then VAR="GNU GPL" ; break
elif grep "MOZILLA PUBLIC LICENSE" "$ac_file" >/dev/null
then VAR="MPL" ; break
elif grep "Mozilla Public License" "$ac_file" >/dev/null
then VAR="MPL" ; break
elif grep -i "artistic license" "$ac_file" >/dev/null
then VAR="Artistic" ; break
elif grep -i "artistic control" "$ac_file" >/dev/null
then VAR="Artistic" ; break
elif grep -i "semblance of artistic" "$ac_file" >/dev/null
then VAR="Artistic" ; break
elif grep -i "above copyright notice" "$ac_file" >/dev/null
then VAR="BSD" ; break
fi
done
if test ".$VAR" = "." ; then
if test "$srcdir/COPYING.LIB" ; then VAR="GNU LGPL"
elif test ".$ltmain" != "." ; then VAR="GNU LGPL"
else VAR="GNU GPL"
fi
fi
fi
],[test ".$VAR" = "." && VAR="$2"])
test "$VAR" = "GPL" && VAR="GNU GPL"
test "$VAR" = "LGPL" && VAR="GNU LGPL"
AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
AS_VAR_POPDEF([VAR])dnl
])
AC_DEFUN([AX_SPEC_PACKAGE_SUMMARY],[AC_REQUIRE([AX_SPEC_FILE])dnl
AS_VAR_PUSHDEF([VAR],[PACKAGE_SUMMARY])dnl
AC_MSG_CHECKING([for spec summary])
if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
then k="(w/o spec)"
else k=""
AX_SPEC_EXTRACT(VAR,[summary],m4_ifval($1,$1))
fi fi
test ".$VAR" = "." && k="(fallback)"
ifelse($2,,[dnl here the defaults for SUMMARY
if test ".$VAR" = "." ; then VAR="$PACKAGE"
test ".$VAR" = "." && VAR="foo"
test ".$ltmain" != "." && VAR="$VAR library"
fi
],[test ".$VAR" = "." && VAR="$2"])
AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
AS_VAR_POPDEF([VAR])dnl
])
AC_DEFUN([AX_SPEC_PACKAGE_ICON],[AC_REQUIRE([AX_SPEC_FILE])dnl
AS_VAR_PUSHDEF([VAR],[PACKAGE_ICON])dnl
AC_MSG_CHECKING([for spec icon])
if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
then k="(w/o spec)"
else k=""
AX_SPEC_EXTRACT(VAR,[icon],m4_ifval($1,$1))
fi fi
test ".$VAR" = "." && k="(fallback)"
ifelse($2,,[dnl here the defaults for ICON
if test ".$VAR" = "." ; then VAR="$PACKAGE-icon.png" ; fi
],[test ".$VAR" = "." && VAR="$2"])
AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
AS_VAR_POPDEF([VAR])dnl
])
AC_DEFUN([AX_SPEC_PACKAGE_CATEGORY],[AC_REQUIRE([AX_SPEC_FILE])dnl
AS_VAR_PUSHDEF([VAR],[PACKAGE_CATEGORY])dnl
AC_MSG_CHECKING([for spec category])
if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
then k="(w/o spec)"
else k=""
AX_SPEC_EXTRACT(VAR,[group],m4_ifval($1,$1))
VAR=`echo $VAR | sed -e 's/ /-/g'`
fi fi
test ".$VAR" = "." && k="(fallback)"
ifelse($2,,[dnl here the defaults for CATEGORY
if test ".$VAR" = "." ; then if test ".$ltmain" != "."
then VAR="Development/Library"
else VAR="Development/Other"
fi fi
],[test ".$VAR" = "." && VAR="$2"])
AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
AS_VAR_POPDEF([VAR])dnl
])
AC_DEFUN([AX_SPEC_PACKAGE_NAME],[AC_REQUIRE([AX_SPEC_FILE])dnl
AS_VAR_PUSHDEF([VAR],[PACKAGE_NAME])dnl
AC_MSG_CHECKING([for spec package])
if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
then k="(w/o spec)"
else k=""
AX_SPEC_EXTRACT(VAR,[name],m4_ifval($1,$1))
VAR=`echo $VAR | sed -e 's/ /-/g'`
fi fi
test ".$VAR" = "." && k="(fallback)"
ifelse($2,,[dnl here the defaults for PACKAGE
test ".$VAR" = "." && VAR=`basename $ax_spec_file .spec`
test ".$VAR" = ".README" && VAR="TODO"
test ".$VAR" = ".TODO" && VAR="foo"
],[test ".$VAR" = "." && VAR="$2"])
test "VAR" = "PACKAGE_NAME" && test ".$PACKAGE" = "." && PACKAGE="$VAR"
AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
AS_VAR_POPDEF([VAR])dnl
])
AC_DEFUN([AX_SPEC_PACKAGE_VERSION_],[AC_REQUIRE([AX_SPEC_FILE])dnl
AS_VAR_PUSHDEF([VAR],[PACKAGE_VERSION])dnl
AC_MSG_CHECKING([for spec version])
if test ".$VAR" = "." ; then if test ! -f $ax_spec_file
then k="(w/o spec)"
else k=""
AX_SPEC_EXTRACT(VAR,[version],m4_ifval($1,$1))
VAR=`echo $VAR | sed -e 's/ /-/g'`
fi fi
test ".$VAR" = "." && k="(fallback)"
ifelse($2,,[dnl here the defaults for VERSION
test ".$VAR" = "." && VAR=`date +0.%y.%W%w`
],[test ".$VAR" = "." && VAR="$2"])
test "VAR" = "PACKAGE_VERSION" && test ".$VERSION" = "." && VERSION="$VAR"
case "$VAR" in # note we set traditional VERSION before cleaning things up
*.*.) VAR="$VAR"`date +%W%w` ;;
*.*.*) ;;
*.) VAR="$VAR"`date +%y.%W%w` ;;
*.*) VAR="$VAR.0" ;;
*) VAR=AS_TR_SH([$VAR]) ; VAR="$VAR.`date +%y.%W%w`" ;;
esac
VAR=`echo $VAR | sed -e "s/[[.]][0]\\([0-9]\\)/.\\1/g"`
AC_MSG_RESULT([m4_ifval([$1],[$1 = ])$VAR $k])
AS_VAR_POPDEF([VAR])dnl
])
dnl for compatibility, we define ax_spec_package_version
dnl to do all of ax_spec_package_name as well.
AC_DEFUN([AX_SPEC_PACKAGE_VERSION],[AC_REQUIRE([AX_SPEC_FILE])dnl
ifelse($1,,
AC_MSG_WARN([please use ax_spec_package_AND_version now!]),
AC_MSG_ERROR([please use ax_spec_package_AND_version now!]))
AX_SPEC_PACKAGE_NAME
AX_SPEC_PACKAGE_VERSION_
])
AC_DEFUN([AX_SPEC_PACKAGE_AND_VERSION],[
m4_ifset([m4_ax_spec_file],,[AX_SPEC_FILE($1)])
AX_SPEC_PACKAGE_NAME
AX_SPEC_PACKAGE_VERSION_
])
AC_DEFUN([AX_SPEC_DEFAULTS],[
m4_ifset([m4_ax_spec_file],,[AX_SPEC_FILE($1)])
AX_SPEC_PACKAGE_NAME
AX_SPEC_PACKAGE_VERSION_
AX_SPEC_PACKAGE_LICENSE
AX_SPEC_PACKAGE_SUMMARY
AX_SPEC_PACKAGE_CATEGORY
AX_SPEC_PACKAGE_ICON
])