jvf-vl.spec 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. %define tlversion 2012
  2. %define vinepl vine.pls-1.2
  3. %define tfmdir %{texmf}/fonts/tfm/ptex
  4. %define __pltotf %{_bindir}/ppltotf
  5. %define __makejvf %{_bindir}/makejvf
  6. %define __nkf %{_bindir}/nkf
  7. %define tex_destdir %{_datadir}
  8. %define texmf %{tex_destdir}/texmf
  9. %define texlive_src %{tex_destdir}/texlive-sources
  10. %define build_tex_destdir %{buildroot}%{tex_destdir}
  11. %define build_texmf %{buildroot}%{texmf}
  12. ## use some macros for %post, %posttrans
  13. %define touch_run(%1) %{expand:( %__mkdir_p /var/run/texlive; touch /var/run/texlive/run-%1; )
  14. }
  15. %define exec_upddeffont [ -x %{_sbindir}/update-defaultfont ] && \\\
  16. %{_sbindir}/update-defaultfont 2> /dev/null
  17. %define exec_texhash [ -e /var/run/texlive/run-texhash ] && ( \\\
  18. [ -x %{_bindir}/texhash ] && \\\
  19. echo -n " "; echo -n "Running texhash... "; \\\
  20. %{_bindir}/texhash 2> /dev/null; \\\
  21. echo "done." ) && %__rm -f /var/run/texlive/run-texhash;
  22. %define exec_mtxrun [ -e /var/run/texlive/run-mtxrun ] && ( \\\
  23. [ -x %{_bindir}/mtxrun ] && \\\
  24. echo -n " "; echo -n "Running mtxrun... "; \\\
  25. export TEXMF=%{texmf}-dist TEXMFCNF=%{texmf}/web2c TEXMFCACHE=%{texmfsysvar}; \\\
  26. %{_bindir}/mtxrun --generate &> /dev/null; \\\
  27. echo "done." ) && %__rm -f /var/run/texlive/run-mtxrun;
  28. %define exec_fmtutil [ -e /var/run/texlive/run-fmtutil ] && ( \\\
  29. [ -x %{_bindir}/fmtutil-sys ] && \\\
  30. echo -n " "; echo -n "Running fmtutil-sys... "; \\\
  31. %{_bindir}/fmtutil-sys --all &> /dev/null; \\\
  32. echo "done." ) && %__rm -f /var/run/texlive/run-fmtutil;
  33. %define exec_updmap [ -e /var/run/texlive/run-updmap ] && ( \\\
  34. [ -x %{_bindir}/updmap-sys ] && \\\
  35. echo -n " "; echo -n "Running updmap-sys... "; \\\
  36. %{_bindir}/updmap-sys --nohash --quiet &> /dev/null; \\\
  37. echo "done." ) && %__rm -f /var/run/texlive/run-updmap;
  38. Summary: Japanese Virtual Fonts
  39. Summary(ja): 日本語仮想フォントです.
  40. Name: jvf
  41. Version: 7.1
  42. Release: 1%{?_dist_release}
  43. License: distributable
  44. Group: Applications/Publishing
  45. Source0: %{vinepl}.tar.gz
  46. Source1: http://oku.edu.mie-u.ac.jp/~okumura/texfaq/jis-pl.zip
  47. Requires(post): sh-utils
  48. Requires: texlive = %{tlversion}
  49. BuildRequires: nkf
  50. BuildRequires: unzip
  51. ## NOTE: makejvf and ppltotf: contained in texlive
  52. BuildRequires: texlive = %{tlversion}
  53. ## NOTE: tfm/vf files of pTeX:
  54. ## almostly contained in texmf-dist/ of texlive-sources
  55. #BuildRequires: texlive-sources = %{tlversion}
  56. BuildArch: noarch
  57. Buildroot: %{_tmppath}/%{name}-%{version}-root
  58. Obsoletes: texlive-jvf <= 2.0
  59. Vendor: Project Vine
  60. Distribution: Vine Linux
  61. Packager: munepi
  62. %description
  63. Japanese Virtual Fonts required by dvipsk built by makejvf.
  64. %description -l ja
  65. dvipsk の実行に必要な, 日本語仮想フォント(virtual fonts)、
  66. 多書体用フォントメトリックです。
  67. %prep
  68. [ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
  69. %setup -q -c %{name}-%{version}
  70. [ -d %{vinepl} ] && %__mv %{vinepl}/* . && %__rm -r %{vinepl} || exit 1
  71. %__unzip -oqq %{SOURCE1}
  72. %build
  73. ## Macro definition
  74. mkvf(){ # <$1: jfm name> <$2: jfm name of PS font>
  75. for size in 5 6 7 8 9 10 ; do
  76. %__makejvf %{tfmdir}/$1${size}.tfm $2 || exit 1
  77. done
  78. }
  79. ## now, build basic vf fonts
  80. mkvf min rml
  81. mkvf tmin rmlv
  82. mkvf goth gbm
  83. mkvf tgoth gbmv
  84. # jis font metric and vf fonts
  85. for pl in jis jisi tjis tjisi \
  86. min mini tmin tmini; do
  87. %__nkf --jis --overwrite $pl.pl
  88. %__pltotf $pl.pl
  89. done
  90. %__ln_s -f jis.tfm jisg.tfm
  91. %__ln_s -f jisi.tfm jisgi.tfm
  92. %__ln_s -f tjis.tfm tjisg.tfm
  93. %__ln_s -f tjisi.tfm tjisgi.tfm
  94. %__makejvf jis.tfm rml
  95. %__makejvf tjis.tfm rmlv # 縦
  96. %__makejvf jisi.tfm rmli # italic
  97. %__makejvf tjisi.tfm rmlvi
  98. %__makejvf jisg.tfm gbm
  99. %__makejvf tjisg.tfm gbmv
  100. %__makejvf jisgi.tfm gbmi
  101. %__makejvf tjisgi.tfm gbmvi
  102. ## new JIS font metric
  103. # make *.tfm
  104. for pl in jis jisn jis-v jisn-v; do
  105. %__pltotf $pl.pl
  106. done
  107. %__ln_s -f jis.tfm jisg.tfm
  108. %__ln_s -f jis-v.tfm jisg-v.tfm
  109. %__ln_s -f jisn.tfm jisgn.tfm
  110. %__ln_s -f jisn-v.tfm jisgn-v.tfm
  111. # make *.vf
  112. %__makejvf jis.tfm rml
  113. %__makejvf jisn.tfm rmln # 中点修正
  114. %__makejvf jis-v.tfm rmlv # 縦
  115. %__makejvf jisn-v.tfm rmlnv
  116. %__makejvf jisg.tfm gbm
  117. %__makejvf jisgn.tfm gbmn
  118. %__makejvf jisg-v.tfm gbmv
  119. %__makejvf jisgn-v.tfm gbmnv
  120. # extrafonts metric and vf fonts
  121. for i in goth gyo pop lei dfmin dfgt dfgyo dfpop dflei lxmin lxgt lxpop lxmgt lxgtb dfminb dfkaib dfpostb dffry dfbrrb ; do
  122. %__ln_s -f min.tfm ${i}.tfm
  123. %__ln_s -f mini.tfm ${i}i.tfm
  124. %__ln_s -f tmin.tfm t${i}.tfm
  125. %__ln_s -f tmini.tfm t${i}i.tfm
  126. done
  127. for i in min goth gyo pop lei dfmin dfgt dfgyo dfpop dflei lxmin lxgt lxpop lxmgt lxgtb dfminb dfkaib dfpostb dffry dfbrrb; do
  128. %__makejvf ${i}.tfm ${i}
  129. %__makejvf ${i}i.tfm ${i}i
  130. %__makejvf t${i}.tfm t${i}
  131. %__makejvf t${i}i.tfm t${i}i
  132. # %__ln_s -f ${i}.vf df${i}.vf
  133. # %__ln_s -f ${i}i.vf df${i}i.vf
  134. # %__ln_s -f t${i}.vf dft${i}.vf
  135. # %__ln_s -f t${i}i.vf dft${i}i.vf
  136. done
  137. # change same file to symbolic link
  138. for f in *.vf; do
  139. if [ ! -L $f ]; then
  140. for g in *.vf; do
  141. if [ ! -L $g -a $f != $g ]; then
  142. cmp $f $g > /dev/null && (%__rm -f $g; %__ln_s $f $g)
  143. fi
  144. done
  145. fi
  146. done
  147. # ## avoid conflicts in texmf-dist
  148. # %__rm -f jvf-filelist.conflict
  149. # for i in $(find %{texlive_src}/texmf-dist/fonts/{tfm,vf,source}/ptex/ -type f); do
  150. # [ ! -z "$(find $(pwd) -type f | %__grep -e "/$(basename ${i})")" ] && \
  151. # echo -n "${i}: " >> jvf-filelist.conflict && \
  152. # %__rm -fv $(find $(pwd) -type f | %__grep -e "/$(basename ${i})") >> jvf-filelist.conflict && \
  153. # %__ln_s $(echo ${i} | %__sed -e "s,%{texlive_src},%{tex_destdir},") . ||:
  154. # done
  155. %install
  156. %__rm -rf $RPM_BUILD_ROOT
  157. %__mkdir_p %{build_texmf}/fonts/{tfm,source,vf}/ptex
  158. %__cp -dfp *.tfm %{build_texmf}/fonts/tfm/ptex/
  159. %__cp -dfp *.pl %{build_texmf}/fonts/source/ptex/
  160. %__cp -dfp *.vf %{build_texmf}/fonts/vf/ptex/
  161. %clean
  162. %__rm -rf $RPM_BUILD_ROOT
  163. %post
  164. %touch_run texhash
  165. exit 0
  166. %postun
  167. if [ "$1" = 0 ]; then
  168. %touch_run texhash
  169. fi
  170. exit 0
  171. %posttrans
  172. %{exec_texhash}
  173. exit 0
  174. %files
  175. %defattr(-,root,root)
  176. %doc README
  177. %{texmf}/fonts/tfm/ptex/
  178. %{texmf}/fonts/source/ptex/
  179. %{texmf}/fonts/vf/ptex/
  180. %changelog
  181. * Fri Nov 23 2012 Munehiro Yamamoto <munepi@vinelinux.org> 7.1-1
  182. - TeX Live 2012
  183. * Sat Nov 26 2011 Munehiro Yamamoto <munepi@vinelinux.org> 7.0-1
  184. - increase version number to match with distro version
  185. - TeX Live 2011
  186. * Sat Jan 15 2011 Munehiro Yamamoto <munepi@vinelinux.org> 2.0-6
  187. - added Obsoletes: texlive-jvf <= 2.0
  188. - for TeX Live 2009 of VinePlus/5, supported texlive-jvf
  189. * Sun May 16 2010 Munehiro Yamamoto <munepi@vinelinux.org> 2.0-5
  190. - use texlive-2009 + ptexlive-20100322
  191. - dropped Requires: tetex, BuildRequires: tetex
  192. - addeded Requires: texlive, BuildRequires: texlive
  193. - use some rpm macros
  194. * Wed Oct 07 2009 Munehiro Yamamoto <munepi@vinelinux.org> 2.0-4
  195. - added BuildRequires: unzip
  196. - dropped BuildRequires: %%{_prefix}/bin/pltotf %%{tfmdir}/min5.tfm
  197. - %%{_prefix}/bin/pltotf %%{tfmdir}/min5.tfm are provided by tetex
  198. * Sun Sep 27 2009 Munehiro Yamamoto <munepi@vinelinux.org> 2.0-3
  199. - added BuildRequires: nkf
  200. - dropped BuildRequires: makejvf
  201. - /usr/bin/makejvf is provided from tetex, which is with ptexenc
  202. - converted euc-encode to jis-encode for *.pl in vine.pls-1.2
  203. * Sun Jan 11 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-2
  204. - spec in utf8 (again)
  205. * Fri Aug 15 2008 Shu KONNO <owa@bg.wakwak.com> 2.0-1vl5
  206. - applied new versioning policy, spec in utf-8
  207. * Fri Jan 14 2005 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0-0vl1
  208. - add new dynafont for Vine Linux 3.1CR
  209. * Fri Apr 18 2003 Nobuyuki Tsuchimura <tutimura@nn.iij4u.or.jp> 1.1a-0vl3
  210. - change tetex-ptex -> tetex
  211. * Mon Mar 25 2002 Jun Nishii <jun@vinelinux.org> 1.1a-0vl2
  212. - added symlinks for lxricoh fonts
  213. * Sat Mar 24 2001 Nobuyuki Tsuchimura <tutimura@nn.iij4u.or.jp>
  214. - 1.1a-0vl1
  215. - use symbolic link for same *.vf
  216. * Sat Jan 20 2001 Jun Nishii <jun@vinelinux.org>
  217. - 1.0-6
  218. - cp jis.pl min.pl and fix glue for "「,(,..." in min.pl to use DynaFonts
  219. Should I rename min.* as dyna.*?
  220. * Fri Jan 21 2000 Jun Nishii <jun@vinelinux.org>
  221. - 1.0-5
  222. - make vfs for dynafonts
  223. - tjis, tjisi, tmin, tmini,...
  224. - correct installation of tfm
  225. * Fri Jan 7 2000 Jun Nishii <jun@vinelinux.org>
  226. - install makejvf
  227. * Fri Oct 29 1999 Norihito Ohmori <ohmori@flatout.org>
  228. - change group
  229. - add defattr(-,root.root)
  230. * Thu Jul 13 1999 Jun Nishii <jun@flatout.org>
  231. - include jis fonts
  232. * Mon Feb 8 1999 Jun Nishii <jun@flatout.org>
  233. - build vfs by makejvf
  234. - obsoletes vfkanji