Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 60118 Details for
Bug 85411
CTAN and CRAN package installation script
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
g-ctan.sh
g-ctan.sh (text/plain), 3.98 KB, created by
Mamoru KOMACHI (RETIRED)
on 2005-05-29 13:03:04 UTC
(
hide
)
Description:
g-ctan.sh
Filename:
MIME Type:
Creator:
Mamoru KOMACHI (RETIRED)
Created:
2005-05-29 13:03:04 UTC
Size:
3.98 KB
patch
obsolete
>#!/bin/bash ># $Header: /home/cvsroot/gentoo-src/portage/bin/g-cpan.pl,v 1.10 2003/05/24 05:40:37 jrray Exp $ > ># History: > ># 18/12/03: usata@gentoo.org: Initial code > >source /sbin/functions.sh > >[[ -z "${DISTDIR}" ]] && source /etc/make.conf >[[ -z "${DISTDIR}" ]] && source /etc/make.globals > >CTANMASTERSITE="http://www.ctan.org/" >TEXMF="/usr/share/texmf" >CATALOGUE="${TEXMF}/doc/help/Catalogue" >if [[ -x /usr/bin/w3m ]] ; then > TEXTBROWSER="/usr/bin/w3m" >elif [[ -x /usr/bin/elinks ]] ; then > TEXTBROWSER="/usr/bin/elinks" >elif [[ -x /usr/bin/lynx ]] ; then > TEXTBROWSER="/usr/bin/lynx -nolist" >else > ewarn "You must install w3m, elinks or lynx to use this script." > exit 1 >fi > >do_help() { > > echo "Usage: $0 action [target]" > echo "Action:" > echo " help Display this information" > echo " list List available packages on CTAN catalogue" > echo " search <keyword> Search CTAN catalogue for <keyword>" > echo " install <package> Install <package> from CTAN" > echo "" > echo "Report bugs to <usata@gentoo.org>." >} > >do_list() { > > ${TEXTBROWSER} ${CATALOGUE}/brief.html >} > >do_search() { > > ${TEXTBROWSER} -dump ${CATALOGUE}/brief.html | grep "$@" >} > >do_install() { > > local MY_PN="$1" > local MY_P="${MY_PN}-0.0_pre$(date "+%Y%m%d")" > > local CTAN_TMPDIR="`mktemp -d /tmp/g-ctan.XXXXXXXX`" > mkdir -p ${CTAN_TMPDIR}/dev-tex/${MY_PN} > > # Extracting informantion from Catalogue > ${TEXTBROWSER} -dump ${CATALOGUE}/brief.html \ > | grep "^[[:space:]]*${MY_PN}" > ${CTAN_TMPDIR}/pkg-descr > local DESCRIPTION=$(sed -e "s/^[[:space:]]*\w*[[:space:]]*//" ${CTAN_TMPDIR}/pkg-descr) > local SRC_URI="$(grep "<B>${MY_PN}</B>" ${CATALOGUE}/hier.html | sed -e "s/.*\"\(.*\)\/\".*/\1/").tar.gz" > local LICENSE="$(grep License ${CATALOGUE}/entries/${MY_PN}.html | sed -e "s/.*licenses\.\(\w*\)\..*/\1/")" > > # Removing old directory hierarchy > SRC_URI=${SRC_URI/supported\//} > SRC_URI=${SRC_URI/other\//} > > if [[ -z "${SRC_URI%.tar.gz}" ]] ; then > eerror "Package ${MY_PN} was not found in Catalogue database." > exit 1 > fi > > # Rename LICENSE as Portage compliant > case ${LICENSE} in > artistic) > LICENSE="Artistic" > ;; > bsd) > LICENSE="BSD" > ;; > gpl) > LICENSE="GPL-2" > ;; > lgpl) > LICENSE="LGPL-2.1" > ;; > lppl) > LICENSE="LPPL-1.2" > ;; > nocommercial) > LICENSE="free-noncomm" > ;; > pd) > LICENSE="public-domain" > ;; > dfsg|knuth|nosource|unknown) > LICENSE="freedist" > ;; > *) > ewarn "License of the software is ${LICENSE}." > ewarn "Please check the software's license before using the software." > ;; > esac > > einfo "Package: ${MY_PN}" > einfo "Description: ${DESCRIPTION}" > einfo "SRC_URI: ${SRC_URI}" > einfo "License: ${LICENSE}" > > cat >${CTAN_TMPDIR}/dev-tex/${MY_PN}/${MY_P}.ebuild<<EOF ># Copyright 1999-2003 Gentoo Technologies, Inc. ># Distributed under the terms of the GNU General Public License v2 ># \$Header: \$ > >inherit latex-package > >IUSE="" > >DESCRIPTION="${DESCRIPTION}" >HOMEPAGE="http://www.ctan.org/tex-archive/help/Catalogue/entries/${MY_PN}.html" >SRC_URI="${SRC_URI}" > >LICENSE="${LICENSE}" >SLOT="0" >KEYWORDS="~x86 ~ppc ~ppc64 ~sparc ~alpha ~mips ~hppa ~arm ~amd64 ~ia64 ~x86obsd" > >S="\${WORKDIR}/\${PN}" >EOF > > # Here we go ;) > if [ $(id -u) != 0 ] ; then > eerror "You need root privilege to install." > exit 1 > else > /usr/bin/env PORTDIR_OVERLAY="${CTAN_TMPDIR}" GENTOO_MIRRORS="" \ > ebuild ${CTAN_TMPDIR}/dev-tex/${MY_PN}/${MY_P}.ebuild digest > /usr/bin/env PORTDIR_OVERLAY="${CTAN_TMPDIR}" GENTOO_MIRRORS="" \ > emerge ${CTAN_TMPDIR}/dev-tex/${MY_PN}/${MY_P}.ebuild > rm -rf ${CTAN_TMPDIR} > fi >} > >main() { > > if [ "$#" -lt 1 ] ; then > do_help > else > case "$1" in > help) > do_help > ;; > list) > do_list > ;; > search) > if [ "$#" -lt 2 ] ; then > eerror "$0: search needs an argument." > exit 1 > fi > shift > do_search "$@" > ;; > install) > if [ "$#" -lt 2 ] ; then > eerror "$0: install needs an argument." > exit 1 > fi > shift > do_install "$@" > ;; > *) > echo "Subcommand $1 is not implemented yet." > ;; > esac > fi >} >main "$@" >exit 0 > ># vi:ts=4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 85411
: 60118