pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/texlive2pkg texlive2pkg: update to 1.7
details: https://anonhg.NetBSD.org/pkgsrc/rev/e7441277c30a
branches: trunk
changeset: 400325:e7441277c30a
user: markd <markd%pkgsrc.org@localhost>
date: Tue Aug 27 06:21:18 2019 +0000
description:
texlive2pkg: update to 1.7
add option to derive doc tarball path from the base package path.
allow tarball path to be a url.
diffstat:
pkgtools/texlive2pkg/Makefile | 7 ++-
pkgtools/texlive2pkg/files/texlive2pkg.8 | 11 ++++-
pkgtools/texlive2pkg/files/texlive2pkg.sh | 60 +++++++++++++++++++++++-------
3 files changed, 59 insertions(+), 19 deletions(-)
diffs (173 lines):
diff -r a260dac4438e -r e7441277c30a pkgtools/texlive2pkg/Makefile
--- a/pkgtools/texlive2pkg/Makefile Tue Aug 27 06:03:59 2019 +0000
+++ b/pkgtools/texlive2pkg/Makefile Tue Aug 27 06:21:18 2019 +0000
@@ -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@localhost
@@ -12,7 +12,7 @@
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_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 -r a260dac4438e -r e7441277c30a pkgtools/texlive2pkg/files/texlive2pkg.8
--- a/pkgtools/texlive2pkg/files/texlive2pkg.8 Tue Aug 27 06:03:59 2019 +0000
+++ b/pkgtools/texlive2pkg/files/texlive2pkg.8 Tue Aug 27 06:21:18 2019 +0000
@@ -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 @@
.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 -r a260dac4438e -r e7441277c30a pkgtools/texlive2pkg/files/texlive2pkg.sh
--- a/pkgtools/texlive2pkg/files/texlive2pkg.sh Tue Aug 27 06:03:59 2019 +0000
+++ b/pkgtools/texlive2pkg/files/texlive2pkg.sh Tue Aug 27 06:21:18 2019 +0000
@@ -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 @@
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 @@
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)
Home |
Main Index |
Thread Index |
Old Index