Hi!

The patch below makes textproc/catdoc use MULTI_PACKAGES instead of
FLAVORS.  As Porter's Handbook recommends, I also added PSEUDO_FLAVOR
"no_x11" for those building packages by hand.

With MULTI_PACKAGES, "catdoc" package is pretty much the same as it is
now, and new "wordview" package is Tk-based viewer that has only runtime
dependencies on Tk and catdoc.

I put a conflict marker to PLIST-tk, but I don't know what exactly
should be done to make update from catdoc-*-tk to wordview seamless.

-- 
Dmitrij D. Czarkoff

Index: Makefile
===================================================================
RCS file: /var/cvs/ports/textproc/catdoc/Makefile,v
retrieving revision 1.33
diff -u -p -r1.33 Makefile
--- Makefile    11 Mar 2013 11:42:40 -0000      1.33
+++ Makefile    18 Jan 2015 16:45:07 -0000
@@ -1,9 +1,14 @@
 # $OpenBSD: Makefile,v 1.33 2013/03/11 11:42:40 espie Exp $
 
-COMMENT=       MS Word, Excel, Powerpoint ==> ASCII or TeX
+COMMENT-main=  MS Word, Excel, Powerpoint ==> ASCII or TeX
+COMMENT-tk=    viewer for MS Word files
 
-DISTNAME=      catdoc-0.94.2
-REVISION=      3
+V=             0.94.2
+DISTNAME=      catdoc-$V
+PKGNAME-main=  catdoc-$V
+PKGNAME-tk=    wordview-$V
+PKG_ARCH-tk=   *
+REVISION=      4
 CATEGORIES=    textproc
 MASTER_SITES=  http://ftp.wagner.pp.ru/pub/catdoc/
 
@@ -12,18 +17,22 @@ HOMEPAGE=   http://wagner.pp.ru/~vitus/sof
 # GPLv2
 PERMIT_PACKAGE_CDROM=  Yes
 
-WANTLIB=       c m
-
-FLAVORS=       tk
+MULTI_PACKAGES=        -main
+PSEUDO_FLAVORS=        no_x11
 FLAVOR?=
 
-.if ${FLAVOR:Mtk}
-MODULES=       x11/tk
-RUN_DEPENDS=   ${MODTK_RUN_DEPENDS}
-CONFIGURE_ARGS+=--with-wish=${MODTK_BIN}
-.else
+WANTLIB-main=  c m
+
+.if ${FLAVOR:Mno_x11}
 CONFIGURE_ARGS+=--disable-wordview
+.else
+MULTI_PACKAGES+=-tk
+CONFIGURE_ARGS+=--with-wish=${MODTK_BIN}
 .endif
+
+MODULES-tk=    x11/tk
+RUN_DEPENDS-tk=        textproc/catdoc,-main \
+               ${MODTK_RUN_DEPENDS}
 
 CONFIGURE_STYLE=gnu dest
 
Index: pkg/DESCR
===================================================================
RCS file: pkg/DESCR
diff -N pkg/DESCR
--- pkg/DESCR   27 Oct 2006 20:41:47 -0000      1.5
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-catdoc is a program for viewing MS Word documents. It produces plain
-text output and can optionally convert non-standard characters into 
-TeX control sequences.
-
-xls2csv is a program which converts an MS Excel spreadsheet into a
-comma-separated value file.
-
-catppt is a utility to extract textual information from MS Powerpoint
-files.
-
-Flavors:
-        tk - a Tcl/Tk GUI frontend to catdoc for viewing MS Word
-             documents
Index: pkg/DESCR-main
===================================================================
RCS file: pkg/DESCR-main
diff -N pkg/DESCR-main
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR-main      18 Jan 2015 14:56:10 -0000
@@ -0,0 +1,9 @@
+catdoc is a program for viewing MS Word documents. It produces plain
+text output and can optionally convert non-standard characters into 
+TeX control sequences.
+
+xls2csv is a program which converts an MS Excel spreadsheet into a
+comma-separated value file.
+
+catppt is a utility to extract textual information from MS Powerpoint
+files.
Index: pkg/DESCR-tk
===================================================================
RCS file: pkg/DESCR-tk
diff -N pkg/DESCR-tk
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR-tk        18 Jan 2015 14:56:08 -0000
@@ -0,0 +1 @@
+a Tcl/Tk GUI frontend to catdoc for viewing MS Word documents
Index: pkg/PFRAG.tk
===================================================================
RCS file: pkg/PFRAG.tk
diff -N pkg/PFRAG.tk
--- pkg/PFRAG.tk        27 Oct 2006 20:41:47 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,3 +0,0 @@
-@comment $OpenBSD: PFRAG.tk,v 1.2 2006/10/27 20:41:47 steven Exp $
-bin/wordview
-@man man/man1/wordview.1
Index: pkg/PLIST
===================================================================
RCS file: pkg/PLIST
diff -N pkg/PLIST
--- pkg/PLIST   26 Aug 2012 17:41:17 -0000      1.5
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,59 +0,0 @@
-@comment $OpenBSD: PLIST,v 1.5 2012/08/26 17:41:17 stu Exp $
-@bin bin/catdoc
-@bin bin/catppt
-@bin bin/xls2csv
-@man man/man1/catdoc.1
-@man man/man1/catppt.1
-@man man/man1/xls2csv.1
-share/catdoc/
-share/catdoc/8859-1.txt
-share/catdoc/8859-10.txt
-share/catdoc/8859-11.txt
-share/catdoc/8859-13.txt
-share/catdoc/8859-14.txt
-share/catdoc/8859-15.txt
-share/catdoc/8859-2.txt
-share/catdoc/8859-3.txt
-share/catdoc/8859-4.txt
-share/catdoc/8859-5.txt
-share/catdoc/8859-6.txt
-share/catdoc/8859-7.txt
-share/catdoc/8859-8.txt
-share/catdoc/8859-9.txt
-share/catdoc/ascii.replchars
-share/catdoc/ascii.specchars
-share/catdoc/cp1250.txt
-share/catdoc/cp1251.txt
-share/catdoc/cp1252.txt
-share/catdoc/cp1253.txt
-share/catdoc/cp1254.txt
-share/catdoc/cp1255.txt
-share/catdoc/cp1256.txt
-share/catdoc/cp1257.txt
-share/catdoc/cp1258.txt
-share/catdoc/cp437.txt
-share/catdoc/cp850.txt
-share/catdoc/cp852.txt
-share/catdoc/cp855.txt
-share/catdoc/cp857.txt
-share/catdoc/cp860.txt
-share/catdoc/cp861.txt
-share/catdoc/cp862.txt
-share/catdoc/cp863.txt
-share/catdoc/cp864.txt
-share/catdoc/cp865.txt
-share/catdoc/cp866.txt
-share/catdoc/cp869.txt
-share/catdoc/cp874.txt
-share/catdoc/koi8-r.txt
-share/catdoc/koi8-u.txt
-share/catdoc/mac-arabic.txt
-share/catdoc/mac-centeuro.txt
-share/catdoc/mac-cyrillic.txt
-share/catdoc/mac-greek.txt
-share/catdoc/mac-hebrew.txt
-share/catdoc/mac-roman.txt
-share/catdoc/tex.replchars
-share/catdoc/tex.specchars
-share/catdoc/us-ascii.txt
-%%tk%%
Index: pkg/PLIST-main
===================================================================
RCS file: pkg/PLIST-main
diff -N pkg/PLIST-main
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-main      18 Jan 2015 14:52:59 -0000
@@ -0,0 +1,58 @@
+@comment $OpenBSD$
+@bin bin/catdoc
+@bin bin/catppt
+@bin bin/xls2csv
+@man man/man1/catdoc.1
+@man man/man1/catppt.1
+@man man/man1/xls2csv.1
+share/catdoc/
+share/catdoc/8859-1.txt
+share/catdoc/8859-10.txt
+share/catdoc/8859-11.txt
+share/catdoc/8859-13.txt
+share/catdoc/8859-14.txt
+share/catdoc/8859-15.txt
+share/catdoc/8859-2.txt
+share/catdoc/8859-3.txt
+share/catdoc/8859-4.txt
+share/catdoc/8859-5.txt
+share/catdoc/8859-6.txt
+share/catdoc/8859-7.txt
+share/catdoc/8859-8.txt
+share/catdoc/8859-9.txt
+share/catdoc/ascii.replchars
+share/catdoc/ascii.specchars
+share/catdoc/cp1250.txt
+share/catdoc/cp1251.txt
+share/catdoc/cp1252.txt
+share/catdoc/cp1253.txt
+share/catdoc/cp1254.txt
+share/catdoc/cp1255.txt
+share/catdoc/cp1256.txt
+share/catdoc/cp1257.txt
+share/catdoc/cp1258.txt
+share/catdoc/cp437.txt
+share/catdoc/cp850.txt
+share/catdoc/cp852.txt
+share/catdoc/cp855.txt
+share/catdoc/cp857.txt
+share/catdoc/cp860.txt
+share/catdoc/cp861.txt
+share/catdoc/cp862.txt
+share/catdoc/cp863.txt
+share/catdoc/cp864.txt
+share/catdoc/cp865.txt
+share/catdoc/cp866.txt
+share/catdoc/cp869.txt
+share/catdoc/cp874.txt
+share/catdoc/koi8-r.txt
+share/catdoc/koi8-u.txt
+share/catdoc/mac-arabic.txt
+share/catdoc/mac-centeuro.txt
+share/catdoc/mac-cyrillic.txt
+share/catdoc/mac-greek.txt
+share/catdoc/mac-hebrew.txt
+share/catdoc/mac-roman.txt
+share/catdoc/tex.replchars
+share/catdoc/tex.specchars
+share/catdoc/us-ascii.txt
Index: pkg/PLIST-tk
===================================================================
RCS file: pkg/PLIST-tk
diff -N pkg/PLIST-tk
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-tk        18 Jan 2015 16:41:01 -0000
@@ -0,0 +1,4 @@
+@comment $OpenBSD: PFRAG.tk,v 1.2 2006/10/27 20:41:47 steven Exp $
+@conflict catdoc-*-tk
+bin/wordview
+@man man/man1/wordview.1

Reply via email to