Index: .gitignore ================================================================== --- .gitignore +++ .gitignore @@ -1,15 +1,4 @@ -*.Po *.o -Makefile -Makefile.in -autom4te.cache -config.h -config.log -config.status -configure -depcomp -pwman.spec -src/convert_pwdb -src/pwdb2csv -src/pwman -stamp-h1 +convert_pwdb +pwdb2csv +pwman ADDED Makefile Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -0,0 +1,67 @@ +# PWman - An obsolete password manager for the console + +include config.mk + +SRC_PWMAN = actions.c filter.c gnupg.c gnupg.h help.h launch.c misc.c options.c pwgen.c pwlist.c pwman.c pwman.h search.c ui.c ui.h uilist.c +SRC_CONVERT_PWDB = convert_pwdb.c +SRC_PWDB2CSV = pwdb2csv.c +OBJ_PWMAN = ${SRC_PWMAN:.c=.o} +OBJ_CONVERT_PWDB = ${SRC_CONVERT_PWDB:.c=.o} +OBJ_PWDB2CSV = ${SRC_PWDB2CSV:.c=.o} + +all: options pwman convert_pwdb pwdb2csv + +options: + @echo pwman build options: + @echo "CFLAGS = ${CFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" + +.c.o: + @echo CC $< + @${CC} -c ${CFLAGS} $< + +${OBJ_PWMAN}: config.h config.mk +${OBJ_CONVERT_PWDB}: config.h config.mk +${OBJ_PWDB2CSV}: config.h config.mk + +pwman: ${OBJ_PWMAN} + @echo CC -o $@ + #Needs CFLAGS as well for libxml2 + @${CC} -o $@ ${OBJ_PWMAN} ${LDFLAGS} ${CFLAGS} + +convert_pwdb: ${OBJ_CONVERT_PWDB} + @echo CC -o $@ + @${CC} -o $@ ${OBJ_CONVERT_PWDB} ${LDFLAGS} + +pwdb2csv: ${OBJ_PWDB2CSV} + @echo CC -o $@ + @${CC} -o $@ ${OBJ_PWDB2CSV} ${LDFLAGS} + +clean: + @echo cleaning + @rm -f pwman convert_pwdb pwdb2csv *.o + +install: all + @echo installing executable files to ${DESTDIR}${PREFIX}/bin + @mkdir -p ${DESTDIR}${PREFIX}/bin + @cp -f pwman ${DESTDIR}${PREFIX}/bin + @chmod 755 ${DESTDIR}${PREFIX}/bin/pwman + @cp -f convert_pwdb ${DESTDIR}${PREFIX}/bin + @chmod 755 ${DESTDIR}${PREFIX}/bin/convert_pwdb + @cp -f pwdb2csv ${DESTDIR}${PREFIX}/bin + @chmod 755 ${DESTDIR}${PREFIX}/bin/pwdb2csv + @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 + @mkdir -p ${DESTDIR}${MANPREFIX}/man1 + @sed "s/VERSION/${VERSION}/g" < pwman.1 > ${DESTDIR}${MANPREFIX}/man1/pwman.1 + @chmod 644 ${DESTDIR}${MANPREFIX}/man1/pwman.1 + +uninstall: + @echo removing executable files from ${DESTDIR}${PREFIX}/bin + @rm -f ${DESTDIR}${PREFIX}/bin/pwman + @rm -f ${DESTDIR}${PREFIX}/bin/convert_pwdb + @rm -f ${DESTDIR}${PREFIX}/bin/pwdb2csv + @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 + @rm -f ${DESTDIR}${MANPREFIX}/man1/pwman.1 + +.PHONY: all options clean install uninstall DELETED Makefile.am Index: Makefile.am ================================================================== --- Makefile.am +++ Makefile.am @@ -1,1 +0,0 @@ -SUBDIRS = src doc DELETED aclocal.m4 Index: aclocal.m4 ================================================================== --- aclocal.m4 +++ aclocal.m4 @@ -1,1149 +0,0 @@ -# generated automatically by aclocal 1.14 -*- Autoconf -*- - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) - -# Copyright (C) 2002-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# Copyright (C) 2003-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - ADDED actions.c Index: actions.c ================================================================== --- actions.c +++ actions.c @@ -0,0 +1,847 @@ +/* + * PWman - Password management application + * + * Copyright (C) 2002 Ivan Kelly + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include + +extern Pw * uilist_get_highlighted_item(); +extern PWList * uilist_get_highlighted_sublist(); +extern PWList * pwlist_new(char*); +extern PWSearchResult * uilist_get_highlighted_searchresult(); +extern char *pwgen_ask(); + +int disp_h = 15, disp_w = 60; +extern int curitem; +extern WINDOW *bottom; + +int +action_list_add_pw() +{ + Pw *pw; + InputField fields[] = { + {"Name:\t", NULL, STRING_MEDIUM, STRING}, + {"Host:\t", NULL, STRING_MEDIUM, STRING}, + {"User:\t", NULL, STRING_MEDIUM, STRING}, + {"Password:\t", NULL, STRING_SHORT, STRING, pwgen_ask}, + {"Launch Command:\t", NULL, STRING_LONG, STRING} + }; + int i, x; + + pw = pwlist_new_pw(); + ui_statusline_ask_str(fields[0].name, pw->name, STRING_MEDIUM); + ui_statusline_ask_str(fields[1].name, pw->host, STRING_MEDIUM); + ui_statusline_ask_str(fields[2].name, pw->user, STRING_MEDIUM); +/* + int x = strlen(msg) + 5; + + if(input == NULL){ + input = malloc(len); + } + statusline_clear(); + statusline_msg(msg); + + echo(); + show_cursor(); + mvwgetnstr(bottom, 1, x, input, len); + noecho(); + hide_cursor(); + + statusline_clear();*/ + + ui_statusline_ask_str_with_autogen(fields[3].name, pw->passwd, STRING_SHORT, fields[3].autogen, 0x07); +/* statusline_msg(fields[3].name); + x = strlen(fields[3].name) + 5; + + if((i = getch()) == 0x07){ + pw->passwd = fields[3].autogen(); + } else { + echo(); + show_cursor(); + mvwgetnstr(bottom, 1, x, pw->passwd, PASS_LEN); + mvwaddch(bottom, 1, x, i); + wmove(bottom, 1, x+1); + noecho(); + hide_cursor(); + statusline_clear(); + }*/ + + ui_statusline_ask_str(fields[4].name, pw->launch, STRING_LONG); + + fields[0].value = pw->name; + fields[1].value = pw->host; + fields[2].value = pw->user; + fields[3].value = pw->passwd; + fields[4].value = pw->launch; + + i = action_yes_no_dialog(fields, (sizeof(fields)/sizeof(InputField)), NULL, "Add this entry"); + + if(i){ + pwlist_add_ptr(current_pw_sublist, pw); + ui_statusline_msg("New password added"); + } else { + pwlist_free_pw(pw); + ui_statusline_msg("New password cancelled"); + } + + uilist_refresh(); +} + +int +action_edit_pw(Pw *pw) +{ + InputField fields[] = { + {"Name:\t", NULL, STRING_MEDIUM, STRING}, + {"Host:\t", NULL, STRING_MEDIUM, STRING}, + {"User:\t", NULL, STRING_MEDIUM, STRING}, + {"Password:\t", NULL, STRING_SHORT, STRING, pwgen_ask}, + {"Launch Command:\t", NULL, STRING_LONG, STRING} + }; + + if(pw == NULL){ + return -1; + } + /* + * Get specified password + */ + + fields[0].value = pw->name; + fields[1].value = pw->host; + fields[2].value = pw->user; + fields[3].value = pw->passwd; + fields[4].value = pw->launch; + + /* + * initialize the info window + */ + + action_input_dialog(fields, (sizeof(fields)/sizeof(InputField)), "Edit Password"); +} + +int +action_list_rename() +{ + Pw* curpw; + PWList* curpwl; + char *new_name; + + new_name = malloc(STRING_MEDIUM); + + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + curpw = uilist_get_highlighted_item(); + if(curpw){ + ui_statusline_ask_str("New Name", new_name, STRING_MEDIUM); + if(strlen(new_name) > 0) { + pwlist_rename_item(curpw, new_name); + } + } + break; + case PW_SUBLIST: + curpwl = uilist_get_highlighted_sublist(); + if(curpwl){ + ui_statusline_ask_str("New Sublist Name", new_name, STRING_MEDIUM); + if(strlen(new_name) > 0) { + pwlist_rename_sublist(curpwl, new_name); + } + } + break; + case PW_UPLEVEL: + case PW_NULL: + default: + /* do nothing */ + break; + } + + uilist_refresh(); +} + +int +action_edit_options() +{ + InputField fields[] = { + {"GnuPG Path:\t", options->gpg_path, STRING_LONG, STRING}, + {"GnuPG ID:\t", options->gpg_id, STRING_LONG, STRING}, + {"Password File:\t", options->password_file, STRING_LONG, STRING}, + {"Passphrase Timeout(in minutes):\t", &options->passphrase_timeout, STRING_SHORT, INT} + }; + + action_input_dialog(fields, (sizeof(fields)/sizeof(InputField)), "Edit Preferences"); + + write_options = TRUE; +} + +int +action_input_dialog_draw_items(WINDOW* dialog_win, InputField *fields, + int num_fields, char *title, char *msg) +{ + int i, h = 0; + + wclear(dialog_win); + + box(dialog_win, 0, 0); + + if(title){ + wattron(dialog_win, A_BOLD); + i = strlen(title); + h += 2; + mvwaddstr(dialog_win, h, (disp_w - i)/2, title); + wattroff(dialog_win, A_BOLD); + } + + /* loop through fields */ + for(i = 0; i < num_fields; i++){ + h += 2; + if(fields[i].type == STRING){ + mvwprintw(dialog_win, h, 3, + "%d - %s %s", (i+1), fields[i].name, (char*)fields[i].value); + } else if(fields[i].type == INT){ + mvwprintw(dialog_win, h, 3, + "%d - %s %d", (i+1), fields[i].name, *((int*)fields[i].value) ); + } else if(fields[i].type == INFORMATION){ + mvwprintw(dialog_win, h, 3, + "%d - %s", (i+1), fields[i].name); + } + } + + wattron(dialog_win, A_BOLD); + + if(msg){ + i = strlen(msg); + h += 2; + mvwaddstr(dialog_win, h, (disp_w - i)/2, msg); + } + + wattroff(dialog_win, A_BOLD); + + /* + * do final stuff the put all together + */ + wrefresh(dialog_win); +} + +int +action_input_dialog(InputField *fields, int num_fields, char *title) +{ + int ch, i; + char *ret; + WINDOW *dialog_win; + char msg[] = "(press 'q' to return to list)"; + char msg2[80]; + /* + * initialize the info window + */ + if(title){ + disp_h = ((num_fields+2) * 2) + 3; + } else { + disp_h = ((num_fields+1) * 2) + 3; + } + + dialog_win = newwin(disp_h, disp_w, (LINES - disp_h)/2, (COLS - disp_w)/2); + keypad(dialog_win, TRUE); + + action_input_dialog_draw_items(dialog_win, fields, num_fields, title, msg); + /* + * actions loop + */ + while((ch = wgetch(dialog_win)) != 'q'){ + if(!options->readonly) { + if( (ch >= '1') && (ch <= NUM_TO_CHAR(num_fields)) ){ + i = CHAR_TO_NUM(ch); + if(fields[i].autogen != NULL){ + fields[i].value = (char*)ui_statusline_ask_str_with_autogen( + fields[i].name, (char*)fields[i].value, + fields[i].max_length, fields[i].autogen, 0x07); + } else if(fields[i].type == STRING){ + fields[i].value = (char*)ui_statusline_ask_str(fields[i].name, + (char*)fields[i].value, fields[i].max_length); + } else if(fields[i].type == INT){ + ui_statusline_ask_num(fields[i].name, (int*)fields[i].value); + } else if(fields[i].type == INFORMATION){ + // Easy, do nothing! + } + action_input_dialog_draw_items(dialog_win, fields, num_fields, title, msg); + } else if(ch == 'l'){ + delwin(dialog_win); + action_list_launch(); + break; + } + } else { + statusline_readonly(); + } + } + /* + * clean up + */ + delwin(dialog_win); + uilist_refresh(); +} + +int +action_input_gpgid_dialog(InputField *fields, int num_fields, char *title) +{ + int i, valid_id; + int ch = '1', first_time = 1; + char *ret; + WINDOW *dialog_win; + char msg[] = "(press 'q' when export recipient list is complete)"; + char msg2[80]; + /* + * initialize the info window + */ + disp_h = ((num_fields+2) * 2) + 3; + dialog_win = newwin(disp_h, disp_w, (LINES - disp_h)/2, (COLS - disp_w)/2); + keypad(dialog_win, TRUE); + + action_input_dialog_draw_items(dialog_win, fields, num_fields, title, msg); + + /* + * actions loop - ignore read only as not changing main state + */ + while(first_time || ((ch = wgetch(dialog_win)) != 'q')){ + // On first loop, drop straight into recipient 1 + first_time = 0; + + if( (ch >= '1') && (ch <= NUM_TO_CHAR(num_fields)) ){ + i = CHAR_TO_NUM(ch); + fields[i].value = (char*)ui_statusline_ask_str(fields[i].name, + (char*)fields[i].value, fields[i].max_length); + + // Now verify it's a valid recipient + if(strlen(fields[i].value)) { + valid_id = gnupg_check_id(fields[i].value); + if(valid_id == 0) { + // Good, valid id + } else { + // Invalid id. Warn and blank + if(valid_id == -2) { + snprintf(msg2, 80, "Key expired for '%s'", (char*)fields[i].value); + } else { + snprintf(msg2, 80, "Invalid recipient '%s'", (char*)fields[i].value); + } + ui_statusline_msg(msg2); + snprintf(fields[i].value, STRING_LONG, ""); + } + + // Redraw display + action_input_dialog_draw_items(dialog_win, fields, num_fields, title, msg); + } + } + } + + /* + * clean up + */ + delwin(dialog_win); + uilist_refresh(); +} + +int +action_yes_no_dialog(InputField *fields, int num_fields, char *title, char *question) +{ + int ch, i; + char *ret; + WINDOW *dialog_win; + + /* + * initialize the info window + */ + if(title){ + disp_h = ((num_fields+2) * 2) + 3; + } else { + disp_h = ((num_fields+1) * 2) + 3; + } + + dialog_win = newwin(disp_h, disp_w, (LINES - disp_h)/2, (COLS - disp_w)/2); + keypad(dialog_win, TRUE); + + action_input_dialog_draw_items(dialog_win, fields, num_fields, title, NULL); + + i = ui_statusline_yes_no(question, 1); + + /* + * clean up + */ + delwin(dialog_win); + uilist_refresh(); + + return i; +} + +int +action_list_add_sublist() +{ + char *name; + PWList *sublist, *iter; + + name = malloc(STRING_MEDIUM); + ui_statusline_ask_str("Sublist Name:", name, STRING_MEDIUM); + for(iter = current_pw_sublist->sublists; iter != NULL; iter = iter->next){ + if( strcmp(iter->name, name) == 0){ + free(name); + return -1; + } + } + sublist = pwlist_new(name); + + pwlist_add_sublist(current_pw_sublist, sublist); + uilist_refresh(); +} + +int +action_list_at_top_level() +{ + if(current_pw_sublist->parent){ + action_list_up_one_level(); + uilist_refresh(); + return 0; + } else { + return 1; + } +} + +int +action_list_select_item() +{ + Pw* curpw; + PWList* curpwl; + PWSearchResult* cursearch; + + // Are they searching, or in normal mode? + if(search_results != NULL) { + cursearch = uilist_get_highlighted_searchresult(); + curpwl = cursearch->sublist; + curpw = cursearch->entry; + + if(curpw){ + action_edit_pw(curpw); + } else if(curpwl){ + // Quite out of searching + search_remove(); + + // Now display the selected sublist + current_pw_sublist = curpwl; + uilist_refresh(); + } + } else { + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + curpw = uilist_get_highlighted_item(); + if(curpw){ + action_edit_pw(curpw); + } + break; + case PW_SUBLIST: + curpwl = uilist_get_highlighted_sublist(); + if(curpwl){ + current_pw_sublist = curpwl; + uilist_refresh(); + } + break; + case PW_UPLEVEL: + action_list_up_one_level(); + break; + case PW_NULL: + default: + /* do nothing */ + break; + } + } +} + +int +action_list_delete_item() +{ + Pw* curpw; + PWList* curpwl; + int i; + char str[STRING_LONG]; + + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + curpw = uilist_get_highlighted_item(); + if(curpw){ + snprintf(str, STRING_LONG, "Really delete \"%s\"", curpw->name); + i = ui_statusline_yes_no(str, 0); + if(i){ + pwlist_delete_pw(current_pw_sublist, curpw); + ui_statusline_msg("Password deleted"); + } else { + ui_statusline_msg("Password not deleted"); + } + } + break; + case PW_SUBLIST: + curpwl = uilist_get_highlighted_sublist(); + if(curpwl){ + snprintf(str, STRING_LONG, "Really delete Sublist \"%s\"", curpwl->name); + i = ui_statusline_yes_no(str, 0); + if(i){ + pwlist_delete_sublist(curpwl->parent, curpwl); + ui_statusline_msg("Password Sublist deleted"); + } else { + ui_statusline_msg("Password not deleted"); + } + } + break; + case PW_UPLEVEL: + case PW_NULL: + default: + /* do nothing */ + break; + } + uilist_refresh(); +} + +int +action_list_move_item() +{ + Pw* curpw; + PWList *curpwl, *iter; + int i; + char str[STRING_LONG]; + char answer[STRING_MEDIUM]; + + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + curpw = uilist_get_highlighted_item(); + if(curpw){ + while(1){ + snprintf(str, STRING_LONG, "Move \"%s\" to where?", curpw->name); + ui_statusline_ask_str(str, answer, STRING_MEDIUM); + + /* if user just enters nothing do nothing */ + if(answer[0] == 0){ + return 0; + } + + for(iter = current_pw_sublist->sublists; iter != NULL; iter = iter->next){ + if( strcmp(iter->name, answer) == 0 ){ + pwlist_detach_pw(current_pw_sublist, curpw); + pwlist_add_ptr(iter, curpw); + uilist_refresh(); + return 0; + } + } + ui_statusline_msg("Sublist does not exist, try again"); + getch(); + } + } + break; + case PW_SUBLIST: + curpwl = uilist_get_highlighted_sublist(); + if(curpwl){ + while(1){ + snprintf(str, STRING_LONG, "Move sublist \"%s\" to where?", curpwl->name); + ui_statusline_ask_str(str, answer, STRING_MEDIUM); + + /* if user just enters nothing, do nothing */ + if(answer[0] == 0){ + return 0; + } + if( strcmp(answer, curpwl->name) == 0 ){ + return 0; + } + + for(iter = current_pw_sublist->sublists; iter != NULL; iter = iter->next){ + if( strcmp(iter->name, answer) == 0 ){ + pwlist_detach_sublist(current_pw_sublist, curpwl); + pwlist_add_sublist(iter, curpwl); + uilist_refresh(); + return 0; + } + } + ui_statusline_msg("Sublist does not exist, try again"); + getch(); + } + } + break; + case PW_UPLEVEL: + case PW_NULL: + default: + /* do nothing */ + break; + } +} + +int +action_list_move_item_up_level() +{ + Pw* curpw; + PWList *curpwl, *iter; + int i; + char str[STRING_LONG]; + char answer[STRING_MEDIUM]; + + // Do nothing if searching + if(search_results != NULL) { + return; + } + + // Do the right thing based on type + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + curpw = uilist_get_highlighted_item(); + if(curpw && current_pw_sublist->parent){ + pwlist_detach_pw(current_pw_sublist, curpw); + pwlist_add_ptr(current_pw_sublist->parent, curpw); + uilist_refresh(); + } + break; + case PW_SUBLIST: + curpwl = uilist_get_highlighted_sublist(); + if(curpwl && current_pw_sublist->parent){ + pwlist_detach_sublist(current_pw_sublist, curpwl); + pwlist_add_sublist(current_pw_sublist->parent, curpwl); + uilist_refresh(); + } + break; + case PW_UPLEVEL: + case PW_NULL: + default: + /* do nothing */ + break; + } +} + +int +action_list_up_one_level() +{ + /* move up one sublist */ + if(current_pw_sublist->parent){ + current_pw_sublist = current_pw_sublist->parent; + uilist_refresh(); + } +} + +int +action_list_export() +{ + Pw* curpw; + PWList *curpwl; + + debug("list_export: enter switch"); + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + debug("list_export: is a pw"); + curpw = uilist_get_highlighted_item(); + if(curpw){ + pwlist_export_passwd(curpw); + } + break; + case PW_SUBLIST: + debug("list_export: is a pwlist"); + curpwl = uilist_get_highlighted_sublist(); + if(curpwl){ + pwlist_export_list(curpwl); + } + break; + case PW_UPLEVEL: + case PW_NULL: + default: + /* do nothing */ + break; + } +} + +void _create_information_field(char* name, InputField* field) +{ + field->name = name; + field->value = NULL; + field->max_length = 0; + field->type = INFORMATION; +} + +int +action_list_locate() +{ + int depth = 0, count = 0; + char* currentName; + InputField* fields; + Pw* curpw = NULL; + PWList *curpwl = NULL; + PWList *parent = NULL; + PWSearchResult* cursearch; + + if(search_results != NULL) { + cursearch = uilist_get_highlighted_searchresult(); + curpwl = cursearch->sublist; + curpw = cursearch->entry; + + if(curpw) { + parent = curpwl; + } else { + parent = curpwl->parent; + } + } else { + parent = current_pw_sublist; + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + curpw = uilist_get_highlighted_item(); + break; + case PW_SUBLIST: + curpwl = uilist_get_highlighted_sublist(); + break; + default: + /* do nothing */ + break; + } + } + + if(curpw) { + currentName = curpw->name; + depth = 1; + } else if(curpwl) { + currentName = curpwl->name; + depth = 1; + } + + // Figure out how many parents we have + curpwl = parent; + while(curpwl){ + curpwl = curpwl->parent; + depth++; + } + count = depth; + + // Now grab their names + fields = calloc(sizeof(InputField), depth); + if(currentName){ + depth--; + _create_information_field(currentName, &fields[depth]); + } + curpwl = parent; + while(curpwl){ + depth--; + _create_information_field(curpwl->name, &fields[depth]); + curpwl = curpwl->parent; + } + + // Have it rendered + action_input_dialog(fields, count, "Location of Item"); + + // All done, tidy up + free(fields); +} + +int +action_list_launch() +{ + int i; + Pw* curpw; + char msg[STRING_LONG]; + + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + debug("list_launch: is a pw"); + curpw = uilist_get_highlighted_item(); + if(curpw){ + i = launch(curpw); + snprintf(msg, STRING_LONG, "Application exited with code %d", i); + ui_statusline_msg(msg); + } + break; + case PW_SUBLIST: + case PW_UPLEVEL: + case PW_NULL: + default: + /* do nothing */ + break; + } +} + +int +action_list_read_file() +{ + pwlist_free_all(); + if(pwlist_read_file() != 0){ + pwlist = pwlist_new("Main"); + current_pw_sublist = pwlist; + } + uilist_refresh(); + return -1; +} + +int +action_list_move_item_up() +{ + Pw* curpw; + PWList *curpwl; + int worked = 0; + + // Do nothing if searching + if(search_results != NULL) { + return; + } + + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + curpw = uilist_get_highlighted_item(); + worked = pwlist_change_item_order(curpw, current_pw_sublist, 1); + break; + case PW_SUBLIST: + curpwl = uilist_get_highlighted_sublist(); + worked = pwlist_change_list_order(curpwl, 1); + break; + case PW_UPLEVEL: + case PW_NULL: + default: + /* do nothing */ + break; + } + + if(worked) { + uilist_up(); + } +} + +int +action_list_move_item_down() +{ + Pw* curpw; + PWList *curpwl; + int worked = 0; + + // Do nothing if searching + if(search_results != NULL) { + return; + } + + switch(uilist_get_highlighted_type()){ + case PW_ITEM: + curpw = uilist_get_highlighted_item(); + worked = pwlist_change_item_order(curpw, current_pw_sublist, 0); + break; + case PW_SUBLIST: + curpwl = uilist_get_highlighted_sublist(); + worked = pwlist_change_list_order(curpwl, 0); + break; + case PW_UPLEVEL: + case PW_NULL: + default: + /* do nothing */ + break; + } + + if(worked) { + uilist_down(); + } +} DELETED bootstrap Index: bootstrap ================================================================== --- bootstrap +++ bootstrap @@ -1,5 +0,0 @@ -#!/bin/sh - -aclocal \ -&& automake --gnu --add-missing \ -&& autoconf ADDED config.h Index: config.h ================================================================== --- config.h +++ config.h @@ -0,0 +1,77 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `drand48' function. */ +#define HAVE_DRAND48 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINUX_TERMIOS_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSES_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TERMIOS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Name of package */ +#define PACKAGE "pwman" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "pwman" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "pwman 0.4.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "pwman" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.4.4" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.4.4" + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ DELETED config.h.in Index: config.h.in ================================================================== --- config.h.in +++ config.h.in @@ -1,76 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the `drand48' function. */ -#undef HAVE_DRAND48 - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_TERMIOS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMIOS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define to `unsigned int' if does not define. */ -#undef size_t ADDED config.mk Index: config.mk ================================================================== --- config.mk +++ config.mk @@ -0,0 +1,20 @@ +# PWman version +VERSION = 0.4.4 + +# Customize below to fit your system + +# paths +PREFIX = /usr/local +MANPREFIX = ${PREFIX}/share/man + +# includes and libs +INCS = -I. -I/usr/include -I/usr/pkg/include `xml2-config --cflags` `libgcrypt-config --cflags` +LIBS = -L/usr/lib -lc -lcurses `xml2-config --libs` `libgcrypt-config --libs` + +# flags +CPPFLAGS = -DVERSION=\"${VERSION}\" -D_GNU_SOURCE +CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS} +LDFLAGS = -s ${LIBS} + +# compiler and linker +CC = cc DELETED configure.ac Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1,107 +0,0 @@ -# Process this file with autoconf to produce a configure script. -AC_INIT(pwman, 0.4.4) -AC_CONFIG_SRCDIR([src/ui.c]) -AM_INIT_AUTOMAKE -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([pwman.spec]) - -# Checks for programs. -AC_PROG_CC -AC_SEARCH_LIBS([strerror],[cposix]) - -AC_CHECK_HEADERS(unistd.h locale.h termios.h linux/termios.h sys/ioctl.h string.h) - -AC_CHECK_FUNCS(drand48) -AC_CHECK_LIB(c, strcasestr, CFLAGS="$CFLAGS -DHAVE_STRCASESTR" ) -# Checks for libraries. -dnl ------------------- -dnl ncurses detection -dnl ------------------- - -curses_loc=/usr -AC_ARG_WITH(curses, [ --with-ncurses=PATH Where ncurses is installed ], - [if test $withval != yes; then - curses_loc=$withval - fi - if test x$curses_loc != x/usr; then - LDFLAGS="-L${curses_loc}/lib $LDFLAGS" - CPPFLAGS="$CPPFLAGS -I${curses_loc}/include" - fi]) - -AC_CHECK_LIB(curses, initscr, - [LIBS="$LIBS -lcurses" - if test x$curses_loc = x/usr -a -d /usr/include/ncurses; then - CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses" - fi - AC_CHECK_HEADERS(ncurses.h)], - [ echo "*************************************************************" - echo " ncurses not found. " - echo " Set path to ncurses install with --with-ncurses" - echo "*************************************************************" - exit]) - -dnl -dnl Checks for libxml2 -dnl -AC_ARG_WITH(libxml2, - [ --with-libxml2=PFX Prefix where libxml is installed ], - libxml2_loc="$withval", libxml2_loc="") - -if test x$libxml2_loc != x ; then - if test x${XML2_CONFIG+set} != xset ; then - XML2_CONFIG=$libxml2_loc/bin/xml2-config - fi -fi - -AC_PATH_PROG(XML2_CONFIG, xml2-config, no) - -if test "$XML2_CONFIG" = "no" ; then - echo "*************************************************************" - echo " libxml2 not found. " - echo " It may not be installed or may be in a installed in a " - echo " location other than /usr" - echo " Set path to libxml2 install with --with-libxml2" - echo "*************************************************************" - exit -else - XML_CFLAGS=`$XML2_CONFIG $libxml2_args --cflags` - XML_LIBS=`$XML2_CONFIG $libxml2_args --libs` -fi - - -LIBS="$LIBS $XML_LIBS"; -CFLAGS="$CFLAGS $XML_CFLAGS"; - -dnl -dnl Debugging -dnl -AC_ARG_WITH(debug, - [ --with-debug Turn on Debugging ], - [ LIBS="$LIBS -ggdb" - CFLAGS="$CFLAGS -DDEBUG" - echo "* Debugging is On *" ], - echo "* Debugging is Off *") - -AC_SUBST(CFLAGS) -AC_SUBST(CPPFLAGS) -AC_SUBST(LDFLAGS) - -dnl -------------------------- -dnl end of xml detection -dnl -------------------------- - -AC_SUBST(CFLAGS) -AC_SUBST(CPPFLAGS) -AC_SUBST(LDFLAGS) - -# Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS([string.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_TYPE_SIZE_T - -# Checks for library functions. - -AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile]) -AC_OUTPUT ADDED convert_pwdb.c Index: convert_pwdb.c ================================================================== --- convert_pwdb.c +++ convert_pwdb.c @@ -0,0 +1,502 @@ +/* + * Convert_PWDB - Convert old pwman files into the new format + * + * Copyright (C) 2002 Ivan Kelly + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#define STR_LEN 255 +#define CONVERT_DB_PACKAGE "Convert_PWDB" +#define CONVERT_DB_VERSION "0.1.0" + +#include +#include +#include +#include + +static void show_version(); +static void show_usage(char*); + +struct ConvertDB_Options { + char *gpg_id; + char *infile; + char *outfile; +} convertdb_options; + +int export = 0; + +void +debug(char *fmt, ... ) +{ +#ifdef DEBUG + va_list ap; + int d, c; + char *s; + + fputs("Convert_PWDB Debug% ", stderr); + + va_start(ap, fmt); + while(*fmt){ + if(*fmt == '%'){ + switch(*++fmt){ + case 's': /* string */ + s = va_arg(ap, char*); + fputs(s, stderr); + break; + case 'd': /* int */ + d = va_arg(ap, int); + fprintf(stderr, "%d", d); + break; + case 'c': /* char */ + c = va_arg(ap, int); + fputc(c, stderr); + break; + default: + fputc('%', stderr); + fputc(*fmt, stderr); + break; + } + } else { + fputc(*fmt, stderr); + } + *fmt++; + } + va_end(ap); + fputc('\n', stderr); +#endif +} + +PWList * +new_pwlist(char *name) +{ + PWList *new; + new = malloc( sizeof(PWList) ); + new->name = malloc(STRING_MEDIUM); + strncpy(new->name, name, STRING_MEDIUM); + new->parent = NULL; + new->list = NULL; + new->sublists = NULL; + debug("new_pwlist: %s", name); + + return new; +} + +int +free_pwlist(PWList *old) +{ + Pw *current, *next; + PWList *curlist, *nlist; + + if(old == NULL){ + return 0; + } + for(current = old->list; current != NULL; current = next){ + next = current->next; + + free_pw(current); + } + for(curlist = old->sublists; curlist != NULL; curlist = nlist){ + nlist = curlist->next; + + free_pwlist(curlist); + } + + free(old->name); + free(old); + old = NULL; + return 0; +} + +Pw* +new_pw() +{ + Pw *new; + new = malloc(sizeof(Pw)); + new->id = 0; + new->name = malloc(STRING_MEDIUM); + new->host = malloc(STRING_MEDIUM); + new->user = malloc(STRING_MEDIUM); + new->passwd = malloc(STRING_SHORT); + new->launch = malloc(STRING_LONG); + + memset(new->name, 0, STRING_MEDIUM); + memset(new->host, 0, STRING_MEDIUM); + memset(new->user, 0, STRING_MEDIUM); + memset(new->passwd, 0, STRING_SHORT); + memset(new->launch, 0, STRING_LONG); + + return new; +} + +int +free_pw(Pw *old) +{ + free(old->name); + free(old->user); + free(old->host); + free(old->passwd); + free(old->launch); + free(old); +} + +int +add_pw_ptr(PWList *list, Pw *new) +{ + Pw *current; + + if(list == NULL){ + debug("add_pw_ptr : Bad PwList"); + return -1; + } + if(new == NULL){ + debug("add_pw_ptr : Bad Pw"); + return -1; + } + if(list->list == NULL){ + list->list = new; + new->next = NULL; + return 0; + } + + debug("add_pw_ptr: add to list"); + current = list->list; + while(current->next != NULL){ + current = current->next; + } + current->next = new; + new->next = NULL; + + return 0; +} + + +int +write_password_node(xmlNodePtr root, Pw *pw) +{ + xmlNodePtr node; + + node = xmlNewChild(root, NULL, (xmlChar*)"PwItem", NULL); + xmlNewChild(node, NULL, (xmlChar*)"name", (xmlChar*)pw->name); + xmlNewChild(node, NULL, (xmlChar*)"host", (xmlChar*)pw->host); + xmlNewChild(node, NULL, (xmlChar*)"user", (xmlChar*)pw->user); + xmlNewChild(node, NULL, (xmlChar*)"passwd", (xmlChar*)pw->passwd); + xmlNewChild(node, NULL, (xmlChar*)"launch", (xmlChar*)pw->launch); +} + +int +write_pwlist(xmlNodePtr parent, PWList *pwlist) +{ + xmlNodePtr node; + Pw* iter; + + node = xmlNewChild(parent, NULL, (xmlChar*)"PwList", NULL); + xmlSetProp(node, (xmlChar*)"name", (xmlChar*)pwlist->name); + + for(iter = pwlist->list; iter != NULL; iter = iter->next){ + write_password_node(node, iter); + } +} + +xmlDocPtr +write_new_doc(PWList *pwlist) +{ + char vers[5]; + xmlDocPtr doc; + xmlNodePtr root; + + if(pwlist == NULL){ + puts("write_new_doc: bad password data"); + exit(-1); + } + snprintf(vers, 5, "%d", FF_VERSION); + doc = xmlNewDoc((xmlChar*)"1.0"); + + if(!export){ + root = xmlNewDocNode(doc, NULL, (xmlChar*)"PWMan_PasswordList", NULL); + xmlSetProp(root, "version", vers); + write_pwlist(root, pwlist); + } else { + root = xmlNewDocNode(doc, NULL, (xmlChar*)"PWMan_Export", NULL); + xmlSetProp(root, "version", vers); + write_password_node(root, pwlist->list); + } + + xmlDocSetRootElement(doc, root); + + return doc; +} + +Pw * +read_pw_node(xmlNodePtr parent) +{ + Pw *new; + xmlNodePtr node; + char *text; + + new = new_pw(); + + for(node = parent->children; node != NULL; node = node->next){ + if(!node || !node->name){ + debug("read_pw_node: fucked node"); + } else if( strcmp((char*)node->name, "name") == 0){ + text = (char*)xmlNodeGetContent(node); + if(text) strncpy(new->name, text, STRING_MEDIUM); + } else if( strcmp((char*)node->name, "user") == 0){ + text = (char*)xmlNodeGetContent(node); + if(text) strncpy(new->user, text, STRING_MEDIUM); + } else if( strcmp((char*)node->name, "passwd") == 0){ + text = (char*)xmlNodeGetContent(node); + if(text) strncpy(new->passwd, text, STRING_SHORT); + } else if( strcmp((char*)node->name, "host") == 0){ + text = (char*)xmlNodeGetContent(node); + if(text) strncpy(new->host, text, STRING_MEDIUM); + } else if( strcmp((char*)node->name, "launch") == 0){ + text = (char*)xmlNodeGetContent(node); + if(text) strncpy(new->launch, text, STRING_LONG); + } else { + debug("read_pw_node: unrecognised node \"%s\"", node->name); + } + } + return new; +} + +PWList* +parse_old_doc(xmlDocPtr doc) +{ + PWList *pwlist; + Pw *pw; + xmlNodePtr root, node; + + pwlist = new_pwlist("Main"); + + if(!doc){ + debug("parse_old_doc: Bad xmlDocPtr"); + return NULL; + } + root = xmlDocGetRootElement(doc); + + if(!root || !root->name){ + debug("parse_old_doc: Badly formed data"); + return NULL; + } + if( strcmp(root->name, "PWMan_Export") == 0){ + export = 1; + } else if( strcmp(root->name, "PWMan_List") == 0){ + export = 0; + } else { + debug("parse_old_doc: Not a pwman file"); + return NULL; + } + for(node = root->children; node != NULL; node = node->next){ + if(!node || !node->name){ + debug("parse_old_doc: Bad xml Node"); + } else if( strcmp((char*)node->name, "PW_Item") == 0){ + pw = read_pw_node(node); + add_pw_ptr(pwlist, pw); + } else { + debug("parse_old_doc: Unrecognised xml Node - \"%s\"", node->name); + } + } + + if(pwlist->list){ + return pwlist; + } else { + fputs("Unrecognised file format\n", stderr); + exit(-1); + } +} + +char * +add_to_buf(char *buf, char *new) +{ + size_t size; + + if(new == NULL){ + return buf; + } + if(buf == NULL){ + buf = malloc(strlen(new)+1); + strncpy(buf, new, strlen(new)+1); + return buf; + } + + size = strlen(buf) + strlen(new) + 1; + buf = (char*)realloc(buf, size); + strncat(buf, new, size); + + return buf; +} + +xmlDocPtr +get_data() +{ + FILE *fp; + char *cmd; + char *data; + char buf[STR_LEN]; + xmlDocPtr doc; + + data = NULL; + cmd = malloc(STR_LEN); + snprintf(cmd, STR_LEN, "gpg -d %s", convertdb_options.infile); + debug(cmd); + fp = popen(cmd, "r"); + + while( fgets(buf, STR_LEN, fp) != NULL ){ + data = add_to_buf(data, buf); + } + pclose(fp); + + if(!data){ + exit(-1); + } + + doc = xmlParseMemory(data, strlen(data)); + + return doc; +} + +void +put_data(xmlDocPtr doc) +{ + FILE *fp; + char *cmd; + + cmd = malloc(STR_LEN); + snprintf(cmd, STR_LEN, "gpg -e -r %s -o %s", convertdb_options.gpg_id, convertdb_options.outfile); + debug(cmd); + fp = popen(cmd, "w"); + +#if XML_VERSION >= 20423 + xmlDocFormatDump(fp, doc, TRUE); +#else + xmlDocDump(fp, doc); +#endif + + pclose(fp); +} + +void +free_convertdb_options() +{ + free(convertdb_options.infile); + free(convertdb_options.outfile); + free(convertdb_options.gpg_id); +} + +char * +ask(char *msg) +{ + char * input; + + input = malloc(STR_LEN); + + fputs(msg, stdout); + fputc('\t', stdout); + fgets(input, STR_LEN, stdin); + + input[ strlen(input) - 1] = 0; + + return input; +} + +void +get_options(int argc, char *argv[]) +{ + int i; + + for(i = 0; i < argc; i++){ + if( !strcmp(argv[i], "--help") || !strcmp(argv[i], "-h") ){ + show_usage(argv[0]); + exit(1); + } else if( !strcmp(argv[i], "--version") || !strcmp(argv[i], "-v") ){ + show_version(); + exit(1); + } + } + + if(argc > 1){ + convertdb_options.gpg_id = malloc(STR_LEN); + strncpy(convertdb_options.gpg_id, argv[1], STR_LEN); + } else { + convertdb_options.gpg_id = ask("ID to encrypt new file to:"); + } + if(argc > 2){ + convertdb_options.infile = malloc(STR_LEN); + strncpy(convertdb_options.infile, argv[2], STR_LEN); + } else { + convertdb_options.infile = ask("File in old format:"); + } + if(argc > 3){ + convertdb_options.outfile = malloc(STR_LEN); + strncpy(convertdb_options.outfile, argv[3], STR_LEN); + } else { + convertdb_options.outfile = ask("File to write new format to:"); + } +} + +int +main(int argc, char *argv[]) +{ + xmlDocPtr doc; + PWList *pwlist; + + get_options(argc, argv); + + doc = get_data(); + pwlist = parse_old_doc(doc); + xmlFreeDoc(doc); + + doc = write_new_doc(pwlist); + put_data(doc); + xmlFreeDoc(doc); + + free_convertdb_options(); + return 0; +} + +static void +show_version() +{ + puts(CONVERT_DB_PACKAGE " v " CONVERT_DB_VERSION); + puts("Written by Ivan Kelly \n"); + puts("Copyright (C) 2002 Ivan Kelly"); + puts("This program is free software; you can redistribute it and/or modify"); + puts("it under the terms of the GNU General Public License as published by"); + puts("the Free Software Foundation; either version 2 of the License, or"); + puts("(at your option) any later version.\n"); + + puts("This program is distributed in the hope that it will be useful,"); + puts("but WITHOUT ANY WARRANTY; without even the implied warranty of"); + puts("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"); + puts("GNU General Public License for more details.\n"); + + puts("You should have received a copy of the GNU General Public License"); + puts("along with this program; if not, write to the Free Software"); + puts("Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.\n"); +} + +static void +show_usage(char *argv_0) +{ + printf("Usage: %s [ [ []]]\n", argv_0); + puts("Convert Password Database from PWMan versions >= 0.2.1 to new format 0.3.0+\n"); + puts(" --help show usage"); + puts(" --version display version information"); + puts(" GnuPG ID to encrypt new password database to"); + puts(" password database file in old format"); + puts(" password database file to write in new format\n\n"); + puts("Report bugs to "); +} DELETED debian/changelog Index: debian/changelog ================================================================== --- debian/changelog +++ debian/changelog @@ -1,13 +0,0 @@ -pwman (0.4.4-1) unstable; urgency=low - * Add "Locate" support to easily see where in the tree an item lives - -- Nick Burch Tue, 15 Feb 2011 22:24:00 +0000 - -pwman (0.4.3-1) unstable; urgency=low - * Improved handling of spaces and tabs - * Common exporter to tidy code - * Various bug fixes and compiler warning fixes - -- Nick Burch Sat, 29 Jan 2011 23:07:00 +0000 - -pwman (0.4.0-1) unstable; urgency=low - * Initial release - -- Nick Burch Thu, 03 Dec 2009 16:36:09 +0000 DELETED debian/control Index: debian/control ================================================================== --- debian/control +++ debian/control @@ -1,15 +0,0 @@ -Source: pwman -Section: unknown -Priority: extra -Maintainer: Nick Burch -Build-Depends: debhelper (>= 7), autotools-dev, libxml2-dev, libncurses5-dev -Depends: gnupg, libxml2, libncureses5 -Standards-Version: 3.7.3 -Homepage: http://pwman.sourceforge.net/ - -Package: pwman -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: A password manager which uses gpg to safeguard your data - PWMan is a password manager which uses gpg encryption to safeguard your data. - Some code has been taken from Jaakko Heinonen's abook. DELETED debian/copyright Index: debian/copyright ================================================================== --- debian/copyright +++ debian/copyright @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. DELETED debian/rules Index: debian/rules ================================================================== --- debian/rules +++ debian/rules @@ -1,105 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) -CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) -else -CROSS= --build $(DEB_BUILD_GNU_TYPE) -endif - - - -config.status: configure - dh_testdir - # Add here commands to configure the package. -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" - - -build: build-stamp - -build-stamp: config.status - dh_testdir - - # Add here commands to compile the package. - $(MAKE) - #docbook-to-man debian/pwman.sgml > pwman.1 - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp - - # Add here commands to clean up after the build process. - [ ! -f Makefile ] || $(MAKE) distclean - rm -f config.sub config.guess - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/pwman. - $(MAKE) DESTDIR=$(CURDIR)/debian/pwman install - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs ChangeLog - dh_installdocs - dh_installexamples -# dh_install -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_python -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms -# dh_perl -# dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install DELETED doc/Makefile.am Index: doc/Makefile.am ================================================================== --- doc/Makefile.am +++ doc/Makefile.am @@ -1,8 +0,0 @@ -EXTRA_DIST = pwman.1 - -install-data-local: - $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 - $(INSTALL_DATA) $(srcdir)/pwman.1 $(DESTDIR)$(mandir)/man1/ - -uninstall-local: - -rm -f $(DESTDIR)$(mandir)/man1/pwman.1 DELETED doc/pwman.1 Index: doc/pwman.1 ================================================================== --- doc/pwman.1 +++ doc/pwman.1 @@ -1,44 +0,0 @@ -.TH PWMAN 1 "March 26, 2002" -.nh -.SH NAME -pwman \- curses based password storage program -.SH SYNOPSIS -.B pwman -[ \fB--help\fP | \fB--version\fP | \fB--gpg-path \fP | \fB--gpg-id\fP | \fB--file\fP | \fB--passphrase-timeout