diff options
author | markd <markd@pkgsrc.org> | 2019-08-27 06:21:18 +0000 |
---|---|---|
committer | markd <markd@pkgsrc.org> | 2019-08-27 06:21:18 +0000 |
commit | fbd003d86953700c2d63adb6737dcceaf5abdcbd (patch) | |
tree | a9ae19416aedb1c733cba11897ecb3d1a2c17380 | |
parent | cc6fe9ed931c89c5cc0fcd1f78a65c38246239da (diff) | |
download | pkgsrc-fbd003d86953700c2d63adb6737dcceaf5abdcbd.tar.gz |
texlive2pkg: update to 1.7
add option to derive doc tarball path from the base package path.
allow tarball path to be a url.
-rw-r--r-- | pkgtools/texlive2pkg/Makefile | 7 | ||||
-rw-r--r-- | pkgtools/texlive2pkg/files/texlive2pkg.8 | 11 | ||||
-rwxr-xr-x | pkgtools/texlive2pkg/files/texlive2pkg.sh | 60 |
3 files changed, 59 insertions, 19 deletions
diff --git a/pkgtools/texlive2pkg/Makefile b/pkgtools/texlive2pkg/Makefile index 1a15e2cc0cf..8ec5fd81240 100644 --- a/pkgtools/texlive2pkg/Makefile +++ b/pkgtools/texlive2pkg/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.10 2019/08/12 08:35:14 markd Exp $ +# $NetBSD: Makefile,v 1.11 2019/08/27 06:21:18 markd Exp $ # -PKGNAME= texlive2pkg-1.6 +PKGNAME= texlive2pkg-1.7 CATEGORIES= pkgtools MAINTAINER= markd@NetBSD.org @@ -12,7 +12,7 @@ LICENSE= modified-bsd WRKSRC= ${WRKDIR} NO_BUILD= yes USE_LANGUAGES= # none -USE_TOOLS+= perl:run xzcat:run +USE_TOOLS+= ftp:run perl:run xzcat:run AUTO_MKDIRS= yes SUBST_CLASSES+= tools @@ -20,6 +20,7 @@ SUBST_STAGE.tools= pre-configure SUBST_MESSAGE.tools= Substituting tool locations. SUBST_FILES.tools= texlive2pkg.sh SUBST_VARS.tools= DISTDIR MAKE PREFIX +SUBST_SED.tools= -e 's,@FTP@,${TOOLS_PATH.ftp},g' REPLACE_PERL+= texlive.pkg texlive.pkg.doc diff --git a/pkgtools/texlive2pkg/files/texlive2pkg.8 b/pkgtools/texlive2pkg/files/texlive2pkg.8 index 7d3c798b0a5..c08bdc86867 100644 --- a/pkgtools/texlive2pkg/files/texlive2pkg.8 +++ b/pkgtools/texlive2pkg/files/texlive2pkg.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: texlive2pkg.8,v 1.2 2016/01/24 19:45:30 wiz Exp $ +.\" $NetBSD: texlive2pkg.8,v 1.3 2019/08/27 06:21:18 markd Exp $ .\" .\" Copyright (c) 2016 .\" Mark Davies. All rights reserved. @@ -36,6 +36,7 @@ .Nd create a pkgsrc package for a texlive package .Sh SYNOPSIS .Nm +.Op Fl d .Ar package-tarball .Op Ar doc-tarball .Sh DESCRIPTION @@ -57,13 +58,19 @@ has finished its job. .Nm is intended to help the process of creating a package but is not intended to fly on autopilot. +.Sh OPTIONS +The following command-line options are supported: +.Bl -tag -width indent +.It Fl d +Derive the doc-tarball path from the package-tarball +by replacing the .tar.xz with .doc.tar.xz. .Sh EXAMPLES Use the following commands to create a .Xr pkgsrc 7 package for the texlive package .Ar foo : .Dl cd pkgsrc/print -.Dl texlive2pkg foo.tar.xz foo.doc.tar.xz +.Dl texlive2pkg -d foo.tar.xz Remember to test the resulting package. .Sh SEE ALSO .Xr pkgsrc 7 diff --git a/pkgtools/texlive2pkg/files/texlive2pkg.sh b/pkgtools/texlive2pkg/files/texlive2pkg.sh index 7cd8a947f1f..b94e818d902 100755 --- a/pkgtools/texlive2pkg/files/texlive2pkg.sh +++ b/pkgtools/texlive2pkg/files/texlive2pkg.sh @@ -1,6 +1,6 @@ #!/bin/sh # texlive2pkg -# $NetBSD: texlive2pkg.sh,v 1.1 2016/01/24 19:34:44 markd Exp $ +# $NetBSD: texlive2pkg.sh,v 1.2 2019/08/27 06:21:18 markd Exp $ # # Copyright (c) 2016 # Mark Davies. All rights reserved. @@ -37,32 +37,37 @@ TDIR=/tmp/tl.$$ DISTDIR=@DISTDIR@ LIBEXECDIR=@PREFIX@/libexec/texlive2pkg MAKE=@MAKE@ +FTP=@FTP@ pkgtarball="" doctarball="" +dodoc=0 +pkgurl=0 +docurl=0 -USAGE="${NAME} package-tarball [doc-tarball] -- create a texlive package for pkgsrc" +USAGE="${NAME} [-d] package-tarball [doc-tarball] -- create a texlive package for pkgsrc" + +if [ "$1" = "-d" ]; then + dodoc=1 + shift +fi if [ ${#} -eq 1 ]; then pkgtarball=$1 + if [ $dodoc -eq 1 ]; then + doctarball=${pkgtarball%%.tar.xz}.doc.tar.xz + fi elif [ ${#} -eq 2 ]; then pkgtarball=$1 doctarball=$2 - case $doctarball in - /*.doc.tar.xz) - break ;; - *.doc.tar.xz) - doctarball=$PWD/$doctarball - break ;; - *) - echo ${USAGE} - exit 1 - esac else echo ${USAGE} exit 1 fi case $pkgtarball in +file:/*.tar.xz | ftp:/*.tar.xz | http:/*.tar.xz | https:/*.tar.xz ) + pkgurl=1 + break ;; /*.tar.xz) break ;; *.tar.xz) @@ -73,15 +78,42 @@ case $pkgtarball in exit 1 esac +case "$doctarball" in +"") + break ;; +file:/*.doc.tar.xz | ftp:/*.tar.xz | http:/*.doc.tar.xz | https:/*.doc.tar.xz ) + docurl=1 + break ;; +/*.doc.tar.xz) + break ;; +*.doc.tar.xz) + doctarball=$PWD/$doctarball + break ;; +*) + echo ${USAGE} + exit 1 +esac + +mkdir $TDIR + +if [ $pkgurl -eq 1 ]; then + (cd $TDIR; $FTP $pkgtarball ) + pkgtarball=$TDIR/`basename $pkgtarball` +fi +if [ $docurl -eq 1 ]; then + (cd $TDIR; $FTP $doctarball ) + doctarball=$TDIR/`basename $doctarball` +fi + if [ ! -f $pkgtarball ]; then echo "File not found - $pkgtarball" exit 1 fi -(mkdir $TDIR; cd $TDIR ; xzcat $pkgtarball | tar xf - tlpkg) +(cd $TDIR ; xzcat $pkgtarball | tar xf - tlpkg) eval `$LIBEXECDIR/texlive.pkg $TDIR/tlpkg/tlpobj/*.tlpobj` mkdir -p $DISTDIR/tex-$PKG-$REV -cp $* $DISTDIR/tex-$PKG-$REV/ +cp $pkgtarball $doctarball $DISTDIR/tex-$PKG-$REV/ (cd tex-$PKG; $MAKE makesum) if [ -f "$doctarball" ]; then (cd $TDIR; xzcat $doctarball | tar xf - tlpkg) |