Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/feh/Makefile,v
retrieving revision 1.19
diff -u -p -r1.19 Makefile
--- Makefile	5 Jan 2011 13:13:05 -0000	1.19
+++ Makefile	2 May 2011 13:44:03 -0000
@@ -2,14 +2,13 @@
 
 COMMENT=	lightweight image viewer
 
-DISTNAME=	feh-1.10.1
-REVISION=	0
+DISTNAME=	feh-1.13
 EXTRACT_SUFX=	.tar.bz2
 CATEGORIES=	graphics
 
-HOMEPAGE=	https://derf.homelinux.org/~derf/projects/feh/
+HOMEPAGE=	http://feh.finalrewind.org/
 
-MAINTAINER=	Victor Sahlstedt <salan@legonet.org>
+MAINTAINER=	David Coppa <dcoppa@openbsd.org>
 
 # BSD
 PERMIT_PACKAGE_CDROM=	Yes
@@ -17,11 +16,12 @@ PERMIT_PACKAGE_FTP=	Yes
 PERMIT_DISTFILES_CDROM= Yes
 PERMIT_DISTFILES_FTP=	Yes
 
-WANTLIB=	Imlib2 X11 Xinerama c giblib>=1 m png
+WANTLIB=	Imlib2 X11 Xinerama c curl giblib>=1 m png
 
 MASTER_SITES=	${HOMEPAGE}
 
-LIB_DEPENDS=	devel/giblib
+LIB_DEPENDS=	devel/giblib \
+		net/curl
 
 # needed for jpegtran on NO_SHARED_LIBS archs
 RUN_DEPENDS=	graphics/jpeg
@@ -30,11 +30,15 @@ CFLAGS+=	-I${LOCALBASE}/include \
 		-I${LOCALBASE}/include/libpng \
 		-I${X11BASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib -L${X11BASE}/lib
-MAKE_FLAGS=	LDFLAGS="${LDFLAGS}" man_dir="${DESTDIR}${PREFIX}/man"
+MAKE_FLAGS=	LDFLAGS="${LDFLAGS}" man_dir="${DESTDIR}${PREFIX}/man" \
+		example_dir="${DESTDIR}${PREFIX}/share/examples/feh"
 FAKE_FLAGS=	PREFIX="${PREFIX}"
 
 USE_GMAKE=	Yes
 
 NO_REGRESS=	Yes
+
+post-configure:
+	${SUBST_CMD} ${WRKSRC}/src/keyevents.c ${WRKSRC}/src/options.c
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/graphics/feh/distinfo,v
retrieving revision 1.11
diff -u -p -r1.11 distinfo
--- distinfo	7 Dec 2010 08:42:35 -0000	1.11
+++ distinfo	2 May 2011 13:44:03 -0000
@@ -1,5 +1,5 @@
-MD5 (feh-1.10.1.tar.bz2) = wqotBTvcGV5uOrKSLYXbSw==
-RMD160 (feh-1.10.1.tar.bz2) = AdTnXMMa2Q+16VTp6GF0QEG88vU=
-SHA1 (feh-1.10.1.tar.bz2) = J4TID1jo1ezC7QXWRz7GpXSqJc8=
-SHA256 (feh-1.10.1.tar.bz2) = 3szfVzxiiIRQuP39NBuTezGztbqaO3MVSMEhQAOtGPE=
-SIZE (feh-1.10.1.tar.bz2) = 2504241
+MD5 (feh-1.13.tar.bz2) = Y4Pa0JXBJEfozastNXHISg==
+RMD160 (feh-1.13.tar.bz2) = VJZO2pl3qVdwTtx0VVYIP8MBhQI=
+SHA1 (feh-1.13.tar.bz2) = iyyCUBN+29pjC5IOXrfKe6WBil4=
+SHA256 (feh-1.13.tar.bz2) = FgqgEtIDFWjBW9ZLKntUunDKhtGFv76O0LBy1tssHss=
+SIZE (feh-1.13.tar.bz2) = 2290720
Index: patches/patch-config_mk
===================================================================
RCS file: /cvs/ports/graphics/feh/patches/patch-config_mk,v
retrieving revision 1.1
diff -u -p -r1.1 patch-config_mk
--- patches/patch-config_mk	11 Jul 2010 14:46:13 -0000	1.1
+++ patches/patch-config_mk	2 May 2011 13:44:03 -0000
@@ -1,12 +1,15 @@
 $OpenBSD: patch-config_mk,v 1.1 2010/07/11 14:46:13 dcoppa Exp $
---- config.mk.orig	Fri Jun 25 17:13:11 2010
-+++ config.mk	Wed Jul  7 13:27:30 2010
-@@ -14,7 +14,7 @@ font_dir = ${main_dir}/share/feh/fonts
+
+gcc3 does not like "-Wextra"
+
+--- config.mk.orig	Sat Apr 23 22:02:31 2011
++++ config.mk	Mon May  2 14:17:26 2011
+@@ -15,7 +15,7 @@ example_dir = ${main_dir}/share/doc/feh/examples
  
  # default CFLAGS
  CFLAGS ?= -g -O2
 -CFLAGS += -Wall -Wextra -pedantic
 +CFLAGS += -Wall -pedantic
  
- # Comment these out if you don't have libxinerama
- xinerama = -DHAVE_LIBXINERAMA
+ curl ?= 1
+ debug ?= 0
Index: patches/patch-man_gen-cam-menu_pre
===================================================================
RCS file: patches/patch-man_gen-cam-menu_pre
diff -N patches/patch-man_gen-cam-menu_pre
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-man_gen-cam-menu_pre	2 May 2011 13:44:03 -0000
@@ -0,0 +1,10 @@
+$OpenBSD$
+--- man/gen-cam-menu.pre.orig	Mon May  2 14:41:34 2011
++++ man/gen-cam-menu.pre	Mon May  2 14:41:48 2011
+@@ -1,5 +1,5 @@
+ .Dd $DATE$
+-.Dt GEN-CAM-Menu 1
++.Dt GEN-CAM-MENU 1
+ .Os
+ .
+ .Sh NAME
Index: patches/patch-src_imlib_c
===================================================================
RCS file: /cvs/ports/graphics/feh/patches/patch-src_imlib_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_imlib_c
--- patches/patch-src_imlib_c	15 Oct 2010 12:52:23 -0000	1.3
+++ patches/patch-src_imlib_c	2 May 2011 13:44:03 -0000
@@ -1,49 +1,16 @@
 $OpenBSD: patch-src_imlib_c,v 1.3 2010/10/15 12:52:23 dcoppa Exp $
+
+Fix rotate arg in error message
+(commit ef3f1979c2d443823bfc761d98b30c232992494a)
+
 --- src/imlib.c.orig	Thu Oct  7 20:28:39 2010
 +++ src/imlib.c	Fri Oct 15 14:47:36 2010
-@@ -438,6 +438,7 @@ char *feh_http_load_image(char *url)
- 		close(sockno);
- 		fclose(fp);
- 	} else {
-+		int fd;
- 		int pid;
- 		int status;
- 
-@@ -446,18 +447,20 @@ char *feh_http_load_image(char *url)
- 			free(tmpname);
- 			return(NULL);
- 		} else if (pid == 0) {
--			char *quiet = NULL;
--
--			if (!opt.verbose)
--				quiet = estrdup("-q");
--
--			execlp("wget", "wget", "--cache=off", "-O", tmpname, url, quiet, NULL);
--			eprintf("url: Is 'wget' installed? Failed to exec wget:");
-+				if (!opt.verbose) {
-+					if ((fd = open("/dev/null", O_WRONLY)) != -1) {
-+					dup2(fd, fileno(stdout));
-+					dup2(fd, fileno(stderr));
-+				}
-+				if (fd > 2) close(fd);
-+			}
-+			execlp("ftp", "ftp", "-o", tmpname, url, (char *)NULL);
-+			eprintf("url: Is 'ftp' installed? Failed to exec ftp:");
- 		} else {
- 			waitpid(pid, &status, 0);
- 
- 			if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
--				weprintf("url: wget failed to load URL %s\n", url);
-+				weprintf("url: ftp failed to load URL %s\n", url);
- 				unlink(tmpname);
- 				free(tmpname);
- 				return(NULL);
-@@ -1038,7 +1041,7 @@ void feh_edit_inplace_lossless_rotate(winwidget w, int
- 	} else if (pid == 0) {
- 
- 		execlp("jpegtran", "jpegtran", "-copy", "all", "-rotate",
--				rotate_str, "-outfile", file_str, file_str, NULL);
-+				rotate_str, "-outfile", file_str, file_str, (char *)NULL);
- 
- 		eprintf("lossless rotate: Is 'jpegtran' installed? Failed to exec:");
- 	} else {
+@@ -857,7 +857,7 @@ void feh_edit_inplace_lossless_rotate(winwidget w, int
+ 		if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+ 			weprintf("lossless rotate: Got exitcode %d from jpegtran."
+ 					" Commandline was:\n"
+-					"jpegtran -copy all -rotate %d -outfile %s %s\n",
++					"jpegtran -copy all -rotate %s -outfile %s %s\n",
+ 					status >> 8, rotate_str, file_str, file_str);
+ 			return;
+ 		}
Index: patches/patch-src_keyevents_c
===================================================================
RCS file: /cvs/ports/graphics/feh/patches/patch-src_keyevents_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_keyevents_c
--- patches/patch-src_keyevents_c	5 Jan 2011 13:13:05 -0000	1.3
+++ patches/patch-src_keyevents_c	2 May 2011 13:44:03 -0000
@@ -1,11 +1,12 @@
 $OpenBSD: patch-src_keyevents_c,v 1.3 2011/01/05 13:13:05 dcoppa Exp $
 --- src/keyevents.c.orig	Fri Dec  3 19:42:44 2010
 +++ src/keyevents.c	Wed Jan  5 14:07:07 2011
-@@ -307,6 +307,7 @@ void feh_event_handle_keypress(XEvent * ev)
- 	case XK_KP_Multiply:
- 		len = 0;
- 		winwid->zoom = 1;
-+		winwid->old_zoom = 1.001; /* hack for --scale-down */
- 		winwidget_center_image(winwid);
- 		winwidget_render_image(winwid, 0, 0);
- 		break;
+@@ -155,7 +155,7 @@ void init_keyevents(void) {
+ 
+ 	free(confpath);
+ 
+-	if (!conf && ((conf = fopen("/etc/feh/keys", "r")) == NULL))
++	if (!conf && ((conf = fopen("${SYSCONFDIR}/feh/keys", "r")) == NULL))
+ 		return;
+ 
+ 	while (fgets(line, sizeof(line), conf)) {
Index: patches/patch-src_options_c
===================================================================
RCS file: patches/patch-src_options_c
diff -N patches/patch-src_options_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_options_c	2 May 2011 13:44:03 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+Improve '.fehrc -> .config/feh/themes' warning message
+(commit bd3aa36a5ab8d8d221d64f15202525dddb149365)
+
+--- src/options.c.orig	Mon May  2 15:23:04 2011
++++ src/options.c	Mon May  2 15:22:47 2011
+@@ -166,12 +166,14 @@ static void feh_load_options_for_theme(char *theme)
+ 	free(rcpath);
+ 
+ 	if (!fp && ((fp = fopen(oldrcpath, "r")) != NULL))
+-		weprintf("the config is now read from .config/feh/themes, "
+-			"please update your path!");
++		weprintf("The theme config file was moved from ~/.fehrc to "
++			"~/.config/feh/themes. Run\n"
++			"    mkdir -p ~/.config/feh; mv ~/.fehrc ~/.config/feh/themes\n"
++			"to fix this.");
+ 
+ 	free(oldrcpath);
+ 
+-	if (!fp && ((fp = fopen("/etc/feh/themes", "r")) == NULL))
++	if (!fp && ((fp = fopen("${SYSCONFDIR}/feh/themes", "r")) == NULL))
+ 		return;
+ 
+ 	/* Oooh. We have an options file :) */
Index: patches/patch-src_winwidget_c
===================================================================
RCS file: patches/patch-src_winwidget_c
diff -N patches/patch-src_winwidget_c
--- patches/patch-src_winwidget_c	5 Jan 2011 13:13:05 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-$OpenBSD: patch-src_winwidget_c,v 1.1 2011/01/05 13:13:05 dcoppa Exp $
---- src/winwidget.c.orig	Fri Dec  3 19:42:44 2010
-+++ src/winwidget.c	Wed Jan  5 14:07:03 2011
-@@ -383,7 +383,8 @@ void winwidget_render_image(winwidget winwid, int resi
- 	winwidget_setup_pixmaps(winwid);
- 
- 	if (!winwid->full_screen && opt.scale_down && ((winwid->w < winwid->im_w)
--						       || (winwid->h < winwid->im_h))) {
-+						       || (winwid->h < winwid->im_h)) &&
-+							  (winwid->old_zoom == 1.0)) {
- 		D(("scaling down image %dx%d\n", winwid->w, winwid->h));
- 
- 		feh_calc_needed_zoom(&(winwid->zoom), winwid->im_w, winwid->im_h, winwid->w, winwid->h);
-@@ -908,6 +909,7 @@ void feh_debug_print_winwid(winwidget w)
- void winwidget_reset_image(winwidget winwid)
- {
- 	winwid->zoom = 1.0;
-+	winwid->old_zoom = 1.0;
- 	winwid->im_x = 0;
- 	winwid->im_y = 0;
- 	winwid->im_angle = 0.0;
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/graphics/feh/pkg/PLIST,v
retrieving revision 1.5
diff -u -p -r1.5 PLIST
--- pkg/PLIST	7 Dec 2010 08:42:35 -0000	1.5
+++ pkg/PLIST	2 May 2011 13:44:03 -0000
@@ -10,6 +10,12 @@ share/doc/feh/AUTHORS
 share/doc/feh/ChangeLog
 share/doc/feh/README
 share/doc/feh/TODO
+share/examples/feh/
+@sample ${SYSCONFDIR}/feh/
+share/examples/feh/keys
+@sample ${SYSCONFDIR}/feh/keys
+share/examples/feh/themes
+@sample ${SYSCONFDIR}/feh/themes
 share/feh/
 share/feh/fonts/
 share/feh/fonts/black.style
