www/cadaver: Update to 0.26

Use option helpers, localbase and pkgconfig.
Use pkg-plist file.
Add license information.
Pet portlint, portfmt, portclippy.
Switch to DISTVERSION.

PR:		286234
Tested by:	kib
This commit is contained in:
Zsolt Udvari
2025-05-02 21:22:57 +02:00
parent 676f3ba8b2
commit b2485ef7af
4 changed files with 67 additions and 98 deletions
+18 -41
View File
@@ -1,6 +1,5 @@
PORTNAME= cadaver
PORTVERSION= 0.24
PORTREVISION= 1
DISTVERSION= 0.26
CATEGORIES= www
MASTER_SITES= https://notroj.github.io/cadaver/
@@ -8,54 +7,32 @@ MAINTAINER= ports@FreeBSD.org
COMMENT= Commandline client for DAV
WWW= https://notroj.github.io/cadaver/
LIB_DEPENDS= libneon.so:www/neon
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
USES= ssl
LIB_DEPENDS= libexpat.so:textproc/expat2 \
libneon.so:www/neon
USES= cpe localbase:ldflags pkgconfig ssl
CPE_VENDOR= webdav
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-netrc --with-ssl
GNU_CONFIGURE_MANPREFIX= ${PREFIX}/share
PLIST_FILES= bin/cadaver \
share/man/man1/cadaver.1.gz
CONFIGURE_ARGS= --enable-netrc \
--with-ssl
# Neither expat nor libneon are needed at all, but the configure
# script breaks if it can not find the Makefile* in them. Exclude
# them to be sure, a stray .h is not included instead of what's
# found under PREFIX (installed by the neon port):
EXTRACT_AFTER_ARGS= \
--exclude '${PORTNAME}-${PORTVERSION}/lib/expat/*.[ch]' \
--exclude '${PORTNAME}-${PORTVERSION}/lib/intl/*.[ch]' \
--exclude '${PORTNAME}-${PORTVERSION}/lib/neon/*.[ch]' \
--exclude 'glob.[ch]' --exclude 'mkstemp.[ch]' \
--exclude 'tempname.[ch]' --exclude 'basename.[ch]'
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
USES+= cpe
CPE_VENDOR= webdav
EXTRACT_AFTER_ARGS= --exclude '${PORTNAME}-${DISTVERSION}/lib/expat/*.[ch]' \
--exclude '${PORTNAME}-${DISTVERSION}/lib/intl/*.[ch]' \
--exclude '${PORTNAME}-${DISTVERSION}/lib/neon/*.[ch]' \
--exclude 'glob.[ch]' --exclude 'mkstemp.[ch]' \
--exclude 'tempname.[ch]' --exclude 'basename.[ch]'
OPTIONS_DEFINE= NLS
OPTIONS_SUB= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MNLS}
USES+= gettext iconv
CONFIGURE_ARGS+=${ICONV_CONFIGURE_ARG} \
--with-libintl-prefix=${LOCALBASE}
LANGS=en@quot es
.for lang in ${LANGS}
PLIST_FILES+= share/locale/${lang}/LC_MESSAGES/cadaver.mo
.endfor
.else
CONFIGURE_ARGS+=--disable-nls \
--without-libiconv-prefix \
--without-libintl-prefix
.endif
NEON_VERSION= 31 32
post-patch:
@${REINPLACE_CMD} 's,27 28 29,& ${NEON_VERSION},' ${WRKSRC}/configure
NLS_USES= gettext iconv
NLS_CONFIGURE_ENABLE= nls
.include <bsd.port.mk>
+3 -3
View File
@@ -1,3 +1,3 @@
TIMESTAMP = 1696274043
SHA256 (cadaver-0.24.tar.gz) = 46cff2f3ebd32cd32836812ca47bcc75353fc2be757f093da88c0dd8f10fd5f6
SIZE (cadaver-0.24.tar.gz) = 808069
TIMESTAMP = 1746209845
SHA256 (cadaver-0.26.tar.gz) = 9236e43cdf3505d9ef06185fda43252840105c0c02d9370b6e1077d866357b55
SIZE (cadaver-0.26.tar.gz) = 1075924
+42 -54
View File
@@ -1,6 +1,6 @@
--- src/commands.c.orig 2022-10-30 10:46:52 UTC
--- src/commands.c.orig 2025-05-02 18:23:47 UTC
+++ src/commands.c
@@ -70,8 +70,7 @@
@@ -74,8 +74,7 @@
#include <ne_dates.h>
#include "i18n.h"
@@ -10,57 +10,45 @@
#include "cadaver.h"
#include "commands.h"
#include "options.h"
@@ -771,17 +770,17 @@ static char *clever_path(const char *p, const char *sr
dest_is_coll = (dest[strlen(dest)-1] == '/');
src_is_coll = (src[strlen(src)-1] == '/');
if (strcmp(dest, ".") == 0) {
- ret = resolve_path(p, base_name(src), false);
+ ret = resolve_path(p, basename(src), false);
} else if (strcmp(dest, "..") == 0) {
char *parent;
parent = ne_path_parent(p);
- ret = resolve_path(parent, base_name(src), false);
+ ret = resolve_path(parent, basename(src), false);
free(parent);
} else if (!src_is_coll && dest_is_coll) {
/* Moving a file to a collection... the destination should
* be the basename of file concated with the collection. */
char *tmp = resolve_path(p, dest, true);
- char *enc = escape_path(base_name(src));
+ char *enc = escape_path(basename(src));
ret = ne_concat(tmp, enc, NULL);
free(enc);
free(tmp);
@@ -979,7 +978,7 @@ static void execute_get(const char *remote, const char
if (local == NULL) {
struct stat st;
/* Choose an appropriate local filename */
- if (stat(base_name(remote), &st) == 0) {
+ if (stat(basename(remote), &st) == 0) {
char buf[BUFSIZ];
/* File already exists... don't overwrite */
snprintf(buf, BUFSIZ, _("Enter local filename for `%s': "),
@@ -992,7 +991,7 @@ static void execute_get(const char *remote, const char
return;
}
} else {
- filename = ne_strdup(base_name(remote));
+ filename = ne_strdup(basename(remote));
}
} else {
filename = ne_strdup(local);
@@ -1035,7 +1034,7 @@ static void execute_put(const char *local, const char
@@ -956,7 +955,7 @@ static void do_copymove(int argc, const char *argv[],
else if (dest_is_coll && src_is_coll) {
/* Case 1. */
char *tmp = ne_strndup(ops[n].src, strlen(ops[n].src)-1);
- ops[n].dest = ne_concat(uri_dest, base_name(tmp), NULL);
+ ops[n].dest = ne_concat(uri_dest, basename(tmp), NULL);
ne_free(tmp);
}
else if (src_is_coll && !dest_is_coll) {
@@ -966,7 +965,7 @@ static void do_copymove(int argc, const char *argv[],
}
else if (dest_is_coll) {
/* Case 2. */
- ops[n].dest = ne_concat(uri_dest, base_name(ops[n].src), NULL);
+ ops[n].dest = ne_concat(uri_dest, basename(ops[n].src), NULL);
}
else {
/* Case 3. */
@@ -1030,7 +1029,7 @@ static void execute_get(const char *native_remote, con
else {
struct stat st;
- filename = ne_strdup(base_name(native_remote));
+ filename = ne_strdup(basename(native_remote));
/* Choose an appropriate local filename */
if (stat(filename, &st) == 0) {
@@ -1084,7 +1083,7 @@ static void execute_put(const char *local, const char
static void execute_put(const char *local, const char *remote)
{
char *real_remote;
if (remote == NULL) {
- real_remote = resolve_path(session.uri.path, base_name(local), false);
+ real_remote = resolve_path(session.uri.path, basename(local), false);
} else {
real_remote = resolve_path(session.uri.path, remote, false);
}
--- src/edit.c.orig 2022-10-30 10:46:52 UTC
- char *uri_path = uri_resolve_native(remote ? remote : base_name(local));
+ char *uri_path = uri_resolve_native(remote ? remote : basename(local));
simple_put(local, uri_path);
free(uri_path);
}
--- src/edit.c.orig 2025-05-02 18:26:58 UTC
+++ src/edit.c
@@ -116,7 +116,7 @@ void execute_edit(const char *remote)
@@ -116,7 +116,7 @@ void execute_edit(const char *native_path)
struct ne_lock *lock = NULL;
char fname[PATH_MAX] = "/tmp/cadaver-edit-XXXXXX";
const char *pnt;
@@ -68,10 +56,10 @@
+ int fd, sufx_len;
int is_checkout, is_checkin;
real_remote = resolve_path(session.uri.path, remote, false);
@@ -140,9 +140,11 @@ void execute_edit(const char *remote)
uri_path = uri_resolve_native(native_path);
@@ -140,9 +140,11 @@ void execute_edit(const char *native_path)
if (pnt != NULL && strchr(pnt, '/') == NULL) {
strncat(fname, pnt, PATH_MAX);
strncat(fname, pnt, PATH_MAX-1);
fname[PATH_MAX-1] = '\0';
- }
+ sufx_len = strlen(pnt);
+4
View File
@@ -0,0 +1,4 @@
bin/cadaver
share/man/man1/cadaver.1.gz
%%NLS%%share/locale/en@quot/LC_MESSAGES/cadaver.mo
%%NLS%%share/locale/es/LC_MESSAGES/cadaver.mo