# can't emerge davfs2

## nextgen

When I use konqueror as a webdavs client, the files I open are not locked. I need open files to be locked to other remote users.

I am hoping that mounting the webdavs share as a davfs filesystem would allow me to automatically lock the files when I open them. (Is that true?) So I've compiled the kernel with coda support built in and tried to emerge davfs2. No luck...  :Confused:  I can't understand why it doesn't work. Here's the output. Please help.

-nextgen

```
bash-2.05b# emerge net-www/davfs2

Calculating dependencies ...done!

>>> emerge (1 of 1) net-www/davfs2-0.2.1 to /

>>> md5 src_uri ;-) davfs2-0.2.1.tar.gz

>>> Unpacking source...

>>> Unpacking davfs2-0.2.1.tar.gz to /var/tmp/portage/davfs2-0.2.1/work

>>> Source unpacked.

configure: WARNING: If you wanted to set the --build type, don't use --host.

    If a cross compiler is detected then cross compile mode will be used.

checking for i686-pc-linux-gnu-gcc... gcc

checking for C compiler default output... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables...

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking whether make sets ${MAKE}... yes

checking for a BSD-compatible install... /bin/install -c

checking for gcc option to accept ANSI C... none needed

checking for strerror in -lcposix... no

checking for inline... inline

checking for an ANSI C-conforming const... yes

checking how to run the C preprocessor... gcc -E

checking for ANSI C header files... yes

checking for sys/types.h... yes

checking for sys/stat.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for memory.h... yes

checking for strings.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for unistd.h... yes

checking for size_t... yes

checking for off_t... yes

checking for Darwin... no

checking for int... yes

checking size of int... 4

checking for long... yes

checking size of long... 4

checking for long long... yes

checking size of long long... 8

checking for gcc -Wformat -Werror sanity... yes

checking errno.h usability... yes

checking errno.h presence... yes

checking for errno.h... yes

checking stdarg.h usability... yes

checking stdarg.h presence... yes

checking for stdarg.h... yes

checking for string.h... (cached) yes

checking for stdlib.h... (cached) yes

checking for size_t... (cached) yes

checking size of size_t... 4

checking how to print size_t... u

checking for off_t... (cached) yes

checking size of off_t... 4

checking how to print off_t... ld

checking for ssize_t... yes

checking size of ssize_t... 4

checking how to print ssize_t... d

checking whether byte ordering is bigendian... no

checking whether strerror_r is declared... yes

checking for strerror_r... yes

checking whether strerror_r returns char *... yes

checking for snprintf... yes

checking for vsnprintf... yes

checking for i686-pc-linux-gnu-ar... no

checking for ar... /usr/bin/ar

checking for i686-pc-linux-gnu-ranlib... no

checking for ranlib... /usr/bin/ranlib

checking for neon-config... /usr/bin/neon-config

checking linking against neon... yes

checking neon library version... yes

configure: using neon library 0.24.6

checking for getopt_long... yes

checking for snprintf... (cached) yes

checking for pid_t... yes

checking whether time.h and sys/time.h may both be included... yes

checking sys/time.h usability... yes

checking sys/time.h presence... yes

checking for sys/time.h... yes

checking for pipe... yes

checking for isatty... yes

checking for usleep... yes

checking for time_t... yes

checking size of time_t... 4

checking how to print time_t... ld

configure: debugging is enabled

configure: creating ./config.status

config.status: creating Makefile

config.status: creating libneon/Makefile

config.status: creating config.h

Using configuration for building DAVFS2 0.2.1:

  Install prefix:  /usr

  Compiler:        gcc

  neon library:    library in /usr (neon 0.24.6)

  XML parser:      using whatever neon uses

  SSL library:     supported by neon

Now run 'make' to compile DAVFS2

gcc -DHAVE_CONFIG_H  -I/var/tmp/portage/davfs2-0.2.1/work/davfs2-0.2.1 -I./lib  -I/usr/src/linux/include -I./src  -O2 -march=pentium4 -pipe -fomit-frame-pointer -I/usr/include/neon -DNEON_ZLIB -DNEON_SSL -c src/davfsd.c -o src/davfsd.o

gcc -DHAVE_CONFIG_H  -I/var/tmp/portage/davfs2-0.2.1/work/davfs2-0.2.1 -I./lib  -I/usr/src/linux/include -I./src  -O2 -march=pentium4 -pipe -fomit-frame-pointer -I/usr/include/neon -DNEON_ZLIB -DNEON_SSL -c src/mount.c -o src/mount.o

gcc -DHAVE_CONFIG_H  -I/var/tmp/portage/davfs2-0.2.1/work/davfs2-0.2.1 -I./lib  -I/usr/src/linux/include -I./src  -O2 -march=pentium4 -pipe -fomit-frame-pointer -I/usr/include/neon -DNEON_ZLIB -DNEON_SSL -c src/util.c -o src/util.o

gcc -DHAVE_CONFIG_H  -I/var/tmp/portage/davfs2-0.2.1/work/davfs2-0.2.1 -I./lib  -I/usr/src/linux/include -I./src  -O2 -march=pentium4 -pipe -fomit-frame-pointer -I/usr/include/neon -DNEON_ZLIB -DNEON_SSL -c src/webdav.c -o src/webdav.o

(cd libneon && make) || exit 1

make[1]: Entering directory `/var/tmp/portage/davfs2-0.2.1/work/davfs2-0.2.1/libneon'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/var/tmp/portage/davfs2-0.2.1/work/davfs2-0.2.1/libneon'

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/davfsd.c:39:

/usr/src/linux/include/linux/time.h:369:1: warning: "FD_SET" redefined

In file included from /usr/include/sys/types.h:216,

                 from /usr/include/bits/fcntl.h:25,

                 from /usr/include/fcntl.h:33,

                 from src/davfsd.c:23:

/usr/include/sys/select.h:93:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/davfsd.c:39:

/usr/src/linux/include/linux/time.h:370:1: warning: "FD_CLR" redefined

In file included from /usr/include/sys/types.h:216,

                 from /usr/include/bits/fcntl.h:25,

                 from /usr/include/fcntl.h:33,

                 from src/davfsd.c:23:

/usr/include/sys/select.h:94:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/davfsd.c:39:

/usr/src/linux/include/linux/time.h:371:1: warning: "FD_ISSET" redefined

In file included from /usr/include/sys/types.h:216,

                 from /usr/include/bits/fcntl.h:25,

                 from /usr/include/fcntl.h:33,

                 from src/davfsd.c:23:

/usr/include/sys/select.h:95:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/davfsd.c:39:

/usr/src/linux/include/linux/time.h:372:1: warning: "FD_ZERO" redefined

In file included from /usr/include/sys/types.h:216,

                 from /usr/include/bits/fcntl.h:25,

                 from /usr/include/fcntl.h:33,

                 from src/davfsd.c:23:

/usr/include/sys/select.h:96:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/davfsd.c:39:

/usr/src/linux/include/linux/time.h:378:1: warning: "ITIMER_REAL" redefined

In file included from src/davfsd.c:34:

/usr/include/sys/time.h:95:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/davfsd.c:39:

/usr/src/linux/include/linux/time.h:379:1: warning: "ITIMER_VIRTUAL" redefined

In file included from src/davfsd.c:34:

/usr/include/sys/time.h:98:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/davfsd.c:39:

/usr/src/linux/include/linux/time.h:380:1: warning: "ITIMER_PROF" redefined

In file included from src/davfsd.c:34:

/usr/include/sys/time.h:102:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/davfsd.c:39:

/usr/src/linux/include/linux/time.h:412:1: warning: "TIMER_ABSTIME" redefined

In file included from /usr/include/time.h:42,

                 from src/davfsd.c:21:

/usr/include/bits/time.h:55:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/davfsd.c:39:

/usr/src/linux/include/linux/time.h:9: error: redefinition of `struct timespec'

/usr/src/linux/include/linux/time.h:15: error: redefinition of `struct timeval'

/usr/src/linux/include/linux/time.h:20: error: redefinition of `struct timezone'

/usr/src/linux/include/linux/time.h:382: error: redefinition of `struct itimerspec'

/usr/src/linux/include/linux/time.h:387: error: redefinition of `struct itimerval'

src/davfsd.c: In function `setfscred':

src/davfsd.c:128: error: structure has no member named `cred'

src/davfsd.c:129: error: structure has no member named `cred'

src/davfsd.c: At top level:

src/davfsd.c:227: error: syntax error before "id"

src/davfsd.c: In function `look_name':

src/davfsd.c:231: error: `id' undeclared (first use in this function)

src/davfsd.c:231: error: (Each undeclared identifier is reported only once

src/davfsd.c:231: error: for each function it appears in.)

src/davfsd.c:249: error: `is_dir' undeclared (first use in this function)

src/davfsd.c: At top level:

src/davfsd.c:258: error: syntax error before "alloc_vfid"

src/davfsd.c: In function `alloc_vfid':

src/davfsd.c:260: error: `ViceFid' undeclared (first use in this function)

src/davfsd.c:260: error: syntax error before "res"

src/davfsd.c:275: error: `res' undeclared (first use in this function)

src/davfsd.c: At top level:

src/davfsd.c:372: error: syntax error before "id"

src/davfsd.c: In function `get_local_copy':

src/davfsd.c:375: error: `id' undeclared (first use in this function)

src/davfsd.c:379: error: `flags' undeclared (first use in this function)

src/davfsd.c: At top level:

src/davfsd.c:452: error: syntax error before "id"

src/davfsd.c: In function `get_dir_copy':

src/davfsd.c:454: error: `id' undeclared (first use in this function)

src/davfsd.c: At top level:

src/davfsd.c:536: error: syntax error before "id"

src/davfsd.c: In function `unget_local_copy':

src/davfsd.c:539: error: `id' undeclared (first use in this function)

src/davfsd.c: At top level:

src/davfsd.c:629: error: syntax error before "ViceFid"

src/davfsd.c: In function `coda_open':

src/davfsd.c:634: error: `id' undeclared (first use in this function)

src/davfsd.c:635: error: `name' undeclared (first use in this function)

src/davfsd.c:636: error: `out_buf' undeclared (first use in this function)

src/davfsd.c:659: error: `flags' undeclared (first use in this function)

src/davfsd.c:674: error: `in_buf' undeclared (first use in this function)

src/davfsd.c: In function `main':

src/davfsd.c:891: error: incompatible types in assignment

src/davfsd.c:892: error: structure has no member named `Unique'

src/davfsd.c:917: error: structure has no member named `Unique'

src/davfsd.c:955: error: incompatible types in assignment

src/davfsd.c:1048: error: structure has no member named `Unique'

src/davfsd.c:1064: error: incompatible types in assignment

src/davfsd.c:1065: error: structure has no member named `Unique'

src/davfsd.c:1079: error: incompatible types in assignment

make: *** [src/davfsd.o] Error 1

make: *** Waiting for unfinished jobs....

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/mount.c:36:

/usr/src/linux/include/linux/time.h:369:1: warning: "FD_SET" redefined

In file included from /usr/include/sys/types.h:216,

                 from /usr/include/bits/fcntl.h:25,

                 from /usr/include/fcntl.h:33,

                 from src/mount.c:21:

/usr/include/sys/select.h:93:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/mount.c:36:

/usr/src/linux/include/linux/time.h:370:1: warning: "FD_CLR" redefined

In file included from /usr/include/sys/types.h:216,

                 from /usr/include/bits/fcntl.h:25,

                 from /usr/include/fcntl.h:33,

                 from src/mount.c:21:

/usr/include/sys/select.h:94:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/mount.c:36:

/usr/src/linux/include/linux/time.h:371:1: warning: "FD_ISSET" redefined

In file included from /usr/include/sys/types.h:216,

                 from /usr/include/bits/fcntl.h:25,

                 from /usr/include/fcntl.h:33,

                 from src/mount.c:21:

/usr/include/sys/select.h:95:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/mount.c:36:

/usr/src/linux/include/linux/time.h:372:1: warning: "FD_ZERO" redefined

In file included from /usr/include/sys/types.h:216,

                 from /usr/include/bits/fcntl.h:25,

                 from /usr/include/fcntl.h:33,

                 from src/mount.c:21:

/usr/include/sys/select.h:96:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/mount.c:36:

/usr/src/linux/include/linux/time.h:378:1: warning: "ITIMER_REAL" redefined

In file included from src/mount.c:31:

/usr/include/sys/time.h:95:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/mount.c:36:

/usr/src/linux/include/linux/time.h:379:1: warning: "ITIMER_VIRTUAL" redefined

In file included from src/mount.c:31:

/usr/include/sys/time.h:98:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/mount.c:36:

/usr/src/linux/include/linux/time.h:380:1: warning: "ITIMER_PROF" redefined

In file included from src/mount.c:31:

/usr/include/sys/time.h:102:1: warning: this is the location of the previous definition

In file included from /usr/src/linux/include/linux/coda.h:102,

                 from src/mount.c:36:

/usr/src/linux/include/linux/time.h:9: error: redefinition of `struct timespec'

/usr/src/linux/include/linux/time.h:15: error: redefinition of `struct timeval'

/usr/src/linux/include/linux/time.h:20: error: redefinition of `struct timezone'

/usr/src/linux/include/linux/time.h:387: error: redefinition of `struct itimerval'

make: *** [src/mount.o] Error 1

!!! ERROR: net-www/davfs2-0.2.1 failed.

!!! Function src_compile, Line 18, Exitcode 2

!!! (no error message)
```

----------

## curtis119

try cadaver instead of davfs. It's in portage. It supports locking operations.

http://www.webdav.org/cadaver/

----------

## nextgen

Thanks for the idea, but I've tried cadaver already. Correct me If I'm wrong, but with cadaver I need to manually lock the file I wish to use and then manually unlock it when I'm done. Well... as a Gentoo user I'm too lazy to do this and I want a better solution. That's why I wanted to emerge davfs2 to mount the share and I'm hoping files I wish to use will be automatically locked whenever I access them.

From my previous output listing a bunch of error messages, can someone shed some light on why I can't emerge davfs2? I see the first error message has something to do with time.h. Is that the problem? What am I missing?

```
/usr/src/linux/include/linux/time.h:9: error: redefinition of `struct timespec'
```

Thanks for any help.

-nextgen

----------

## Mythos

```
emerge neon davfs2

tar xvfz /usr/portage/distfiles/davfs2.gz

nano /usr/portage/distfiles/davfs2/configure

change to this

if test "$KERNEL" = "no"; then

dnl #FIXME

dnl Kernel include and /usr/include dismatch problem

dnl

        KERNEL_SRC=/usr/src/linux

else

        KERNEL_SRC=$KERNEL

fi

cd /usr/portage/distfiles/davfs2/;./configure;make;make install
```

----------

## nextgen

Hi,

Your suggestion doesn't work. The current configure file already has the code you suggested. (This is davfs2-0.2.1.)

```
if test "$KERNEL" = "no"; then

        KERNEL_SRC=/usr/src/linux

else

        KERNEL_SRC=$KERNEL

fi
```

Then I do

```
./configure;make
```

which burps the same way as my "emerge davfs2" command.

----------

## nextgen

BTW, I've just tried

```
ACCEPT_KEYWORDS="~x86" emerge davfs2
```

which attempts to emerge davfs2-0.2.2. Same story. Please help.

-nextgen

----------

## nextgen

Does this have something to do with my kernel version 2.6.7-gentoo-r6?

----------

## Mythos

```
if test "$KERNEL" = "no"; then

        KERNEL_SRC=/usr/src/linux

else

        KERNEL_SRC=$KERNEL

fi
```

Look for the changes 

```
if test "$KERNEL" = "no"; then

dnl #FIXME

dnl Kernel include and /usr/include dismatch problem

dnl

        KERNEL_SRC=/usr/src/linux

else

        KERNEL_SRC=$KERNEL

fi 
```

Where is the dnl in your configure  :Wink: . modify to what i said to you and it will work for sure.

Here is my Kernel

Linux mythos 2.6.7-gentoo-r6 #2 Wed Jun 30 03:48:09 UTC 2004 i686 AMD Athlon(TM) XP 2200+ AuthenticAMD GNU/Linux

----------

## nextgen

I'm more newbie than I thought...

I've added the dnl stuff, but ./configure doesn't understand what "dnl" means. Now what am I missing?

```
./configure: line 11845: dnl: command not found

./configure: line 11846: dnl: command not found

./configure: line 11847: dnl: command not found
```

----------

## Mythos

```
if test "$KERNEL" = "no"; then

dnl #FIXME

dnl Kernel include and /usr/include dismatch problem

dnl

        KERNEL_SRC=/usr/src/linux

else

        KERNEL_SRC=$KERNEL

fi

```

https://forums.gentoo.org/viewtopic.php?p=971947#971947

I based here to install my davfs2, and it works!

Don' t use accept words !!!!

```
mkdir /etc/portage;echo " net-www/davfs2 ~x86" >> /etc/portage/package.keywords; emerge davfs2
```

Then change the configure.in

----------

## nextgen

```
if test "$KERNEL" = "no"; then 

dnl #FIXME 

dnl Kernel include and /usr/include dismatch problem 

dnl 

        KERNEL_SRC=/usr/src/linux 

else 

        KERNEL_SRC=$KERNEL 

fi
```

That script is already part of the configure.in file after emerging. There's nothing to fix. I think my problem isn't related to this.

----------

## Mythos

Hi have change configure and then i install davfs2. My only problem is to mount i don't know the commands, and hi can't login. Authorization failed  :Sad: 

Use  cadaver, it's nice  :Smile: 

One more question have you installed neon ???

```
emerge neon
```

----------

## nextgen

Here is some progress...

At this site they talk about that bug:

http://sourceforge.net/tracker/index.php?func=detail&aid=680516&group_id=26275&atid=386747

The site points to:

http://patearl.net/projects/davfs2/

where there is a patched version of davfs2 which I could install successfully without changing anything. BTW, I did have neon installed.

Now I need to mount my dav share.

```
bash-2.05b# /usr/local/sbin/mount.davfs http://server/DAVtest/ /mnt/dav

Can't find pid file : /tmp/davfs0.pid

Error opening /dev/davfs0. Error no = 6

Probably, another mount.davfs is running.
```

Hmm... I'm still missing something.   :Confused: 

----------

## curtis119

I found a bug in bugs.gentoo.org that is the exact same problem you guys are having. 

https://bugs.gentoo.org/show_bug.cgi?id=47116

It gives all the advice given here. Sorry I don't have anything else to add to helpout.

----------

## nextgen

BINGO!

I had tried playing around with the kernel config, so I rebooted to make sure I had coda built in the kernel.

Now I can mount my webdav share! The locking seems to work BUT in a suboptimal way. It seems that the davfs mount does not see the locks on the webdav share. Therefore, for example, file version conflicts can still happen in this series of events in chronological order:

-Windows client opens file A on webdav share;

-Linux opens file A on davfs;

-Linux saves and close file A on davfs;

-Windows saves and close file A on webdav share.

In that case, changes of Linux on file A are lost without warning (this is no good).

Anyone knows how to sync the webdav lock with the davfs lock in order to make sure that locked documents can't be open or can be open in read-only mode? I really have to avoid version conflicts.

-nextgen

----------

## curtis119

Yeah!!!

----------

