From 9b2ad3c23def89c7d4195d641a433878d9329660 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 29 Mar 2004 22:56:16 +0000 Subject: [PATCH] autoconf stuff git-svn-id: file:///home/lennart/svn/public/fusedav/trunk@5 e35a362c-bbd6-0310-a59f-a4efcb1729c4 --- Makefile.am | 40 +++++++++++++++++ bootstrap.sh | 45 ++++++++++++++++++++ configure.ac | 102 ++++++++++++++++++++++++++++++++++++++++++++ doc/Makefile.am | 35 +++++++++++++++ doc/README.html.in | 104 +++++++++++++++++++++++++++++++++++++++++++++ doc/style.css | 32 ++++++++++++++ src/Makefile | 13 ------ src/Makefile.am | 28 ++++++++++++ src/filecache.c | 2 +- src/session.c | 3 +- 10 files changed, 388 insertions(+), 16 deletions(-) create mode 100644 Makefile.am create mode 100755 bootstrap.sh create mode 100644 configure.ac create mode 100644 doc/Makefile.am create mode 100644 doc/README.html.in create mode 100644 doc/style.css delete mode 100644 src/Makefile create mode 100644 src/Makefile.am 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 @@ + + + + + + fusedav @PACKAGE_VERSION@ + + + + +

fusedav @PACKAGE_VERSION@

+ +

Copyright 2004 Lennart Poettering <@PACKAGE_BUGREPORT@>

+ + + +

License

+ +

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., 675 Mass Ave, Cambridge, MA 02139, USA.

+ +

News

+ +
Tue Mar 30 2004:

Version 0.1 released, initial release

+ +

Overview

+ +

fusedav is a Linux userspace file system driver for mounting + WebDAV shares. It makes use + of FUSE as userspace file system + API and neon as WebDAV API.

+ +

Status

+ +

Version @PACKAGE_VERSION@ works fine. There is no support for modifying file dates an access rights yet.

+ +

Documentation

+ +

After installation just run fusedav with two arguments: the WevDAV URL and the local mount point:

+ +
fusedav http://webdav.foo.bar/ /tmp/test
+ +

You will be queried for a username and password if required. As long as the fusedav process is running, the file system is accessible under /tmp/test.

+ +

Requirements

+ +

fusedav 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.

+ +

fusedav requires the neon and FUSE development + library files for compilation.

+ +

Installation

+ +

As this package is made with the GNU autotools you should run + ./configure inside the distribution directory for configuring + the source tree. After that you should run make for + compilation and make install (as root) for installation of + fusedav.

+ +

Acknowledgements

+ +

Milos Szeredi for developing FUSE and some useful hints for its usage

+ +

Download

+ +

The newest release is always available from @PACKAGE_URL@

+ +

The current release is @PACKAGE_VERSION@

+ +

Get fusedav's development sources from the Subversion repository.

+ +

If you want to be notified whenever I release a new version of this software use the subscription feature of Freshmeat.

+ +
+
Lennart Poettering <@PACKAGE_BUGREPORT@>, March 2004
+
$Id$
+ + + 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))) -- 2.30.2