- Remove bash and wget dependency

- Add missing curl dependency for any2djvu
- Make any2djvu optional and don't install it by default
- Don't install empty ja manpages
- Bump portrevisiono

PR:		ports/109221 (partially based on)
Submitted by:	Rashid N. Achilov"<achilov-rn@askd.ru>
This commit is contained in:
Stanislav Sedov 2007-02-20 10:24:46 +00:00
parent b09f3b478a
commit f49f31b288
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=185555
3 changed files with 120 additions and 18 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= djvulibre
PORTVERSION= 3.5.18
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= graphics www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= djvu
@ -17,7 +17,6 @@ COMMENT?= DjVu viewers, encoders, browser plugin, and utilities
LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg \
tiff.4:${PORTSDIR}/graphics/tiff
RUN_DEPENDS= bash:${PORTSDIR}/shells/bash
USE_ICONV= yes
USE_GNOME= gnomehack gnometarget
@ -32,12 +31,13 @@ CONFIGURE_ENV= JPEG_CFLAGS="-I${LOCALBASE}/include" \
CONFIGURE_ARGS= --enable-threads=pthread --enable-shared
USE_LDCONFIG= yes
OPTIONS= ANY2DJVU "Install any2djvu script (requires curl)" off
MANLANG= "" ja
MAN1= bzz.1 c44.1 cjb2.1 cpaldjvu.1 csepdjvu.1 ddjvu.1 djvm.1 \
djvmcvt.1 djvu.1 djvudump.1 djvuextract.1 djvumake.1 djvups.1 \
djvused.1 djvuserve.1 djvutxt.1
MAN1EXTRA= any2djvu.1 djvutoxml.1 djvuxml.1 djvuxmlparser.1 djvudigital.1
MAN1+= ${MAN1EXTRA}
MAN1_EN= djvutoxml.1 djvuxml.1 djvuxmlparser.1 djvudigital.1
PORTDOCS= djvu2spec.djvu lizard2002.djvu
@ -54,15 +54,24 @@ CONFIGURE_ARGS+= --disable-djview --without-x
PLIST_SUB+= X11='@comment '
.endif
.include <bsd.port.pre.mk>
.if defined(WITH_ANY2DJVU)
MAN1_EN+= any2djvu.1
RUN_DEPENDS+= curl:${PORTSDIR}/ftp/curl
PLIST_SUB+= ANY2DJVU=""
.else
PLIST_SUB+= ANY2DJVU="@comment "
.endif
post-patch:
@${REINPLACE_CMD} -e 's|$${libdir}/pkgconfig|${PREFIX}/libdata/pkgconfig|' \
${WRKSRC}/libdjvu/Makefile.in
@${REINPLACE_CMD} -e \
's|$${libdir}/pkgconfig|${PREFIX}/libdata/pkgconfig|' \
${WRKSRC}/libdjvu/Makefile.in
@${REINPLACE_CMD} -e '/-O\*/d ; \
s|$$OPTS -O3|$$OPTS|g ; \
s|$$OPTS -O2|$$OPTS|g ; \
s|$$OPTS $$opt|$$OPTS|g' ${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|^#! /bin/bash|#! ${LOCALBASE}/bin/bash|g ; \
s|any2djvu\.sh|any2djvu|g' ${WRKSRC}/tools/any2djvu
@${REINPLACE_CMD} -e 's,/netscape/,/djvulibre/,' \
${WRKSRC}/gui/nsdejavu/nsdejavu.1.in
@${FIND} ${WRKSRC} -name "Makefile.in" | ${XARGS} ${REINPLACE_CMD} -e \
@ -73,22 +82,20 @@ post-patch:
s|eucjp|eucJP|g ; \
s|_PROGRAM} -m|} -m|g'
.if !defined(WITH_ANY2DJVU)
@${REINPLACE_CMD} -e 's,any2djbu,,' ${WRKSRC}/tools/Makefile.in
.endif
post-install:
.for man1 in ${MAN1EXTRA}
.for manlang in ${MANLANG}
${TOUCH} ${MAN1PREFIX}/man/${manlang}/man1/${man1}
.endfor
.endfor
.if !defined(WITHOUT_X11)
@${MKDIR} ${LOCALBASE}/lib/browser_plugins
${LN} -sf ${PREFIX}/lib/djvulibre/plugins/nsdejavu.so \
${LOCALBASE}/lib/browser_plugins/nsdejavu.so
.endif
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for file in ${PORTDOCS}
${INSTALL_DATA} ${WRKSRC}/doc/${file} ${DOCSDIR}
.endfor
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/doc/,} ${DOCSDIR}/
.endif
.include <bsd.port.mk>
.include <bsd.port.post.mk>

View File

@ -0,0 +1,95 @@
--- tools/any2djvu.orig Sat Feb 17 02:33:06 2007
+++ tools/any2djvu Sat Feb 17 02:36:10 2007
@@ -1,11 +1,11 @@
-#! /bin/bash -f
+#!/bin/sh
# CVS version control block - do not edit manually
# $RCSfile: any2djvu,v $
# $Revision: 1.1 $
# $Date: 2005/08/23 15:53:01 $
# $Source: /cvsroot/djvu/djvulibre-3.5/tools/any2djvu,v $
-function copyright()
+copyright()
{
echo "Copyright (C) 2002 David Kreil <D.Kreil@IEEE.Org>"
echo "Modified by Barak A. Pearlmutter <bap@debian.org>"
@@ -14,7 +14,7 @@
echo "Released under the GNU GPL v2, 21-Oct-2002."
}
-function warranty()
+warranty()
{
echo "This program is distributed in the hope that it will be useful,"
echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
@@ -22,7 +22,7 @@
echo "GNU General Public License for more details."
}
-function disclaimer()
+disclaimer()
{
echo "By using this tool you accept the following disclaimer:"
echo " Because the any2djvu service is free of charge, there is no"
@@ -40,7 +40,7 @@
ocr=1
docformat=2
-function warn()
+warn()
{
echo "Notes:"
echo " - Internet connection is required."
@@ -53,7 +53,7 @@
echo " - This software comes with NO WARRANTY."
}
-function format_help()
+format_help()
{
echo "Codes for the formats of the input documents to use with -f"
echo " 1 - DjVu Document (for verification or OCR)"
@@ -67,7 +67,7 @@
echo " 9 - Scanned Document - Color/Mixed - >400 dpi"
}
-function usage()
+usage()
{
echo "Convert files from .ps/.ps.gz/.pdf to .djvu"
echo "Usage: $0 [options] [url] {filename(s)}"
@@ -121,13 +121,13 @@
fi
# check OCR option
-if [ ! x$ocr == x0 ] && [ ! x$ocr == x1 ]; then
+if [ ! x$ocr = x0 ] && [ ! x$ocr = x1 ]; then
echo 'error: -o OCR must be 0 or 1'
exit 2
fi
# if help is requested or docformat is not specified right - show help
-if [ x$docformat == x'help' ]; then
+if [ x$docformat = x'help' ]; then
format_help
exit 0
fi
@@ -190,7 +190,7 @@
-F ocr=$ocr -F legal=1 $rurl/$rcgi \
| eval tee $log $shellopts
else
- wget $wgetopts -O - "$rurl/$rcgi?urlupload=$lurl/$in$cgiopts" \
+ /usr/bin/fetch $wgetopts -o - "$rurl/$rcgi?urlupload=$lurl/$in$cgiopts" \
| eval tee $log $shellopts
fi
l=`egrep 'href=djvu/.*\.djvu' $log`
@@ -200,7 +200,7 @@
echo "error: something got wrong. check log file"
exit 1
fi
- wget $wgetopts -O $b.djvu "$rurl/$l"
+ /usr/bin/fetch $wgetopts -o $b.djvu "$rurl/$l"
[ -z $doclean ] || rm $log
[ -z $silent ] && ls -l $b.djvu

View File

@ -1,4 +1,4 @@
bin/any2djvu
%%ANY2DJVU%%bin/any2djvu
bin/bzz
bin/c44
bin/cjb2