OpenType-hiragino-vl.spec 11 KB

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