OpenType-hiragino-vl.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. %define gsversion %(ghostscript --version)
  2. %define xfontdir %{_datadir}/fonts/%{name}
  3. ## for 7.07
  4. #% define gsfontdir %{_datadir}/ghostscript/Resource/CIDFont
  5. ## for 8.xx
  6. %define gsfontdir %{_datadir}/ghostscript/%{gsversion}/Resource/CIDFont
  7. %define gsfontspecdir %{_datadir}/ghostscript/%{gsversion}/Resource/Font
  8. %define texfontdir %{_datadir}/texmf/fonts/opentype/screen/hiragino
  9. ## use some macros for %post, %posttrans
  10. %define touch_run(%1) %{expand:( %__mkdir_p /var/run/texlive; touch /var/run/texlive/run-%1; )
  11. }
  12. %define exec_upddeffont [ -x %{_sbindir}/update-defaultfont ] && \\\
  13. %{_sbindir}/update-defaultfont 2> /dev/null
  14. %define exec_texhash [ -e /var/run/texlive/run-texhash ] && ( \\\
  15. [ -x %{_bindir}/texhash ] && \\\
  16. echo -n " "; echo -n "Running texhash... "; \\\
  17. %{_bindir}/texhash 2> /dev/null; \\\
  18. echo "done." ) && %__rm -f /var/run/texlive/run-texhash;
  19. %define exec_mtxrun [ -e /var/run/texlive/run-mtxrun ] && ( \\\
  20. [ -x %{_bindir}/mtxrun ] && \\\
  21. echo -n " "; echo -n "Running mtxrun... "; \\\
  22. export TEXMF=%{texmf}-dist TEXMFCNF=%{texmf}/web2c TEXMFCACHE=%{texmfsysvar}; \\\
  23. %{_bindir}/mtxrun --generate &> /dev/null; \\\
  24. echo "done." ) && %__rm -f /var/run/texlive/run-mtxrun;
  25. %define exec_fmtutil [ -e /var/run/texlive/run-fmtutil ] && ( \\\
  26. [ -x %{_bindir}/fmtutil-sys ] && \\\
  27. echo -n " "; echo -n "Running fmtutil-sys... "; \\\
  28. %{_bindir}/fmtutil-sys --all &> /dev/null; \\\
  29. echo "done." ) && %__rm -f /var/run/texlive/run-fmtutil;
  30. %define exec_updmap [ -e /var/run/texlive/run-updmap ] && ( \\\
  31. [ -x %{_bindir}/updmap-sys ] && \\\
  32. echo -n " "; echo -n "Running updmap-sys... "; \\\
  33. %{_bindir}/updmap-sys --nohash --quiet &> /dev/null; \\\
  34. echo "done." ) && %__rm -f /var/run/texlive/run-updmap;
  35. %define FontList \\\
  36. HiraKakuPro-W3,Japan \\\
  37. HiraKakuPro-W6,Japan \\\
  38. HiraKakuStd-W8,Japan \\\
  39. HiraMaruPro-W4,Japan \\\
  40. HiraMinPro-W3,Japan \\\
  41. HiraMinPro-W6,Japan \\\
  42. HiraKakuProN-W3,Japan \\\
  43. HiraKakuProN-W6,Japan \\\
  44. HiraKakuStdN-W8,Japan \\\
  45. HiraMaruProN-W4,Japan \\\
  46. HiraMinProN-W3,Japan \\\
  47. HiraMinProN-W6,Japan \\\
  48. %{?extras: \\\
  49. HiraginoSansGB-W3,GB \\\
  50. HiraginoSansGB-W6,GB \\\
  51. HiraginoSansCNS-W3,CNS \\\
  52. HiraginoSansCNS-W6,CNS \\\
  53. }
  54. %define EncodeList_Japan \\\
  55. 78-EUC-H \\\
  56. 78-EUC-V \\\
  57. 78-H \\\
  58. 78-RKSJ-H \\\
  59. 78-RKSJ-V \\\
  60. 78-V \\\
  61. 78ms-RKSJ-H \\\
  62. 78ms-RKSJ-V \\\
  63. 83pv-RKSJ-H \\\
  64. 90ms-RKSJ-H \\\
  65. 90ms-RKSJ-V \\\
  66. 90msp-RKSJ-H \\\
  67. 90msp-RKSJ-V \\\
  68. 90pv-RKSJ-H \\\
  69. 90pv-RKSJ-V \\\
  70. Add-H \\\
  71. Add-RKSJ-H \\\
  72. Add-RKSJ-V \\\
  73. Add-V \\\
  74. Adobe-Japan1-0 \\\
  75. Adobe-Japan1-1 \\\
  76. Adobe-Japan1-2 \\\
  77. Adobe-Japan1-3 \\\
  78. Adobe-Japan1-4 \\\
  79. Adobe-Japan1-5 \\\
  80. Adobe-Japan1-6 \\\
  81. EUC-H \\\
  82. EUC-V \\\
  83. Ext-H \\\
  84. Ext-RKSJ-H \\\
  85. Ext-RKSJ-V \\\
  86. Ext-V \\\
  87. H \\\
  88. Hankaku \\\
  89. Hiragana \\\
  90. Identity-H \\\
  91. Identity-V \\\
  92. Katakana \\\
  93. NWP-H \\\
  94. NWP-V \\\
  95. RKSJ-H \\\
  96. RKSJ-V \\\
  97. Roman \\\
  98. UniJIS-UCS2-H \\\
  99. UniJIS-UCS2-HW-H \\\
  100. UniJIS-UCS2-HW-V \\\
  101. UniJIS-UCS2-V \\\
  102. UniJIS-UTF16-H \\\
  103. UniJIS-UTF16-V \\\
  104. UniJIS-UTF32-H \\\
  105. UniJIS-UTF32-V \\\
  106. UniJIS-UTF8-H \\\
  107. UniJIS-UTF8-V \\\
  108. UniJIS2004-UTF16-H \\\
  109. UniJIS2004-UTF16-V \\\
  110. UniJIS2004-UTF32-H \\\
  111. UniJIS2004-UTF32-V \\\
  112. UniJIS2004-UTF8-H \\\
  113. UniJIS2004-UTF8-V \\\
  114. UniJISPro-UCS2-HW-V \\\
  115. UniJISPro-UCS2-V \\\
  116. UniJISPro-UTF8-V \\\
  117. UniJISX0213-UTF32-H \\\
  118. UniJISX0213-UTF32-V \\\
  119. UniJISX02132004-UTF32-H \\\
  120. UniJISX02132004-UTF32-V \\\
  121. V \\\
  122. WP-Symbol
  123. %define EncodeList_GB \\\
  124. Adobe-GB1-0 \\\
  125. Adobe-GB1-1 \\\
  126. Adobe-GB1-2 \\\
  127. Adobe-GB1-3 \\\
  128. Adobe-GB1-4 \\\
  129. Adobe-GB1-5 \\\
  130. GB-EUC-H \\\
  131. GB-EUC-V \\\
  132. GB-H \\\
  133. GB-RKSJ-H \\\
  134. GB-V \\\
  135. GBK-EUC-H \\\
  136. GBK-EUC-V \\\
  137. GBK2K-H \\\
  138. GBK2K-V \\\
  139. GBKp-EUC-H \\\
  140. GBKp-EUC-V \\\
  141. GBT-EUC-H \\\
  142. GBT-EUC-V \\\
  143. GBT-H \\\
  144. GBT-RKSJ-H \\\
  145. GBT-V \\\
  146. GBTpc-EUC-H \\\
  147. GBTpc-EUC-V \\\
  148. GBpc-EUC-H \\\
  149. GBpc-EUC-V \\\
  150. Identity-H \\\
  151. Identity-V \\\
  152. UniGB-UCS2-H \\\
  153. UniGB-UCS2-V \\\
  154. UniGB-UTF16-H \\\
  155. UniGB-UTF16-V \\\
  156. UniGB-UTF32-H \\\
  157. UniGB-UTF32-V \\\
  158. UniGB-UTF8-H \\\
  159. UniGB-UTF8-V
  160. %define EncodeList_CNS \\\
  161. Adobe-CNS1-0 \\\
  162. Adobe-CNS1-1 \\\
  163. Adobe-CNS1-2 \\\
  164. Adobe-CNS1-3 \\\
  165. Adobe-CNS1-4 \\\
  166. Adobe-CNS1-5 \\\
  167. Adobe-CNS1-6 \\\
  168. B5-H \\\
  169. B5-V \\\
  170. B5pc-H \\\
  171. B5pc-V \\\
  172. CNS-EUC-H \\\
  173. CNS-EUC-V \\\
  174. CNS1-H \\\
  175. CNS1-V \\\
  176. CNS2-H \\\
  177. CNS2-V \\\
  178. ETHK-B5-H \\\
  179. ETHK-B5-V \\\
  180. ETen-B5-H \\\
  181. ETen-B5-V \\\
  182. ETenms-B5-H \\\
  183. ETenms-B5-V \\\
  184. HKdla-B5-H \\\
  185. HKdla-B5-V \\\
  186. HKdlb-B5-H \\\
  187. HKdlb-B5-V \\\
  188. HKgccs-B5-H \\\
  189. HKgccs-B5-V \\\
  190. HKm314-B5-H \\\
  191. HKm314-B5-V \\\
  192. HKm471-B5-H \\\
  193. HKm471-B5-V \\\
  194. HKscs-B5-H \\\
  195. HKscs-B5-V \\\
  196. Identity-H \\\
  197. Identity-V \\\
  198. UniCNS-UCS2-H \\\
  199. UniCNS-UCS2-V \\\
  200. UniCNS-UTF16-H \\\
  201. UniCNS-UTF16-V \\\
  202. UniCNS-UTF32-H \\\
  203. UniCNS-UTF32-V \\\
  204. UniCNS-UTF8-H \\\
  205. UniCNS-UTF8-V
  206. %define EncodeList_Korea \\\
  207. Adobe-Korea1-0 \\\
  208. Adobe-Korea1-1 \\\
  209. Adobe-Korea1-2 \\\
  210. Identity-H \\\
  211. Identity-V \\\
  212. KSC-EUC-H \\\
  213. KSC-EUC-V \\\
  214. KSC-H \\\
  215. KSC-Johab-H \\\
  216. KSC-Johab-V \\\
  217. KSC-RKSJ-H \\\
  218. KSC-V \\\
  219. KSCms-UHC-H \\\
  220. KSCms-UHC-HW-H \\\
  221. KSCms-UHC-HW-V \\\
  222. KSCms-UHC-V \\\
  223. KSCpc-EUC-H \\\
  224. KSCpc-EUC-V \\\
  225. UniKS-UCS2-H \\\
  226. UniKS-UCS2-V \\\
  227. UniKS-UTF16-H \\\
  228. UniKS-UTF16-V \\\
  229. UniKS-UTF32-H \\\
  230. UniKS-UTF32-V \\\
  231. UniKS-UTF8-H \\\
  232. UniKS-UTF8-V
  233. Summary: Hiragino Japanese/English OpenType Font Basic 6 fonts
  234. Summary(ja): 日本語 ヒラギノ OpenType フォント(基本6書体)
  235. Name: OpenType-hiragino
  236. Version: 10.7
  237. Release: 3%{?_dist_release}
  238. BuildArch: noarch
  239. Source0: DUMMY
  240. # Source0: HiraKakuPro-W3.otf
  241. # Source1: HiraKakuPro-W6.otf
  242. # Source2: HiraKakuStd-W8.otf
  243. # Source3: HiraMaruPro-W4.otf
  244. # Source4: HiraMinPro-W3.otf
  245. # Source5: HiraMinPro-W6.otf
  246. # Source10: HiraKakuProN-W3.otf
  247. # Source11: HiraKakuProN-W6.otf
  248. # Source12: HiraKakuStdN-W8.otf
  249. # Source13: HiraMaruProN-W4.otf
  250. # Source14: HiraMinProN-W3.otf
  251. # Source15: HiraMinProN-W6.otf
  252. # %if %{?extras:1} %{!?extras:0}
  253. # Source20: HiraginoSansGB-W3.otf
  254. # Source21: HiraginoSansGB-W6.otf
  255. # Source22: HiraginoSansCNS-W3.otf
  256. # Source23: HiraginoSansCNS-W6.otf
  257. # %endif
  258. %if %{?nosrc:1} %{!?nosrc:0}
  259. NoSource: 0
  260. # NoSource: 1
  261. # NoSource: 2
  262. # NoSource: 3
  263. # NoSource: 4
  264. # NoSource: 5
  265. # NoSource: 10
  266. # NoSource: 11
  267. # NoSource: 12
  268. # NoSource: 13
  269. # NoSource: 14
  270. # NoSource: 15
  271. # %if %{?extras:1} %{!?extras:0}
  272. # NoSource: 20
  273. # NoSource: 21
  274. # NoSource: 22
  275. # NoSource: 23
  276. # %endif
  277. %endif
  278. License: DAINIPPON SCREEN MFG. CO., LTD.
  279. URL: http://www.screen.co.jp/
  280. Group: User Interface/X
  281. Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
  282. Obsoletes: OTF-Hiragino
  283. Requires(post): fontconfig ghostscript
  284. Requires(postun): fontconfig ghostscript
  285. Distribution: Vine Linux
  286. Vendor: Project Vine
  287. %description
  288. Hiragino basic 6 Japanese OpenType Font using in MacOS X 10.7.
  289. If you want to use Hiragion OpneType Font on X and TeX Live
  290. ((p)xdvi, (p)dvips, dvipdfmx), Ghostscript,
  291. you build and install this package.
  292. To build this package, you copy Hiragino from MacOS X (or package
  293. which you bought) to ~/rpm/SOURCES and rename the fonts name to
  294. "HiraKakuPro-W3.otf" "HiraKakuPro-W6.otf" "HiraKakuStd-W8.otf"
  295. "HiraMaruPro-W4.otf" "HiraMinPro-W3.otf" "HiraMinPro-W6.otf"
  296. "HiraKakuProN-W3.otf" "HiraKakuProN-W6.otf" "HiraKakuStdN-W8.otf"
  297. "HiraMaruProN-W4.otf" "HiraMinProN-W3.otf" "HiraMinProN-W6.otf"
  298. ("HiraginoSansGB-W3.otf" "HiraginoSansGB-W6.otf"
  299. "HiraginoSansCNS-W3.otf" "HiraginoSansCNS-W6.otf").
  300. Then you type
  301. $ rpm -bb ~/rpm/SPEC/%{name}-vl.spec
  302. (If you have HiraginoSansGB and HiraginoSansCNS fonts,
  303. $ rpm -bb --define extras:1 ~/rpm/SPEC/%{name}-vl.spec)
  304. $ sudo apt-get install ~/rpm/RPMS/noarch/%{name}-%{version}-%{release}.noarch.rpm
  305. %description -l ja
  306. MacOS X 10.7 に付属する、或は購入したパッケージのヒラギノ基本6書体
  307. 日本語 OpenType フォントを X や TeX Live ((p)xdvi, (p)dvips, dvipdfmx)、
  308. Ghostscript で使用したい場合は
  309. このパッケージを構築してインストールして下さい。
  310. このパッケージを構築するには MacOS X からヒラギノを
  311. ~/rpm/SOURCES にコピーしてフォント名を
  312. "HiraKakuPro-W3.otf" "HiraKakuPro-W6.otf" "HiraKakuStd-W8.otf"
  313. "HiraMaruPro-W4.otf" "HiraMinPro-W3.otf" "HiraMinPro-W6.otf"
  314. "HiraKakuProN-W3.otf" "HiraKakuProN-W6.otf" "HiraKakuStdN-W8.otf"
  315. "HiraMaruProN-W4.otf" "HiraMinProN-W3.otf" "HiraMinProN-W6.otf"
  316. ("HiraginoSansGB-W3.otf" "HiraginoSansGB-W6.otf"
  317. "HiraginoSansCNS-W3.otf" "HiraginoSansCNS-W6.otf")
  318. に変更して下さい。
  319. 次に、
  320. $ rpm -bb ~/rpm/SPEC/%{name}-vl.spec
  321. (もし HiraginoSansGB, HiraginoSansCNS フォントを持っている場合、
  322. $ rpm -bb --define extras:1 ~/rpm/SPEC/%{name}-vl.spec)
  323. $ sudo apt-get install ~/rpm/RPMS/noarch/%{name}-%{version}-%{release}.noarch.rpm
  324. とタイプして下さい。
  325. %prep
  326. %build
  327. %install
  328. %__rm -rf %{buildroot}
  329. %__mkdir -p %{buildroot}%{xfontdir}
  330. %__mkdir -p %{buildroot}%{gsfontdir}
  331. %__mkdir -p %{buildroot}%{gsfontspecdir}
  332. %__mkdir -p %{buildroot}%{texfontdir}
  333. %__install -p -m 644 \
  334. %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} \
  335. %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} %{SOURCE15} \
  336. %if %{?extras:1} %{!?extras:0}
  337. %{SOURCE20} %{SOURCE22} %{SOURCE22} %{SOURCE23} \
  338. %endif
  339. %{buildroot}%{xfontdir}
  340. ## mkgsfontspec [fontname] [encode] > [fontspec]
  341. mkgsfontspec(){
  342. local fontname=$1
  343. local encode=$2
  344. cat <<EOT
  345. %%!PS-Adobe-3.0 Resource-Font
  346. %%%%DocumentNeededResources: ${encode} (CMap)
  347. %%%%IncludeResource: ${encode} (CMap)
  348. %%%%BeginResource: Font (${fontname}-${encode})
  349. (${fontname}-${encode})
  350. (${encode}) /CMap findresource
  351. [(${fontname}) /CIDFont findresource]
  352. composefont
  353. pop
  354. %%%%EndResource
  355. %%%%EOF
  356. EOT
  357. }
  358. for i in %{FontList}; do
  359. fnt=$(echo $i | %__sed -e "s/,.*$//")
  360. enc=$(echo $i | %__sed -e "s/^.*,//")
  361. case $enc in
  362. Japan) enclist="%{EncodeList_Japan}";;
  363. GB) enclist="%{EncodeList_GB}";;
  364. CNS) enclist="%{EncodeList_CNS}";;
  365. Korea) enclist="%{EncodeList_Korea}";;
  366. *) exit 1;;
  367. esac
  368. %__ln_s -f %{xfontdir}/${fnt}.otf %{buildroot}%{texfontdir}/${fnt}.otf
  369. %__ln_s -f %{xfontdir}/${fnt}.otf %{buildroot}%{gsfontdir}/${fnt}
  370. for j in $enclist; do
  371. mkgsfontspec ${fnt} ${j} > %{buildroot}%{gsfontspecdir}/${fnt}-${j}
  372. done
  373. done
  374. %post
  375. %__font_install_post %{xfontdir}
  376. %touch_run texhash
  377. exit 0
  378. %postun
  379. %__font_install_postun %{xfontdir}
  380. if [ "$1" = 0 ]; then
  381. %touch_run texhash
  382. fi
  383. exit 0
  384. %posttrans
  385. %{exec_texhash}
  386. exit 0
  387. %clean
  388. %__rm -rf %{buildroot}
  389. %files
  390. %defattr(-,root,root)
  391. #%doc README*
  392. %{xfontdir}/*
  393. %{gsfontdir}/*
  394. %{gsfontspecdir}/*
  395. %{texfontdir}/*
  396. %changelog
  397. * Sat Nov 24 2012 Munehiro Yamamoto <munepi@vinelinux.org> 10.7-3
  398. - TeX Live 2012
  399. - change %%texfontdir
  400. * Thu Mar 1 2012 Munehiro Yamamoto <munepi@vinelinux.org> 10.7-2
  401. - dropped Requires(post): chkfontpath
  402. * Sun Nov 27 2011 Munehiro Yamamoto <munepi@vinelinux.org> 10.7-1
  403. - TeX Live 2009
  404. * Sat Jun 11 2011 Munehiro Yamamoto <munepi@vinelinux.org> 10.6-1
  405. - supported Vine Linux 6 + TeX Live 2009
  406. - added Obsoletes: OTF-Hiragino < 10.6
  407. - supported HiraginoSansGB, HiraginoSansCNS
  408. * Sun Jun 07 2009 Munehiro Yamamoto <munepi@vinelinux.org> 10.5-2
  409. - setup for gsversion 8.71
  410. * Sun Jun 07 2009 Munehiro Yamamoto <munepi@cg8.so-net.ne.jp> 10.5-1
  411. - spec in utf8
  412. - applied new versioning policy
  413. - s/Copyright/License/
  414. - corrected %%description
  415. - setup for Ghostscript 8.64
  416. - created many font spec files
  417. * Sat Jun 18 2005 KOBAYASHI Taizo <tkoba@vinelinux.org> 10.4-0vl1
  418. - modified for teTeX3
  419. * Thu Apr 08 2004 KOBAYASHI R. Taizo <tkoba@vinelinux.org> 10.3-0vl4
  420. - fix postun
  421. * Fri Apr 02 2004 KOBAYASHI R. Taizo <tkoba@ike-dyn.ritsumei.ac.jp> 10.3-0vl3
  422. - added target "auto" for updmap-otf v0.2
  423. * Sun Mar 28 2004 KOBAYASHI R. Taizo <tkoba@ike-dyn.ritsumei.ac.jp> 10.3-0vl2
  424. - use updmap-otf
  425. * Wed Feb 05 2004 KOBAYASHI R. Taizo <tkoba@ike-dyn.ritsumei.ac.jp> 10.3-0vl1
  426. - modified for Vine
  427. * Sat Jul 05 2003 KOBAYASHI R. Taizo <tkoba@ike-dyn.ritsumei.ac.jp> 10.2-0il1
  428. - initial release for Hiragino OpenType Font.