[1476] | 1 | #!/bin/bash |
---|
| 2 | # tlpdb2rpmspec |
---|
| 3 | # |
---|
| 4 | # Copyright 2010 Munehiro Yamamoto <munepi@vinelinux.org> |
---|
| 5 | # This file is licensed under the GNU General Public License version 2 |
---|
| 6 | # or any later version. |
---|
| 7 | |
---|
| 8 | Usage(){ |
---|
| 9 | cat<<EOF |
---|
[5075] | 10 | $(basename $0) @@VTLPKG_VERSION@@ |
---|
[1476] | 11 | Usage: $(basename $0) [option] [pkgname] |
---|
| 12 | |
---|
[5075] | 13 | TeX Live Package Database (a file named texlive.tlpdb) to RPM spec converter |
---|
| 14 | This script generates a RPM spec file of CTAN and collection-* packages |
---|
| 15 | contained in TeX Live @@VTLPKG_VERSION@@. |
---|
[1476] | 16 | |
---|
| 17 | Options: |
---|
| 18 | --name: return [pkgname] |
---|
| 19 | --category: return the category of [pkgname] |
---|
| 20 | --revision: return the revision of [pkgname] |
---|
| 21 | --depend: return dependencies of [pkgname] |
---|
| 22 | --shortdesc: return the short description of [pkgname] |
---|
| 23 | --longdesc: return the description of [pkgname] |
---|
| 24 | --execute: return post processe of [pkgname] |
---|
| 25 | --catalogue-ctan: return the locate of [pkgname] |
---|
| 26 | --catalogue-date: return the last update of [pkgname] |
---|
| 27 | --catalogue-license: return the license of [pkgname] |
---|
| 28 | --catalogue-version: return the version of [pkgname] |
---|
| 29 | --filelist: return the filelist of [pkgname] |
---|
| 30 | --help: show this help |
---|
| 31 | |
---|
[5080] | 32 | Supoort collection-* packages: |
---|
[1476] | 33 | $(egrep "^name collection-" $TLPDB | sed -e "s,name ,,g") |
---|
| 34 | EOF |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | check-parameter(){ |
---|
| 38 | [ -z "$*" ] && Usage && return 1 |
---|
| 39 | |
---|
| 40 | while [ ! -z "$*" ]; do |
---|
| 41 | case $1 in |
---|
[1521] | 42 | --name|--category|--revision|--depend|--shortdesc|--longdesc|--execute|--catalogue-ctan|--catalogue-date|--catalogue-license|--catalogue-version|--filelist) |
---|
[1476] | 43 | [ $with_option -eq 1 ] && \ |
---|
[5075] | 44 | $__echo "E: you only give one option" && return 1 |
---|
[1476] | 45 | with_option=1 |
---|
| 46 | ;; |
---|
| 47 | --help) |
---|
| 48 | Usage |
---|
| 49 | return 1 |
---|
| 50 | ;; |
---|
[1521] | 51 | --minimal-collections|--standard-collections|--full-collections) |
---|
| 52 | [ ! -f /etc/vine-release ] && \ |
---|
[5075] | 53 | $__echo "E: support Vine Linux only" && return 1 |
---|
[1521] | 54 | ;; |
---|
| 55 | *) |
---|
[1784] | 56 | [ -z "$(egrep -n "^name $1$" $TLPDB)" ] && \ |
---|
[5075] | 57 | $__echo "E: unknown option or package: $1" && return 1 |
---|
[1476] | 58 | ;; |
---|
| 59 | esac |
---|
| 60 | shift |
---|
| 61 | done |
---|
| 62 | |
---|
| 63 | return 0 |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | ## tlpkg4a [--name|--category|--revision|--depend|--shortdesc|--longdesc|--execute|--catalogue-ctan|--catalogue-date|--catalogue-license|--catalogue-version|--filelist] [pkgname] |
---|
| 68 | tlpkg4a(){ |
---|
| 69 | [ $# -eq 2 ] || return 1 |
---|
| 70 | local opt=$1 |
---|
| 71 | local pkg=$2 |
---|
[5075] | 72 | local fieldname=$($__echo $opt | sed -e "s,--,,") |
---|
[1476] | 73 | |
---|
| 74 | ## check param |
---|
| 75 | case $opt in |
---|
| 76 | --name|--category|--revision|--depend|--shortdesc|--longdesc|--execute|--catalogue-ctan|--catalogue-date|--catalogue-license|--catalogue-version|--filelist) |
---|
| 77 | ;; |
---|
| 78 | *) |
---|
[5075] | 79 | $__echo "E: unknown option: $opt" |
---|
[1476] | 80 | exit 1 |
---|
| 81 | ;; |
---|
| 82 | esac |
---|
| 83 | |
---|
| 84 | ## get the head line of $pkg record |
---|
| 85 | pkg_LINE=$(egrep -n "^name $pkg$" $TLPDB | cut -d":" -f 1) |
---|
| 86 | |
---|
| 87 | ## read tlpdb |
---|
[1496] | 88 | is_pkg=0 |
---|
[2975] | 89 | ( |
---|
| 90 | [ "$opt" = "--filelist" ] && \ |
---|
| 91 | tail -n $(( $TLPDB_MAXLINE - $pkg_LINE + 1 )) $TLPDB || \ |
---|
| 92 | tail -n $(( $TLPDB_MAXLINE - $pkg_LINE + 1 )) $TLPDB | egrep -v -e "^ " |
---|
| 93 | ) | \ |
---|
[1476] | 94 | while read field; do |
---|
| 95 | ## find the record of $pkg |
---|
[5075] | 96 | $__echo "$field" | egrep -q "^name $pkg" && is_pkg=1 |
---|
[1496] | 97 | [ $is_pkg -eq 0 ] && continue |
---|
[1476] | 98 | |
---|
| 99 | ## return the values of its field name |
---|
| 100 | if [ "$opt" = "--filelist" ]; then |
---|
| 101 | ## NOTE: we only need texmf-dist directories |
---|
[5075] | 102 | ## we replace RELOC with texmf-dist |
---|
| 103 | $__echo "$field" | \ |
---|
[5192] | 104 | egrep -e "^texmf-dist/" -e "^RELOC/" | \ |
---|
[5075] | 105 | sed -e "s,^RELOC,texmf-dist," \ |
---|
| 106 | -e "s, details=.*,," -e "s, language=.*,," |
---|
[1476] | 107 | else |
---|
[5075] | 108 | $__echo "$field" | \ |
---|
| 109 | egrep "^${fieldname} " | \ |
---|
| 110 | sed -e "s,${fieldname} ,," |
---|
[1476] | 111 | fi |
---|
| 112 | |
---|
| 113 | ## end of the record of $pkg |
---|
[5075] | 114 | $__echo "$field" | egrep -q "^[[:blank:]]*$" && break |
---|
[1476] | 115 | done |
---|
| 116 | |
---|
| 117 | return 0 |
---|
| 118 | } |
---|
| 119 | |
---|
| 120 | ## tlpkg2speclicense [pkgname] |
---|
| 121 | tlpkg2speclicense(){ |
---|
| 122 | [ $# -eq 1 ] || return 1 |
---|
| 123 | local pkg=$1 |
---|
| 124 | |
---|
| 125 | case $(tlpkg4a --catalogue-license $pkg) in |
---|
[5075] | 126 | gpl3) $__echo "GPLv3+";; |
---|
| 127 | gpl2) $__echo "GPLv2+";; |
---|
| 128 | gpl) $__echo "GPL+";; |
---|
[5078] | 129 | lppl|lppl1|lppl1.2|lppl1.3) $__echo "LPPL";; |
---|
[5075] | 130 | other-free) $__echo "Freely redistributable without restriction";; |
---|
| 131 | pd) $__echo "Public Domain";; |
---|
| 132 | noinfo) $__echo "No Info";; |
---|
| 133 | lgpl|lgpl2.1) $__echo "LGPLv2+";; |
---|
| 134 | gfsl) $__echo "LPPL";; |
---|
| 135 | bsd) $__echo "BSD";; |
---|
| 136 | knuth) $__echo "Knuth";; |
---|
| 137 | unknown) $__echo "Unknown";; |
---|
| 138 | gfl) $__echo "LPPL";; |
---|
| 139 | artistic2) $__echo "Artistic 2.0";; |
---|
| 140 | fdl) $__echo "GFDL";; |
---|
| 141 | collection) $__echo "Public Domain";; |
---|
| 142 | artistic) $__echo "Artistic";; |
---|
| 143 | other-nonfree) $__echo "Other";; |
---|
| 144 | other) $__echo "Other";; |
---|
| 145 | ofl) $__echo "OFSFLD";; |
---|
| 146 | apache2) $__echo "ASL 2.0";; |
---|
| 147 | nosource) $__echo "No Source";; |
---|
| 148 | nosell) $__echo "No Sell";; |
---|
| 149 | nocommercial) $__echo "Non-commercial";; |
---|
[1476] | 150 | *) return 1;; |
---|
| 151 | esac |
---|
| 152 | return 0 |
---|
| 153 | } |
---|
| 154 | |
---|
| 155 | ## tlpkg2manifest [pkgname] |
---|
| 156 | tlpkg2manifest(){ |
---|
| 157 | [ $# -eq 1 ] || return 1 |
---|
| 158 | local pkg=$1 |
---|
| 159 | local pkgdeps="$(tlpkg4a --depend $pkg)" |
---|
[1521] | 160 | local i= |
---|
[1476] | 161 | |
---|
| 162 | tlpkg4a --filelist $pkg || return 1 |
---|
| 163 | |
---|
[1496] | 164 | ## if $pkg is not collection-*, only return the filelist of $pkg |
---|
[5075] | 165 | $__echo $pkg | egrep -q "^collection-" || return 0 |
---|
[1496] | 166 | |
---|
[1476] | 167 | ##!! we need pure filelist of $pkg; remove collection-* |
---|
[5075] | 168 | pkgdeps=$($__echo $pkgdeps | sed -e "s,collection-[-A-Za-z0-9]*,,g") |
---|
[1476] | 169 | |
---|
| 170 | [ -z "$pkgdeps" ] && return 0 |
---|
| 171 | for i in $pkgdeps; do |
---|
| 172 | tlpkg4a --filelist $i || return 1 |
---|
| 173 | done |
---|
| 174 | |
---|
| 175 | return 0 |
---|
| 176 | } |
---|
| 177 | |
---|
| 178 | ## tlpkg2maplist [pkgname] |
---|
| 179 | tlpkg2maplist(){ |
---|
| 180 | [ $# -eq 1 ] || return 1 |
---|
| 181 | local pkg=$1 |
---|
| 182 | local pkgdeps="$(tlpkg4a --depend $pkg)" |
---|
[1521] | 183 | local i= |
---|
[1476] | 184 | |
---|
| 185 | tlpkg4a --execute $pkg | grep -e "Map" | sed -e "s,^add,,g" |
---|
| 186 | |
---|
| 187 | ##!! we need pure filelist of $pkg; remove collection-* |
---|
[5075] | 188 | pkgdeps=$($__echo $pkgdeps | sed -e "s,collection-[-A-Za-z0-9]*,,g") |
---|
[1476] | 189 | |
---|
| 190 | [ -z "$pkgdeps" ] && return 0 |
---|
| 191 | for i in $pkgdeps; do |
---|
| 192 | tlpkg4a --execute $i | grep -e "Map" | sed -e "s,^add,,g" |
---|
| 193 | done |
---|
| 194 | |
---|
| 195 | return 0 |
---|
| 196 | } |
---|
| 197 | |
---|
[1496] | 198 | ## tlpkg2inilist [pkgname] |
---|
| 199 | tlpkg2inilist(){ |
---|
| 200 | [ $# -eq 1 ] || return 1 |
---|
| 201 | local pkg=$1 |
---|
| 202 | local pkgdeps="$(tlpkg4a --depend $pkg)" |
---|
[1521] | 203 | local i= |
---|
[1476] | 204 | |
---|
[1496] | 205 | ## search AddFormat, AddHypen |
---|
| 206 | tlpkg4a --execute $pkg | grep -e "Add" |
---|
| 207 | |
---|
| 208 | ##!! we need pure filelist of $pkg; remove collection-* |
---|
[5075] | 209 | pkgdeps=$($__echo $pkgdeps | sed -e "s,collection-[-A-Za-z0-9]*,,g") |
---|
[1496] | 210 | |
---|
| 211 | [ -z "$pkgdeps" ] && return 0 |
---|
| 212 | for i in $pkgdeps; do |
---|
| 213 | tlpkg4a --execute $i | grep -e "Add" |
---|
| 214 | done |
---|
| 215 | |
---|
| 216 | return 0 |
---|
| 217 | } |
---|
| 218 | |
---|
[1476] | 219 | ## mkrpmspec [pkgname] |
---|
| 220 | mkrpmspec(){ |
---|
| 221 | [ $# -eq 1 ] || return 1 |
---|
| 222 | local pkg=$1 |
---|
[1521] | 223 | local i= |
---|
[1476] | 224 | |
---|
| 225 | RPM_SUMMARY="TeX Live: $(tlpkg4a --shortdesc $pkg)" |
---|
| 226 | |
---|
| 227 | ## Requires tag for texlive |
---|
[5078] | 228 | RPM_REQUIRES=$(for i in $(tlpkg4a --depend $pkg | egrep "^collection-" | egrep -v "^collection-documentation"); do \ |
---|
| 229 | $__echo "Requires: texlive-$i = %{version}"; \ |
---|
| 230 | done) |
---|
[1476] | 231 | |
---|
[5242] | 232 | ## Requires tag for external dependencies |
---|
[5246] | 233 | [ ! -z "$ASYMPTOTE_PACKAGE" ] && \ |
---|
| 234 | [ ! -z "$(tlpdb2rpmspec --depend $pkg | egrep "^asymptote")" ] && \ |
---|
| 235 | RPM_REQUIRES="${RPM_REQUIRES} |
---|
| 236 | Requires: $ASYMPTOTE_PACKAGE" |
---|
[5242] | 237 | [ ! -z "$DETEX_PACKAGE" ] && \ |
---|
| 238 | [ ! -z "$(tlpdb2rpmspec --depend $pkg | egrep "^detex")" ] && \ |
---|
| 239 | RPM_REQUIRES="${RPM_REQUIRES} |
---|
| 240 | Requires: $DETEX_PACKAGE" |
---|
| 241 | [ ! -z "$DVIPNG_PACKAGE" ] && \ |
---|
| 242 | [ ! -z "$(tlpdb2rpmspec --depend $pkg | egrep "^dvipng")" ] && \ |
---|
| 243 | RPM_REQUIRES="${RPM_REQUIRES} |
---|
| 244 | Requires: $DVIPNG_PACKAGE" |
---|
| 245 | [ ! -z "$LATEXMK_PACKAGE" ] && \ |
---|
| 246 | [ ! -z "$(tlpdb2rpmspec --depend $pkg | egrep "^latexmk")" ] && \ |
---|
| 247 | RPM_REQUIRES="${RPM_REQUIRES} |
---|
| 248 | Requires: $LATEXMK_PACKAGE" |
---|
| 249 | [ ! -z "$LCDF_TYPETOOLS_PACKAGE" ] && \ |
---|
| 250 | [ ! -z "$(tlpdb2rpmspec --depend $pkg | egrep "^lcdftypetools")" ] && \ |
---|
| 251 | RPM_REQUIRES="${RPM_REQUIRES} |
---|
| 252 | Requires: $LCDF_TYPETOOLS_PACKAGE" |
---|
| 253 | [ ! -z "$PSUTILS_PACKAGE" ] && \ |
---|
| 254 | [ ! -z "$(tlpdb2rpmspec --depend $pkg | egrep "^psutils")" ] && \ |
---|
| 255 | RPM_REQUIRES="${RPM_REQUIRES} |
---|
| 256 | Requires: $PSUTILS_PACKAGE" |
---|
| 257 | [ ! -z "$T1UTILS_PACKAGE" ] && \ |
---|
| 258 | [ ! -z "$(tlpdb2rpmspec --depend $pkg | egrep "^t1utils")" ] && \ |
---|
| 259 | RPM_REQUIRES="${RPM_REQUIRES} |
---|
| 260 | Requires: $T1UTILS_PACKAGE" |
---|
| 261 | |
---|
[1476] | 262 | ## License tag |
---|
| 263 | RPM_LICENSE="$(tlpkg2speclicense $pkg)," |
---|
| 264 | for i in $(tlpkg4a --depend $pkg | egrep -v "^collection-"); do |
---|
| 265 | tmp=$(tlpkg2speclicense $i) |
---|
[5075] | 266 | $__echo "$RPM_LICENSE" | grep -q "${tmp}," |
---|
[1476] | 267 | [ $? -eq 1 ] && RPM_LICENSE="${RPM_LICENSE} ${tmp}," |
---|
| 268 | done |
---|
[5075] | 269 | RPM_LICENSE=$($__echo "$RPM_LICENSE" | sed -e "s/,$//" | sed -e "s/^, //") |
---|
[1476] | 270 | [ -z "$RPM_LICENSE" ] && RPM_LICENSE=distributable |
---|
| 271 | |
---|
[1499] | 272 | PKG_SHORTDESC=$(tlpkg4a --shortdesc $pkg) |
---|
| 273 | PKG_LONGDESC=$(tlpkg4a --longdesc $pkg) |
---|
| 274 | |
---|
| 275 | PKG_CTANPKGSLIST=$(for i in $(tlpkg4a --depend $pkg); do \ |
---|
[5075] | 276 | if [ -z "$($__echo "$i" | grep "collection-")" ]; then \ |
---|
| 277 | $__echo -n "$i: "; \ |
---|
[1499] | 278 | tmp=$(tlpkg4a --shortdesc $i); \ |
---|
[5075] | 279 | [ -z "${tmp}" ] && $__echo || $__echo "$tmp"; \ |
---|
[1499] | 280 | fi |
---|
| 281 | done) |
---|
| 282 | |
---|
| 283 | PKG_MANIFEST=$(tlpkg2manifest $pkg) |
---|
[1521] | 284 | [ -z "${PKG_MANIFEST}" ] && \ |
---|
[5080] | 285 | $__echo "W: empty manifest: $pkg" >&2 |
---|
[1499] | 286 | |
---|
[5078] | 287 | ## check to need the subpackage %{name}-doc |
---|
[1476] | 288 | with_docpkg=0 |
---|
[5078] | 289 | if [ -z "$($__echo $pkg | grep "collection-documentation")" ]; then |
---|
| 290 | for i in ${PKG_MANIFEST}; do |
---|
| 291 | [ ! -z "$($__echo "$i" | grep texmf-dist/doc/)" ] && \ |
---|
| 292 | with_docpkg=1 && break |
---|
| 293 | done |
---|
| 294 | fi |
---|
[1476] | 295 | |
---|
[1496] | 296 | with_maplist=0 |
---|
| 297 | MAPLIST="$(tlpkg2maplist $pkg)" |
---|
| 298 | [ ! -z "$MAPLIST" ] && with_maplist=1 |
---|
[5075] | 299 | ##$__echo $with_maplist && $__echo "$MAPLIST" && exit |
---|
[1496] | 300 | |
---|
| 301 | with_inilist=0 |
---|
| 302 | INILIST="$(tlpkg2inilist $pkg)" |
---|
| 303 | [ ! -z "$INILIST" ] && with_inilist=1 |
---|
[5075] | 304 | ##$__echo $with_inilist && $__echo "$INILIST" && exit |
---|
[1496] | 305 | |
---|
[1476] | 306 | cat<<EOF |
---|
| 307 | ## -*- coding: utf-8-unix -*- |
---|
[1709] | 308 | ## NOTE: This spec file is generated by $(basename $0) ${VERSION}-${RELEASE}: |
---|
| 309 | ## $(basename $0) $pkg |
---|
[1476] | 310 | |
---|
[5075] | 311 | %global _use_internal_dependency_generator 0 |
---|
| 312 | %global __find_provides %{nil} |
---|
| 313 | %global __find_requires %{nil} |
---|
| 314 | |
---|
[1476] | 315 | %bcond_with firstbuild |
---|
| 316 | |
---|
| 317 | %define tex_destdir %{_datadir} |
---|
| 318 | %define texmf %{tex_destdir}/texmf |
---|
| 319 | %define texlive_src %{tex_destdir}/texlive-sources |
---|
| 320 | %define build_tex_destdir %{buildroot}%{tex_destdir} |
---|
| 321 | %define build_texmf %{buildroot}%{texmf} |
---|
| 322 | |
---|
| 323 | %define exec_mktexlsr [ -x %{_bindir}/texconfig-sys ] && PATH=%{_bindir}:\$PATH %{_bindir}/texconfig-sys rehash |
---|
| 324 | %define exec_texhash [ -x %{_bindir}/texhash ] && PATH=%{_bindir}:\$PATH %{_bindir}/texhash |
---|
[5198] | 325 | %define exec_updmap [ -x %{_bindir}/updmap-sys ] && PATH=%{_bindir}:\$PATH %{_bindir}/updmap-sys |
---|
[1476] | 326 | %define exec_fmtutil [ -x %{_bindir}/fmtutil-sys ] && PATH=%{_bindir}:\$PATH %{_bindir}/fmtutil-sys --all >/dev/null 2>&1 |
---|
| 327 | %define exec_upddeffont [ -x %{_sbindir}/update-defaultfont ] && %{_sbindir}/update-defaultfont 2> /dev/null |
---|
[5198] | 328 | %define vartexfonts %{_var}/lib/texmf/fonts |
---|
[1476] | 329 | |
---|
| 330 | Summary: ${RPM_SUMMARY} |
---|
[1499] | 331 | Summary(ja): ${RPM_SUMMARY} |
---|
[1476] | 332 | Name: texlive-$pkg |
---|
| 333 | Version: ${VERSION} |
---|
[1915] | 334 | Release: ${RELEASE}%{?_dist_release} |
---|
[1476] | 335 | License: ${RPM_LICENSE} |
---|
| 336 | Group: Applications/Publishing |
---|
| 337 | URL:http://www.tug.org/texlive/ |
---|
| 338 | |
---|
| 339 | Requires: texlive = %{version} |
---|
| 340 | $RPM_REQUIRES |
---|
| 341 | |
---|
| 342 | Requires(post): texlive = %{version} |
---|
| 343 | Requires(postun): texlive = %{version} |
---|
| 344 | BuildRequires: texlive-sources = %{version} |
---|
| 345 | |
---|
| 346 | BuildArch: noarch |
---|
| 347 | Buildroot: %{_tmppath}/%{name}-%{version}-root |
---|
| 348 | |
---|
| 349 | Vendor: ${RPM_VENDOR} |
---|
| 350 | Distribution: ${RPM_DISTRIBUTION} |
---|
| 351 | Packager: ${RPM_PACKAGER} |
---|
| 352 | |
---|
| 353 | %description |
---|
| 354 | The TeX Live software distribution offers a complete TeX system for a |
---|
| 355 | variety of Unix, Macintosh, Windows and other platforms. It |
---|
| 356 | encompasses programs for editing, typesetting, previewing and printing |
---|
| 357 | of TeX documents in many different languages, and a large collection |
---|
| 358 | of TeX macros and font libraries. |
---|
| 359 | |
---|
| 360 | The distribution includes extensive general documentation about TeX, |
---|
| 361 | as well as the documentation for the included software packages. |
---|
| 362 | |
---|
[1499] | 363 | This package is a collection of ${PKG_SHORTDESC}: |
---|
| 364 | ${PKG_LONGDESC} |
---|
[1476] | 365 | |
---|
| 366 | This package contains the following CTAN packages: |
---|
[1499] | 367 | ${PKG_CTANPKGSLIST} |
---|
[1476] | 368 | |
---|
[1499] | 369 | %description -l ja |
---|
| 370 | TeX Live ソフトウェアディストリビューションは、 |
---|
| 371 | さまざまな Unix, Macintosh, Windows、および |
---|
| 372 | 他のプラットホームに対して完全な TeX システムを提供します。 |
---|
| 373 | 多くの異なった言語を含む TeX ドキュメントの |
---|
| 374 | 編集、組版、閲覧、印刷するためのプログラム、 |
---|
| 375 | そして、TeX マクロやフォントライブラリの大きなコレクションを |
---|
| 376 | 同梱しています。 |
---|
| 377 | |
---|
| 378 | このディストリビューションは |
---|
| 379 | 同梱しているソフトウェアパッケージのためのドキュメントばかりでなく、 |
---|
| 380 | TeX に関するたくさんの一般的なドキュメントを含んでいます。 |
---|
| 381 | |
---|
| 382 | このパッケージは以下のようなパッケージ集です。 |
---|
| 383 | ${PKG_SHORTDESC}: |
---|
| 384 | ${PKG_LONGDESC} |
---|
| 385 | |
---|
| 386 | このパッケージは以下の CTAN パッケージを含んでいます: |
---|
| 387 | ${PKG_CTANPKGSLIST} |
---|
| 388 | |
---|
[1476] | 389 | EOF |
---|
| 390 | |
---|
| 391 | ## subpackage: %{name}-doc |
---|
| 392 | if [ $with_docpkg -eq 1 ]; then |
---|
| 393 | cat<<EOF |
---|
| 394 | %package doc |
---|
| 395 | Summary: TeX Live: Documentation files of %{name} |
---|
| 396 | Group: Applications/Publishing |
---|
| 397 | Requires: %{name} = %{version}-%{release} |
---|
| 398 | |
---|
| 399 | %description doc |
---|
| 400 | This package contains documentation files of %{name}. |
---|
| 401 | |
---|
| 402 | EOF |
---|
| 403 | fi |
---|
| 404 | |
---|
| 405 | cat<<EOF |
---|
| 406 | %prep |
---|
| 407 | |
---|
| 408 | %build |
---|
| 409 | |
---|
| 410 | %install |
---|
| 411 | [ -n "%{buildroot}" -a "%{buildroot}" != / ] && %__rm -rf %{buildroot} |
---|
| 412 | |
---|
| 413 | PREF=%{buildroot}%{tex_destdir} |
---|
| 414 | |
---|
| 415 | manifest=( |
---|
[1499] | 416 | ${PKG_MANIFEST} |
---|
[1476] | 417 | ) |
---|
| 418 | |
---|
| 419 | %__mkdir_p \${PREF}/texmf-dist |
---|
| 420 | for i in "\${manifest[@]}"; do |
---|
[5075] | 421 | %__install -m \$(stat -c %a %{texlive_src}/\$i) -p -D %{texlive_src}/\$i \${PREF}/\$i |
---|
[1476] | 422 | done |
---|
[3943] | 423 | EOF |
---|
[1476] | 424 | |
---|
[5194] | 425 | cat<<EOF |
---|
| 426 | ## make symlinks of core script utils |
---|
| 427 | mk_symlinks=( |
---|
| 428 | texlive-collection-bibtexextra,/usr/bin/bibexport,/usr/share/texmf-dist/scripts/bibexport/bibexport.sh |
---|
| 429 | texlive-collection-binextra,/usr/bin/arlatex,/usr/share/texmf-dist/scripts/bundledoc/arlatex |
---|
| 430 | texlive-collection-binextra,/usr/bin/bundledoc,/usr/share/texmf-dist/scripts/bundledoc/bundledoc |
---|
| 431 | texlive-collection-binextra,/usr/bin/de-macro,/usr/share/texmf-dist/scripts/de-macro/de-macro |
---|
| 432 | texlive-collection-binextra,/usr/bin/dviasm,/usr/share/texmf-dist/scripts/dviasm/dviasm.py |
---|
| 433 | texlive-collection-binextra,/usr/bin/findhyph,/usr/share/texmf-dist/scripts/findhyph/findhyph |
---|
| 434 | texlive-collection-binextra,/usr/bin/fragmaster,/usr/share/texmf-dist/scripts/fragmaster/fragmaster.pl |
---|
| 435 | texlive-collection-binextra,/usr/bin/installfont-tl,/usr/share/texmf-dist/scripts/installfont/installfont-tl |
---|
| 436 | texlive-collection-binextra,/usr/bin/latex2man,/usr/share/texmf-dist/scripts/latex2man/latex2man |
---|
| 437 | texlive-collection-binextra,/usr/bin/latexdiff,/usr/share/texmf-dist/scripts/latexdiff/latexdiff.pl |
---|
| 438 | texlive-collection-binextra,/usr/bin/latexdiff-vc,/usr/share/texmf-dist/scripts/latexdiff/latexdiff-vc.pl |
---|
| 439 | texlive-collection-binextra,/usr/bin/latexmk,/usr/share/texmf-dist/scripts/latexmk/latexmk.pl |
---|
| 440 | texlive-collection-binextra,/usr/bin/latexrevise,/usr/share/texmf-dist/scripts/latexdiff/latexrevise.pl |
---|
| 441 | texlive-collection-binextra,/usr/bin/listings-ext.sh,/usr/share/texmf-dist/scripts/listings-ext/listings-ext.sh |
---|
| 442 | texlive-collection-binextra,/usr/bin/mkjobtexmf,/usr/share/texmf-dist/scripts/mkjobtexmf/mkjobtexmf.pl |
---|
| 443 | texlive-collection-binextra,/usr/bin/pdf180,/usr/share/texmf-dist/scripts/pdfjam/pdf180 |
---|
| 444 | texlive-collection-binextra,/usr/bin/pdf270,/usr/share/texmf-dist/scripts/pdfjam/pdf270 |
---|
| 445 | texlive-collection-binextra,/usr/bin/pdf90,/usr/share/texmf-dist/scripts/pdfjam/pdf90 |
---|
| 446 | texlive-collection-binextra,/usr/bin/pdfbook,/usr/share/texmf-dist/scripts/pdfjam/pdfbook |
---|
| 447 | texlive-collection-binextra,/usr/bin/pdfcrop,/usr/share/texmf-dist/scripts/pdfcrop/pdfcrop.pl |
---|
| 448 | texlive-collection-binextra,/usr/bin/pdfflip,/usr/share/texmf-dist/scripts/pdfjam/pdfflip |
---|
| 449 | texlive-collection-binextra,/usr/bin/pdfjam,/usr/share/texmf-dist/scripts/pdfjam/pdfjam |
---|
| 450 | texlive-collection-binextra,/usr/bin/pdfjam-pocketmod,/usr/share/texmf-dist/scripts/pdfjam/pdfjam-pocketmod |
---|
| 451 | texlive-collection-binextra,/usr/bin/pdfjam-slides3up,/usr/share/texmf-dist/scripts/pdfjam/pdfjam-slides3up |
---|
| 452 | texlive-collection-binextra,/usr/bin/pdfjam-slides6up,/usr/share/texmf-dist/scripts/pdfjam/pdfjam-slides6up |
---|
| 453 | texlive-collection-binextra,/usr/bin/pdfjoin,/usr/share/texmf-dist/scripts/pdfjam/pdfjoin |
---|
| 454 | texlive-collection-binextra,/usr/bin/pdfnup,/usr/share/texmf-dist/scripts/pdfjam/pdfnup |
---|
| 455 | texlive-collection-binextra,/usr/bin/pdfpun,/usr/share/texmf-dist/scripts/pdfjam/pdfpun |
---|
| 456 | texlive-collection-binextra,/usr/bin/pkfix,/usr/share/texmf-dist/scripts/pkfix/pkfix.pl |
---|
| 457 | texlive-collection-binextra,/usr/bin/pkfix-helper,/usr/share/texmf-dist/scripts/pkfix-helper/pkfix-helper |
---|
| 458 | texlive-collection-binextra,/usr/bin/purifyeps,/usr/share/texmf-dist/scripts/purifyeps/purifyeps |
---|
| 459 | texlive-collection-binextra,/usr/bin/sty2dtx,/usr/share/texmf-dist/scripts/sty2dtx/sty2dtx.pl |
---|
| 460 | texlive-collection-binextra,/usr/bin/texcount,/usr/share/texmf-dist/scripts/texcount/texcount.pl |
---|
| 461 | texlive-collection-binextra,/usr/bin/texdef,/usr/share/texmf-dist/scripts/texdef/texdef.pl |
---|
| 462 | texlive-collection-binextra,/usr/bin/texdiff,/usr/share/texmf-dist/scripts/texdiff/texdiff |
---|
| 463 | texlive-collection-binextra,/usr/bin/texdirflatten,/usr/share/texmf-dist/scripts/texdirflatten/texdirflatten |
---|
| 464 | texlive-collection-binextra,/usr/bin/texloganalyser,/usr/share/texmf-dist/scripts/texloganalyser/texloganalyser |
---|
| 465 | texlive-collection-fontutils,/usr/bin/afm2afm,/usr/share/texmf-dist/scripts/fontools/afm2afm |
---|
| 466 | texlive-collection-fontutils,/usr/bin/autoinst,/usr/share/texmf-dist/scripts/fontools/autoinst |
---|
| 467 | texlive-collection-fontutils,/usr/bin/cmap2enc,/usr/share/texmf-dist/scripts/fontools/cmap2enc |
---|
| 468 | texlive-collection-fontutils,/usr/bin/epstopdf,/usr/share/texmf-dist/scripts/epstopdf/epstopdf.pl |
---|
| 469 | texlive-collection-fontutils,/usr/bin/font2afm,/usr/share/texmf-dist/scripts/fontools/font2afm |
---|
| 470 | texlive-collection-fontutils,/usr/bin/mkt1font,/usr/share/texmf-dist/scripts/accfonts/mkt1font |
---|
| 471 | texlive-collection-fontutils,/usr/bin/ot2kpx,/usr/share/texmf-dist/scripts/fontools/ot2kpx |
---|
| 472 | texlive-collection-fontutils,/usr/bin/pfm2kpx,/usr/share/texmf-dist/scripts/fontools/pfm2kpx |
---|
| 473 | texlive-collection-fontutils,/usr/bin/showglyphs,/usr/share/texmf-dist/scripts/fontools/showglyphs |
---|
| 474 | texlive-collection-fontutils,/usr/bin/vpl2ovp,/usr/share/texmf-dist/scripts/accfonts/vpl2ovp |
---|
| 475 | texlive-collection-fontutils,/usr/bin/vpl2vpl,/usr/share/texmf-dist/scripts/accfonts/vpl2vpl |
---|
| 476 | texlive-collection-htmlxml,/usr/bin/ht,/usr/share/texmf-dist/scripts/tex4ht/ht.sh |
---|
| 477 | texlive-collection-htmlxml,/usr/bin/htcontext,/usr/share/texmf-dist/scripts/tex4ht/htcontext.sh |
---|
| 478 | texlive-collection-htmlxml,/usr/bin/htlatex,/usr/share/texmf-dist/scripts/tex4ht/htlatex.sh |
---|
| 479 | texlive-collection-htmlxml,/usr/bin/htmex,/usr/share/texmf-dist/scripts/tex4ht/htmex.sh |
---|
| 480 | texlive-collection-htmlxml,/usr/bin/httex,/usr/share/texmf-dist/scripts/tex4ht/httex.sh |
---|
| 481 | texlive-collection-htmlxml,/usr/bin/httexi,/usr/share/texmf-dist/scripts/tex4ht/httexi.sh |
---|
| 482 | texlive-collection-htmlxml,/usr/bin/htxelatex,/usr/share/texmf-dist/scripts/tex4ht/htxelatex.sh |
---|
| 483 | texlive-collection-htmlxml,/usr/bin/htxetex,/usr/share/texmf-dist/scripts/tex4ht/htxetex.sh |
---|
| 484 | texlive-collection-htmlxml,/usr/bin/mk4ht,/usr/share/texmf-dist/scripts/tex4ht/mk4ht.pl |
---|
| 485 | texlive-collection-langgreek,/usr/bin/mkgrkindex,/usr/share/texmf-dist/scripts/mkgrkindex/mkgrkindex |
---|
| 486 | texlive-collection-langindic,/usr/bin/ebong,/usr/share/texmf-dist/scripts/ebong/ebong.py |
---|
| 487 | texlive-collection-latex,/usr/bin/mptopdf,/usr/share/texmf-dist/scripts/context/perl/mptopdf.pl |
---|
| 488 | texlive-collection-latex,/usr/bin/pdfatfi,/usr/share/texmf-dist/scripts/oberdiek/pdfatfi.pl |
---|
| 489 | texlive-collection-latexextra,/usr/bin/authorindex,/usr/share/texmf-dist/scripts/authorindex/authorindex |
---|
| 490 | texlive-collection-latexextra,/usr/bin/makeglossaries,/usr/share/texmf-dist/scripts/glossaries/makeglossaries |
---|
| 491 | texlive-collection-latexextra,/usr/bin/pdfannotextractor,/usr/share/texmf-dist/scripts/pax/pdfannotextractor.pl |
---|
| 492 | texlive-collection-latexextra,/usr/bin/pdfthumb,/usr/share/texmf-dist/scripts/ppower4/pdfthumb.tlu |
---|
| 493 | texlive-collection-latexextra,/usr/bin/perltex,/usr/share/texmf-dist/scripts/perltex/perltex.pl |
---|
| 494 | texlive-collection-latexextra,/usr/bin/ppower4,/usr/share/texmf-dist/scripts/ppower4/ppower4.tlu |
---|
| 495 | texlive-collection-latexextra,/usr/bin/ps4pdf,/usr/share/texmf-dist/scripts/pst-pdf/ps4pdf |
---|
| 496 | texlive-collection-latexextra,/usr/bin/splitindex,/usr/share/texmf-dist/scripts/splitindex/perl/splitindex.pl |
---|
| 497 | texlive-collection-latexextra,/usr/bin/svn-multi,/usr/share/texmf-dist/scripts/svn-multi/svn-multi.pl |
---|
| 498 | texlive-collection-latexextra,/usr/bin/vpe,/usr/share/texmf-dist/scripts/vpe/vpe.pl |
---|
| 499 | texlive-collection-latexrecommended,/usr/bin/thumbpdf,/usr/share/texmf-dist/scripts/thumbpdf/thumbpdf.pl |
---|
| 500 | texlive-collection-luatex,/usr/bin/mkluatexfontdb,/usr/share/texmf-dist/scripts/luaotfload/mkluatexfontdb.lua |
---|
| 501 | texlive-collection-music,/usr/bin/musixflx,/usr/share/texmf-dist/scripts/musixtex/musixflx.lua |
---|
| 502 | texlive-collection-music,/usr/bin/musixtex,/usr/share/texmf-dist/scripts/musixtex/musixtex.lua |
---|
| 503 | texlive-collection-pictures,/usr/bin/cachepic,/usr/share/texmf-dist/scripts/cachepic/cachepic.tlu |
---|
| 504 | texlive-collection-pictures,/usr/bin/epspdf,/usr/share/texmf-dist/scripts/epspdf/epspdf.rb |
---|
| 505 | texlive-collection-pictures,/usr/bin/epspdftk,/usr/share/texmf-dist/scripts/epspdf/epspdftk.tcl |
---|
| 506 | texlive-collection-pictures,/usr/bin/fig4latex,/usr/share/texmf-dist/scripts/fig4latex/fig4latex |
---|
| 507 | texlive-collection-pictures,/usr/bin/mathspic,/usr/share/texmf-dist/scripts/mathspic/mathspic.pl |
---|
| 508 | texlive-collection-pstricks,/usr/bin/pst2pdf,/usr/share/texmf-dist/scripts/pst2pdf/pst2pdf |
---|
| 509 | texlive-collection-science,/usr/bin/ulqda,/usr/share/texmf-dist/scripts/ulqda/ulqda.pl |
---|
| 510 | ) |
---|
| 511 | %__mkdir_p %{buildroot}%{_bindir} |
---|
| 512 | pushd %{buildroot}%{_bindir} |
---|
| 513 | for i in "\${mk_symlinks[@]}"; do |
---|
| 514 | tlc=\$(echo \$i | cut -f 1 -d",") |
---|
| 515 | lnk=\$(echo \$i | cut -f 2 -d"," | %__sed -e "s|/usr/bin/||") |
---|
| 516 | rlnk=\$(echo \$i | cut -f 3 -d"," | %__sed -e "s|/usr/|../|") |
---|
[3943] | 517 | |
---|
[5194] | 518 | [ "%{name}" = "\$tlc" ] || continue |
---|
| 519 | [ -f \$rlnk ] || exit 1 |
---|
| 520 | %__ln_s \$rlnk \$lnk || exit 1 |
---|
| 521 | done |
---|
| 522 | popd |
---|
| 523 | EOF |
---|
[3943] | 524 | |
---|
[5242] | 525 | ## external dependencies |
---|
| 526 | if [ ! -z "$LATEXMK_PACKAGE" -a \ |
---|
| 527 | ! -z "$(tlpdb2rpmspec --depend $pkg | egrep "^latexmk")" ]; then |
---|
[3943] | 528 | cat<<EOF |
---|
[5242] | 529 | ## use external packages |
---|
| 530 | %__rm %{buildroot}/usr/bin/latexmk || exit 1 |
---|
| 531 | |
---|
| 532 | EOF |
---|
| 533 | fi |
---|
| 534 | |
---|
| 535 | cat<<EOF |
---|
[1476] | 536 | ## Files list |
---|
| 537 | find %{buildroot} -type f -or -type l | \\ |
---|
| 538 | %__sed -e "s|%{buildroot}||g" > filelist.full |
---|
| 539 | |
---|
| 540 | find %{buildroot}%{texmf}-dist -type d | \\ |
---|
| 541 | %__sed -e "s|^%{buildroot}|%dir |" \\ |
---|
| 542 | -e "s|\$|/|" >> filelist.full |
---|
| 543 | |
---|
| 544 | EOF |
---|
| 545 | |
---|
| 546 | ## subpackage: %{name}-doc |
---|
| 547 | if [ $with_docpkg -eq 1 ]; then |
---|
| 548 | cat<<EOF |
---|
| 549 | ## subpackages |
---|
| 550 | grep "/texmf-dist/doc/" filelist.full > filelist.doc |
---|
| 551 | cat filelist.doc filelist.full | sort | uniq -u > filelist.tmp |
---|
| 552 | %__mv -f filelist.tmp filelist.full |
---|
| 553 | |
---|
| 554 | EOF |
---|
| 555 | fi |
---|
| 556 | |
---|
| 557 | cat<<EOF |
---|
| 558 | %clean |
---|
| 559 | %__rm -rf %{buildroot} |
---|
| 560 | |
---|
| 561 | %post |
---|
| 562 | %{exec_texhash} |
---|
[1496] | 563 | |
---|
| 564 | EOF |
---|
| 565 | |
---|
| 566 | ## Running updmap |
---|
| 567 | if [ $with_maplist -eq 1 ]; then |
---|
| 568 | cat<<EOF |
---|
[1498] | 569 | [ -f %{texmf}/web2c/updmap.cfg ] || exit 0 |
---|
| 570 | |
---|
[2499] | 571 | updmap_lock=%{texmf}/updmap.lock |
---|
[5075] | 572 | $($__echo "$MAPLIST" | while read maptype map; do \ |
---|
[1496] | 573 | cat<<EOT |
---|
[2499] | 574 | %{exec_updmap} --listmaps 2>/dev/null | egrep -q "^#! ${maptype} ${map}" && \\ |
---|
| 575 | echo -n " " && \\ |
---|
| 576 | echo -n "Running updmap: enable ${map} ... " && \\ |
---|
| 577 | %{exec_updmap} --nomkmap --enable ${maptype} ${map} >/dev/null 2>&1 && \\ |
---|
| 578 | echo "done." && \\ |
---|
| 579 | touch \${updmap_lock} |
---|
[1496] | 580 | EOT |
---|
| 581 | done) |
---|
[2499] | 582 | |
---|
| 583 | rpm -q --quiet texlive-common || exit 0 |
---|
| 584 | |
---|
| 585 | [ -f \${updmap_lock} ] && \\ |
---|
| 586 | echo -n " " && \\ |
---|
[1915] | 587 | echo -n "Running updmap: recreate map files ... " && \\ |
---|
| 588 | %{exec_updmap} >/dev/null 2>&1 && \\ |
---|
[2499] | 589 | echo "done." && \\ |
---|
| 590 | rm -f \${updmap_lock} |
---|
[1496] | 591 | |
---|
| 592 | EOF |
---|
[1476] | 593 | fi |
---|
| 594 | |
---|
[1496] | 595 | ## Running fmtutil |
---|
| 596 | if [ $with_inilist -eq 1 ]; then |
---|
| 597 | cat<<EOF |
---|
[2499] | 598 | rpm -q --quiet texlive-common || exit 0 |
---|
| 599 | |
---|
[1496] | 600 | echo -n " " |
---|
| 601 | echo -n "Running fmtutil ... " && %{exec_fmtutil} && echo "done." |
---|
| 602 | |
---|
| 603 | EOF |
---|
[1476] | 604 | fi |
---|
| 605 | |
---|
[1496] | 606 | cat<<EOF |
---|
[1476] | 607 | exit 0 |
---|
| 608 | |
---|
| 609 | |
---|
| 610 | %postun |
---|
| 611 | if [ "\$1" = 0 ]; then |
---|
| 612 | %{exec_texhash} |
---|
[1496] | 613 | |
---|
| 614 | EOF |
---|
| 615 | |
---|
| 616 | ## Running updmap |
---|
| 617 | if [ $with_maplist -eq 1 ]; then |
---|
| 618 | cat<<EOF |
---|
[1498] | 619 | [ -f %{texmf}/web2c/updmap.cfg ] || exit 0 |
---|
| 620 | |
---|
[5075] | 621 | $($__echo "$MAPLIST" | while read maptype map; do \ |
---|
[1496] | 622 | cat<<EOT |
---|
[1499] | 623 | %{exec_updmap} --listmaps 2>/dev/null | egrep -q "^${maptype} ${map}" && \\ |
---|
| 624 | echo -n " " && \\ |
---|
| 625 | echo -n "Running updmap: disable ${map} ... " && \\ |
---|
[1915] | 626 | %{exec_updmap} --nomkmap --disable ${map} >/dev/null 2>&1 && \\ |
---|
[1496] | 627 | echo "done." |
---|
| 628 | EOT |
---|
| 629 | done) |
---|
[2499] | 630 | echo -n " " && \\ |
---|
| 631 | echo -n "Running updmap: recreate map files ... " && \\ |
---|
| 632 | %{exec_updmap} >/dev/null 2>&1 && \\ |
---|
| 633 | echo "done." |
---|
[1496] | 634 | |
---|
| 635 | EOF |
---|
[1476] | 636 | fi |
---|
| 637 | |
---|
[1496] | 638 | cat<<EOF |
---|
| 639 | fi |
---|
| 640 | |
---|
[1476] | 641 | exit 0 |
---|
| 642 | |
---|
| 643 | %files -f filelist.full |
---|
[5075] | 644 | %defattr(-,root,root,-) |
---|
[1476] | 645 | |
---|
| 646 | EOF |
---|
| 647 | ## subpackage: %{name}-doc |
---|
| 648 | if [ $with_docpkg -eq 1 ]; then |
---|
| 649 | cat<<EOF |
---|
| 650 | %files -f filelist.doc doc |
---|
[5075] | 651 | %defattr(-,root,root,-) |
---|
[1476] | 652 | |
---|
| 653 | EOF |
---|
| 654 | fi |
---|
| 655 | |
---|
| 656 | cat<<EOF |
---|
| 657 | %changelog |
---|
[5242] | 658 | * Sat Dec 3 2011 Munehiro Yamamoto <munepi@vinelinux.org> 2011-2 |
---|
| 659 | - generated by $(basename $0) 2011-2: $(basename $0) $($__echo $*) |
---|
| 660 | - set external dependencies (texlive-collection-binextra, |
---|
| 661 | texlive-collection-fontutils) |
---|
| 662 | |
---|
[5075] | 663 | * Sun Oct 30 2011 Munehiro Yamamoto <munepi@vinelinux.org> 2011-1 |
---|
| 664 | - generated by $(basename $0) 2011-1: $(basename $0) $($__echo $*) |
---|
| 665 | |
---|
[3943] | 666 | * Mon Mar 23 2011 Munehiro Yamamoto <munepi@vinelinux.org> 2009-4 |
---|
[5075] | 667 | - generated by $(basename $0) 2009-4: $(basename $0) $($__echo $*) |
---|
[3943] | 668 | - make symlinks of core script utils (texlive-collection-binextra, |
---|
| 669 | texlive-collection-context, texlive-collection-fontutils, |
---|
| 670 | texlive-collection-langgreek, texlive-collection-langindic, |
---|
| 671 | texlive-collection-latex, texlive-collection-latexextra, |
---|
| 672 | texlive-collection-latexrecommended, texlive-collection-pictures, |
---|
| 673 | texlive-collection-pstricks, texlive-collection-science) |
---|
[3329] | 674 | |
---|
| 675 | * Fri Jan 14 2011 Munehiro Yamamoto <munepi@vinelinux.org> 2009-3 |
---|
[5075] | 676 | - generated by $(basename $0) 2009-3: $(basename $0) $($__echo $*) |
---|
[2499] | 677 | - improved %%post |
---|
| 678 | |
---|
| 679 | * Fri Oct 01 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2009-2 |
---|
[5075] | 680 | - generated by $(basename $0) 2009-2: $(basename $0) $($__echo $*) |
---|
[1968] | 681 | - removed arch dependent binaries (texlive-collection-latexextra) |
---|
| 682 | - fixed perl path |
---|
[1915] | 683 | - improved updmap process in %%post and %%postun |
---|
| 684 | |
---|
| 685 | * Sat Aug 07 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2009-1 |
---|
[5075] | 686 | - generated by $(basename $0) 2009-1: $(basename $0) $($__echo $*) |
---|
[1476] | 687 | EOF |
---|
| 688 | |
---|
| 689 | return 0 |
---|
| 690 | } |
---|
| 691 | |
---|
[1521] | 692 | ## mkrpmcollection [--minimal-collections|--standard-collections|--full-collections] |
---|
| 693 | mkrpmcollection(){ |
---|
[5075] | 694 | local category=$($__echo $1 | sed -e "s/--\([a-z]*\)-collections/\1/") |
---|
[1521] | 695 | local category_pkglist= |
---|
| 696 | local i= |
---|
| 697 | |
---|
| 698 | case $category in |
---|
| 699 | minimal|standard) |
---|
| 700 | category_pkglist=$(grep -e "${category}," $CATEGORYLIST | sed -e "s/${category},//g" | sed -e "s/,$//g") |
---|
| 701 | ;; |
---|
| 702 | full) |
---|
| 703 | category_pkglist=$(Usage | egrep "^collection-") |
---|
| 704 | ;; |
---|
| 705 | *) |
---|
[5075] | 706 | $__echo "E: unknown category: $category" |
---|
[1521] | 707 | return 1 |
---|
| 708 | ;; |
---|
| 709 | esac |
---|
| 710 | |
---|
| 711 | for i in ${category_pkglist}; do |
---|
| 712 | mkrpmspec $i > texlive-${i}-vl.spec |
---|
[1918] | 713 | if [ $? -eq 1 ]; then |
---|
[5075] | 714 | $__echo "texlive-${i}-vl.spec: " |
---|
[1918] | 715 | cat texlive-${i}-vl.spec |
---|
| 716 | rm -f texlive-${i}-vl.spec |
---|
| 717 | continue |
---|
| 718 | fi |
---|
[1521] | 719 | rpmbuild -ba texlive-${i}-vl.spec || return 1 |
---|
| 720 | done |
---|
| 721 | |
---|
| 722 | return 0 |
---|
| 723 | } |
---|
| 724 | |
---|
[1476] | 725 | setup-tlpdb2rpmspec(){ |
---|
[5075] | 726 | __echo=$(which echo 2>/dev/null) |
---|
| 727 | [ ! -f $__echo ] && return 1 |
---|
| 728 | |
---|
[5242] | 729 | ## set external dependencies |
---|
[5246] | 730 | ASYMPTOTE_PACKAGE= |
---|
[5242] | 731 | DETEX_PACKAGE= |
---|
| 732 | DVIPNG_PACKAGE= |
---|
| 733 | LATEXMK_PACKAGE= |
---|
| 734 | LCDF_TYPETOOLS_PACKAGE= |
---|
| 735 | PSUTILS_PACKAGE= |
---|
| 736 | T1UTILS_PACKAGE= |
---|
| 737 | |
---|
[1476] | 738 | ## load your .vtlpkg.conf |
---|
| 739 | if [ -f ${HOME}/.vtlpkg.conf ]; then |
---|
| 740 | . ${HOME}/.vtlpkg.conf |
---|
| 741 | else |
---|
[5075] | 742 | $__echo "E: ${HOME}/.vtlpkg.conf: No such file" |
---|
[1476] | 743 | return 1 |
---|
| 744 | fi |
---|
| 745 | |
---|
| 746 | [ -z "$RPM_VENDOR" ] && \ |
---|
[5075] | 747 | $__echo "E: \$RPM_VENDOR is empty" && return 1 |
---|
[1476] | 748 | [ -z "$RPM_DISTRIBUTION" ] && \ |
---|
[5075] | 749 | $__echo "E: \$RPM_DISTRIBUTION is empty" && return 1 |
---|
[1476] | 750 | [ -z "$RPM_GPG_NAME" ] && \ |
---|
[5075] | 751 | $__echo "E: \$RPM_GPG_NAME is empty" && return 1 |
---|
[1476] | 752 | [ -z "$RPM_PACKAGER" ] && \ |
---|
[5075] | 753 | $__echo "E: \$RPM_PACKAGER is empty" && return 1 |
---|
[1476] | 754 | |
---|
| 755 | ## setup configurations |
---|
| 756 | VERSION=@@VTLPKG_VERSION@@ |
---|
| 757 | RELEASE=@@VTLPKG_RELEASE@@ |
---|
| 758 | |
---|
| 759 | ## set a tlpdb file for TeX Live, which is a package database file. |
---|
| 760 | TLPDB=@@VTLPKG_TLPDB@@ |
---|
[5075] | 761 | TLPDB_MAXLINE=$(wc -l $TLPDB | awk '{print $1}') |
---|
[1476] | 762 | |
---|
[1521] | 763 | ## category of collection-* |
---|
| 764 | CATEGORYLIST=@@VTLPKG_CATEGORYLIST@@ |
---|
| 765 | |
---|
[1476] | 766 | ## set some booleans |
---|
| 767 | with_option=0 |
---|
| 768 | } |
---|
| 769 | |
---|
| 770 | ############################################################################## |
---|
| 771 | |
---|
| 772 | setup-tlpdb2rpmspec || exit 1 |
---|
| 773 | |
---|
| 774 | check-parameter $* || exit 1 |
---|
| 775 | |
---|
| 776 | case $1 in |
---|
| 777 | --name|--category|--revision|--depend|--shortdesc|--longdesc|--execute|--catalogue-ctan|--catalogue-date|--catalogue-license|--catalogue-version|--filelist) |
---|
| 778 | tlpkg4a $1 $2 || exit 1 |
---|
| 779 | ;; |
---|
[1521] | 780 | --minimal-collections|--standard-collections|--full-collections) |
---|
| 781 | mkrpmcollection $1 || exit 1 |
---|
[1476] | 782 | ;; |
---|
| 783 | *) |
---|
| 784 | mkrpmspec $1 || exit 1 |
---|
| 785 | ;; |
---|
| 786 | esac |
---|
| 787 | |
---|
| 788 | exit |
---|
| 789 | |
---|
| 790 | ### end of file |
---|