diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-03-29 22:56:16 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-03-29 22:56:16 +0000 |
commit | 9b2ad3c23def89c7d4195d641a433878d9329660 (patch) | |
tree | f9efc108b1f80d25140a9e57d732551ca1f8c2de | |
parent | 9115735709c570347236bccbe34ddc8fe6e6e8dc (diff) |
autoconf stuff
git-svn-id: file:///home/lennart/svn/public/fusedav/trunk@5 e35a362c-bbd6-0310-a59f-a4efcb1729c4
-rw-r--r-- | Makefile.am | 40 | ||||
-rwxr-xr-x | bootstrap.sh | 45 | ||||
-rw-r--r-- | configure.ac | 102 | ||||
-rw-r--r-- | doc/Makefile.am | 35 | ||||
-rw-r--r-- | doc/README.html.in | 104 | ||||
-rw-r--r-- | doc/style.css | 32 | ||||
-rw-r--r-- | src/Makefile | 13 | ||||
-rw-r--r-- | src/Makefile.am | 28 | ||||
-rw-r--r-- | src/filecache.c | 2 | ||||
-rw-r--r-- | src/session.c | 3 |
10 files changed, 388 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..a5c2099 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,40 @@ +# $Id$ + +# This file is part of fusedav. +# +# fusedav 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. +# +# fusedav 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 fusedav; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +EXTRA_DIST=bootstrap.sh README LICENSE +SUBDIRS=src doc + +MAINTAINERCLEANFILES = README +noinst_DATA = README + +README: + rm -f README + $(MAKE) -C doc README + cd $(srcdir) && ln -s doc/README README + +homepage: all dist + test -d $$HOME/homepage/private + mkdir -p $$HOME/homepage/private/projects/fusedav + cp *.tar.gz $$HOME/homepage/private/projects/fusedav + cp doc/README.html doc/style.css $$HOME/homepage/private/projects/fusedav + cp $$HOME/homepage/private/projects/fusedav/README.html $$HOME/homepage/private/projects/fusedav/index.html + +distcleancheck: + @: + +.PHONY: homepage distcleancheck diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..2ff93b4 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# $Id$ + +# This file is part of fusedav. +# +# fusedav 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. +# +# fusedav 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 fusedav; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +run_versioned() { + local P + type -p "$1-$2" &> /dev/null && P="$1-$2" || local P="$1" + + shift 2 + "$P" "$@" +} + +if [ "x$1" = "xam" ] ; then + set -ex + run_versioned automake 1.7 -a -c + ./config.status +else + set -ex + rm -rf autom4te.cache + rm -f config.cache + + run_versioned aclocal 1.7 + autoheader + run_versioned automake 1.7 -a -c + autoconf -Wall + + ./configure --sysconfdir=/etc "$@" + + make clean +fi diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..883904b --- /dev/null +++ b/configure.ac @@ -0,0 +1,102 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +# $Id$ + +# This file is part of fusedav. +# +# fusedav 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. +# +# fusedav 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 fusedav; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +AC_PREREQ(2.59) +AC_INIT([fusedav],[0.1],[mzshfrqni (at) 0pointer (dot) de]) +AC_CONFIG_SRCDIR([src/fusedav.c]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([foreign -Wall]) +AC_REVISION($Id$) + +AC_SUBST(PACKAGE_URL, [http://0pointer.de/lennart/projects/fusedav/]) + +if type -p stow > /dev/null && test -d /usr/local/stow ; then + AC_MSG_NOTICE([*** Found /usr/local/stow: default install prefix set to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***]) + ac_default_prefix="/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}" +fi + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +# If using GCC specifiy some additional parameters +if test "x$GCC" = "xyes" ; then + CFLAGS="$CFLAGS -pipe -Wall -ansi" +fi + +# 64 Bit LFS support +AC_SYS_LARGEFILE + +# Checks for header files. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS([fcntl.h limits.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/time.h syslog.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_PID_T +AC_HEADER_TIME +AC_C_VOLATILE + +# Checks for library functions. +AC_FUNC_FORK +AC_PROG_GCC_TRADITIONAL +AC_FUNC_SELECT_ARGTYPES +AC_FUNC_MALLOC +AC_TYPE_SIGNAL +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([alarm dup2 memset select setenv socket strchr strdup strerror strrchr strspn]) + +NEON_REQUIRE(0,24) +NEON_LIBRARY +NEON_WARNINGS + +# FUSE +AC_CHECK_HEADER(fuse.h,, [AC_MSG_ERROR([ *** fuse.h not found *** ])]) +AC_CHECK_LIB(fuse,fuse_main, [FUSE_LIBS="-lfuse"], [AC_MSG_ERROR([ *** libfuse.a not found *** ])], -lpthread) + +AC_SUBST(FUSE_LIBS) + +# LYNX documentation generation +AC_ARG_ENABLE(lynx, + AS_HELP_STRING(--disable-lynx,Turn off lynx usage for documentation generation), +[case "${enableval}" in + yes) lynx=yes ;; + no) lynx=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --disable-lynx) ;; +esac],[lynx=yes]) + +if test x$lynx = xyes ; then + AC_CHECK_PROG(have_lynx, lynx, yes, no) + + if test x$have_lynx = xno ; then + AC_MSG_ERROR([*** Sorry, you have to install lynx or use --disable-lynx ***]) + fi +fi + +AM_CONDITIONAL([USE_LYNX], [test "x$lynx" = xyes]) + +AC_CONFIG_FILES([src/Makefile Makefile doc/Makefile doc/README.html]) +AC_OUTPUT diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..c2ab518 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,35 @@ +# $Id$ + +# This file is part of fusedav. +# +# fusedav 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. +# +# fusedav 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 fusedav; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +noinst_DATA = README.html README +EXTRA_DIST = $(noinst_DATA) style.css README.html.in + +MAINTAINERCLEANFILES = README README.html +CLEANFILES = + +if USE_LYNX +README: README.html + lynx --dump $^ | sed 's,file://localhost/.*/doc/README.html,README,' > $@ + +CLEANFILES += README +endif + +tidy: README.html + tidy -e < README.html + +.PHONY: tidy diff --git a/doc/README.html.in b/doc/README.html.in new file mode 100644 index 0000000..ec97095 --- /dev/null +++ b/doc/README.html.in @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="iso-8859-15"?> <!-- -*-nxml-*- --> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + + <head> + <title>fusedav @PACKAGE_VERSION@</title> + <link rel="stylesheet" type="text/css" href="style.css" /> + </head> + + <body> + <h1><a name="top">fusedav @PACKAGE_VERSION@</a></h1> + + <p><i>Copyright 2004 Lennart Poettering <@PACKAGE_BUGREPORT@></i></p> + + <ul class="toc"> + <li><a href="#license">License</a></li> + <li><a href="#news">News</a></li> + <li><a href="#overview">Overview</a></li> + <li><a href="#status">Status</a></li> + <li><a href="#documentation">Documentation</a></li> + <li><a href="#requirements">Requirements</a></li> + <li><a href="#installation">Installation</a></li> + <li><a href="#acks">Acknowledgements</a></li> + <li><a href="#download">Download</a></li> + </ul> + + <h2><a name="license">License</a></h2> + + <p>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.</p> + + <p>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.</p> + + <p>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., 675 Mass Ave, Cambridge, MA 02139, USA.</p> + + <h2><a name="news">News</a></h2> + + <div class="news-date">Tue Mar 30 2004: </div> <p class="news-text"><a + href="@PACKAGE_URL@fusedav-0.1.tar.gz">Version 0.1</a> released, initial release</p> + + <h2><a name="overview">Overview</a></h2> + + <p><tt>fusedav</tt> is a Linux userspace file system driver for mounting + <a href="http://www.webdav.org/">WebDAV</a> shares. It makes use + of <a href="http://sourceforge.net/projects/avf/">FUSE</a> as userspace file system + API and <a href="http://www.webdav.org/neon/">neon</a> as WebDAV API.</p> + + <h2><a name="status">Status</a></h2> + + <p>Version @PACKAGE_VERSION@ works fine. There is no support for modifying file dates an access rights yet.</p> + + <h2><a name="documentation">Documentation</a></h2> + + <p>After installation just run <tt>fusedav</tt> with two arguments: the WevDAV URL and the local mount point:</p> + + <pre>fusedav http://webdav.foo.bar/ /tmp/test</pre> + + <p>You will be queried for a username and password if required. As long as the <tt>fusedav</tt> process is running, the file system is accessible under <tt>/tmp/test</tt>.</p> + + <h2><a name="requirements">Requirements</a></h2> + + <p><tt>fusedav</tt> was developed and tested on Debian GNU/Linux + "testing" from March 2004, it should work on most other Linux + distributions since it uses GNU autoconf for source code + configuration.</p> + + <p><tt>fusedav</tt> requires the <a href="http://www.webdav.org/neon/">neon</a> and <a href="http://sourceforge.net/projects/avf/">FUSE</a> development + library files for compilation.</p> + + <h2><a name="installation">Installation</a></h2> + + <p>As this package is made with the GNU autotools you should run + <tt>./configure</tt> inside the distribution directory for configuring + the source tree. After that you should run <tt>make</tt> for + compilation and <tt>make install</tt> (as root) for installation of + <tt>fusedav</tt>.</p> + + <h2><a name="acks">Acknowledgements</a></h2> + + <p>Milos Szeredi for developing FUSE and some useful hints for its usage</p> + + <h2><a name="download">Download</a></h2> + + <p>The newest release is always available from <a href="@PACKAGE_URL@">@PACKAGE_URL@</a></p> + + <p>The current release is <a href="@PACKAGE_URL@fusedav-@PACKAGE_VERSION@.tar.gz">@PACKAGE_VERSION@</a></p> + + <p>Get <tt>fusedav</tt>'s development sources from the <a href="http://subversion.tigris.org/">Subversion</a> <a href="https://seth.intheinter.net:8081/svn/fusedav/">repository</a>.</p> + + <p>If you want to be notified whenever I release a new version of this software use the subscription feature of <a href="http://freshmeat.net/projects/fusedav/">Freshmeat</a>.</p> + + <hr/> + <address class="grey">Lennart Poettering <@PACKAGE_BUGREPORT@>, March 2004</address> + <div class="grey"><i>$Id$</i></div> + + </body> +</html> diff --git a/doc/style.css b/doc/style.css new file mode 100644 index 0000000..c683c7c --- /dev/null +++ b/doc/style.css @@ -0,0 +1,32 @@ +/* $Id$ */ + +/*** + * This file is part of fusedav. + * + * fusedav 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. + * + * fusedav 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 fusedav; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + ***/ + +body { color: black; background-color: white; margin: 0.5cm; } +a:link, a:visited { color: #900000; } +p { margin-left: 0.5cm; margin-right: 0.5cm; } +div.news-date { margin-left: 0.5cm; font-size: 80%; color: #4f0000; } +p.news-text { margin-left: 1cm; } +h1 { color: #00009F; } +h2 { color: #00009F; } +h3 { color: #00004F; margin-left: 0.5cm; } +ul { margin-left: .5cm; } +ol { margin-left: .5cm; } +pre { margin-left: .5cm; background-color: #f0f0f0; padding: 0.4cm;} +.grey { color: #afafaf; } diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index e0dca3b..0000000 --- a/src/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -CC=gcc -CFLAGS=-g -Wall -pipe -O0 -I/usr/include/neon -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -ansi -LIBS=/usr/lib/libfuse.a -lpthread -lneon - -all: fusedav - -fusedav: fusedav.o statcache.o filecache.o session.o openssl-thread.o - $(CC) -o $@ $^ $(LIBS) - -clean: - rm -f *.o fusedav - -.PHONY: clean all diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..0221fc5 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,28 @@ +# $Id$ + +# This file is part of fusedav. +# +# fusedav 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. +# +# fusedav 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 fusedav; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +bin_PROGRAMS=fusedav + +fusedav_SOURCES=fusedav.c fusedav.h \ + statcache.c statcache.h \ + filecache.c filecache.h \ + session.c session.h \ + openssl-thread.c openssl-thread.h + +fusedav_CFLAGS = $(AM_CFLAGS) -D_GNU_SOURCE $ +fusedav_LDADD = -lpthread $(NEON_LIBS) $(FUSE_LIBS) diff --git a/src/filecache.c b/src/filecache.c index 429385d..d4d3a26 100644 --- a/src/filecache.c +++ b/src/filecache.c @@ -137,7 +137,7 @@ void* file_cache_open(const char *path, int flags) { struct file_info *fi; char tempfile[PATH_MAX]; char *length = NULL; - ne_request *req; + ne_request *req = NULL; ne_session *session; if ((fi = file_cache_get(path))) { diff --git a/src/session.c b/src/session.c index e4780e9..4f1009b 100644 --- a/src/session.c +++ b/src/session.c @@ -33,8 +33,7 @@ static pthread_mutex_t credential_mutex = PTHREAD_MUTEX_INITIALIZER; static char* ask_user(char *p, int hidden) { char q[256], *r; struct termios t; - int c, l; - + int c = 0, l; if (hidden) { if (!isatty(fileno(stdin))) |