Tuesday, October 31, 2023

textproc/xpdf: update to 4.04, move old 3.04 to textproc/xpdf3

'UPDATE: xpdf-4.04' from februrary 2023 rsadowski's new 4.x port and sthen's
rename idea: https://marc.info/?l=openbsd-ports&m=167562578021303&w=2

Below a diff to rename: apply, then mv textproc/{xpdf -> xpdf3}.
Attached the intial 4.x port with fixes and improvements from me.

This seems easier to review than an update diff (touching everything)
plus a xpdf3.tgz for import, imho.

xpdf3 has program and manual renamed, with the "3" suffix added to all
"xpdf" and "xpdfrc" words in the manual regardless of case as well as
config file names, so xpdf3 reads ~/.xpdfrc3 and /etc/xpdfrc3.

xpdf3 only contains xpdf3(1) and xpdfrc3(5), i.e. I dropped utility
programs in it as they're in xpdf (4.x) already.

current.html can then instruct xpdf users wishing to stick with 3.x to
pkg_delete xpdf
pkg_add xpdf3
mv ~/.xpdfrc{,3}
mv /etc/xpdfrc{,3}

Thoughts?

Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/xpdf/Makefile,v
diff -u -p -r1.98 Makefile
--- Makefile 22 Oct 2023 15:16:54 -0000 1.98
+++ Makefile 31 Oct 2023 09:59:57 -0000
@@ -1,9 +1,9 @@
COMMENT= PDF viewer for X11

-DISTNAME= xpdf-3.04
+V= 3.04
+DISTNAME= xpdf-${V}
+PKGNAME= xpdf${V:R}-${V}
CATEGORIES= textproc x11
-EPOCH= 0
-REVISION= 2

SITES= https://xpdfreader-dl.s3.amazonaws.com/old/

@@ -12,7 +12,7 @@ HOMEPAGE= https://www.xpdfreader.com/
# GPLv2 only or GPLv3 only or both (at our choice)
PERMIT_PACKAGE= Yes

-LIB_DEPENDS+= graphics/png x11/motif
+LIB_DEPENDS+= x11/motif
USE_GMAKE= Yes
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS= --enable-multithreaded \
@@ -26,24 +26,23 @@ MAKE_ENV+=MOTIFLIB='-L${LOCALBASE}/lib -
RUN_DEPENDS= print/ghostscript/gnu-fonts

WANTLIB= ICE SM X11 Xext Xpm Xt freetype Xm \
- c m png pthread ${COMPILER_LIBCXX} z
+ c m pthread ${COMPILER_LIBCXX} z

COMPILER = base-clang ports-gcc base-gcc

NO_TEST= Yes

-# others are already in popper-utils
-PROGS= xpdf pdfdetach pdftopng
-ALL_TARGET= ${PROGS}
+# others are already in xpdf>=4 and popper-utils
+ALL_TARGET= xpdf

do-install:
-.for prog in ${PROGS}
- ${INSTALL_PROGRAM} ${WRKBUILD}/xpdf/${prog} ${PREFIX}/bin/
- ${INSTALL_MAN} ${WRKSRC}/doc/${prog}.1 ${PREFIX}/man/man1/
-.endfor
- ${INSTALL_MAN} ${WRKSRC}/doc/xpdfrc.5 ${PREFIX}/man/man5/
- ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/xpdf
+ ${INSTALL_PROGRAM} ${WRKBUILD}/xpdf/xpdf ${PREFIX}/bin/xpdf3
+ ${INSTALL_MAN} ${WRKSRC}/doc/xpdf.1 ${PREFIX}/man/man1/xpdf3.1
+ ${INSTALL_MAN} ${WRKSRC}/doc/xpdfrc.5 ${PREFIX}/man/man5/xpdfrc3.5
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/xpdf3
${INSTALL_DATA} ${WRKSRC}/doc/sample-xpdfrc \
- ${PREFIX}/share/examples/xpdf/xpdfrc
+ ${PREFIX}/share/examples/xpdf3/xpdfrc3
+ # add "3" suffix to words "xpdf" and "xpdfrc"
+ sed -Ei 's/\<xpdf(rc)?\>/&3/' ${PREFIX}/man/man{1/xpdf3.1,5/xpdfrc3.5}

.include <bsd.port.mk>
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure 31 Oct 2023 10:26:39 -0000
@@ -0,0 +1,14 @@
+Add "3" suffix to default user config file
+
+Index: configure
+--- configure.orig
++++ configure
+@@ -2453,7 +2453,7 @@ if test "$sysconfdir" = '${prefix}/etc'; then
+ system_xpdfrc="$prefix/etc/xpdfrc"
+ fi
+ else
+- system_xpdfrc="$sysconfdir/xpdfrc"
++ system_xpdfrc="$sysconfdir/xpdfrc3"
+ fi
+ cat >>confdefs.h <<_ACEOF
+ #define SYSTEM_XPDFRC "$system_xpdfrc"
Index: patches/patch-xpdf_config_h
===================================================================
RCS file: patches/patch-xpdf_config_h
diff -N patches/patch-xpdf_config_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-xpdf_config_h 31 Oct 2023 10:26:39 -0000
@@ -0,0 +1,14 @@
+Add "3" suffix to default user config file
+
+Index: xpdf/config.h
+--- xpdf/config.h.orig
++++ xpdf/config.h
+@@ -55,7 +55,7 @@
+ #if defined(VMS) || defined(_WIN32)
+ #define xpdfUserConfigFile "xpdfrc"
+ #else
+-#define xpdfUserConfigFile ".xpdfrc"
++#define xpdfUserConfigFile ".xpdfrc3"
+

No comments:

Post a Comment