1 | [[PageOutline]] |
---|
2 | = tlpdb2rpmspec = |
---|
3 | |
---|
4 | texlive-collection-* の spec ファイルを生成するツールを作成しました。 |
---|
5 | |
---|
6 | [browser:projects/texlive-vtlpkg/trunk] |
---|
7 | |
---|
8 | tlpdb2rpmspec は texlive-vtlpkg パッケージに同梱されています。 |
---|
9 | |
---|
10 | {{{ |
---|
11 | $ sudo apt-get install texlive-vtlpkg |
---|
12 | }}} |
---|
13 | |
---|
14 | == 初期設定 == |
---|
15 | |
---|
16 | /usr/share/texlive-vtlpkg/dot.vtlpkg.conf を ${HOME}/.vtlpkg.conf へコピーして、必要な設定をします。 |
---|
17 | {{{ |
---|
18 | ## |
---|
19 | ## texlive-vtlpkg configuration file |
---|
20 | ## |
---|
21 | ## This configuration is read at the startup of texlive-vtlpkg. |
---|
22 | |
---|
23 | ## set spec suffix |
---|
24 | ## default: RPM_SPEC_SUFFIX=vl |
---|
25 | RPM_SPEC_SUFFIX=vl |
---|
26 | |
---|
27 | ## set your vendor |
---|
28 | ## default: RPM_VENDOR="Project Vine" |
---|
29 | RPM_VENDOR="Project Vine" |
---|
30 | |
---|
31 | ## set your distribution |
---|
32 | ## default: RPM_DISTRIBUTION="Vine Linux" |
---|
33 | RPM_DISTRIBUTION="Vine Linux" |
---|
34 | |
---|
35 | ## set your name and your e-mail address |
---|
36 | ## default: RPM_GPG_NAME="YOUR NAME <your@email.address>" |
---|
37 | RPM_GPG_NAME="" |
---|
38 | |
---|
39 | ## set your packager id |
---|
40 | ## default: RPM_PACKAGER=your_id |
---|
41 | RPM_PACKAGER= |
---|
42 | |
---|
43 | ## set the top of your rpm directory |
---|
44 | ## default: RPM_TOPDIR=${HOME}/rpm |
---|
45 | RPM_TOPDIR=${HOME}/rpm |
---|
46 | |
---|
47 | ## set local tlnet |
---|
48 | ## default: TLNETROOT=/var/local/tlnet |
---|
49 | TLNETROOT=/var/local/tlnet |
---|
50 | ## default: TLPDB=/var/local/tlnet/tlpkg/texlive.tlpdb |
---|
51 | TLPDB=/var/local/tlnet/tlpkg/texlive.tlpdb |
---|
52 | |
---|
53 | ## set external dependencies (optional) |
---|
54 | ## default: ASYMPTOTE_PACKAGE= |
---|
55 | #ASYMPTOTE_PACKAGE=asymptote |
---|
56 | ## default: DETEX_PACKAGE= |
---|
57 | #DETEX_PACKAGE=detex |
---|
58 | ## default: DVIPNG_PACKAGE= |
---|
59 | #DVIPNG_PACKAGE=dvipng |
---|
60 | ## default: LATEXMK_PACKAGE= |
---|
61 | #LATEXMK_PACKAGE=latexmk |
---|
62 | ## default: LCDF_TYPETOOLS_PACKAGE= |
---|
63 | #LCDF_TYPETOOLS_PACKAGE=lcdf-typetools |
---|
64 | ## default: PSUTILS_PACKAGE= |
---|
65 | #PSUTILS_PACKAGE=psutils |
---|
66 | ## default: T1UTILS_PACKAGE= |
---|
67 | #T1UTILS_PACKAGE=t1utils |
---|
68 | |
---|
69 | ## customize some commands if you need (optional) |
---|
70 | #__echo=/bin/echo |
---|
71 | |
---|
72 | ## end of file |
---|
73 | }}} |
---|
74 | |
---|
75 | |
---|
76 | == ヘルプ == |
---|
77 | |
---|
78 | {{{ |
---|
79 | $ tlpdb2rpmspec |
---|
80 | Usage: tlpdb2rpmspec [option] [pkgname] |
---|
81 | |
---|
82 | This script generates a rpm spec file for CTAN and collection-* packages of TeX Live. |
---|
83 | |
---|
84 | Options: |
---|
85 | --name: return [pkgname] |
---|
86 | --category: return the category of [pkgname] |
---|
87 | --revision: return the revision of [pkgname] |
---|
88 | --depend: return dependencies of [pkgname] |
---|
89 | --shortdesc: return the short description of [pkgname] |
---|
90 | --longdesc: return the description of [pkgname] |
---|
91 | --execute: return post processe of [pkgname] |
---|
92 | --catalogue-ctan: return the locate of [pkgname] |
---|
93 | --catalogue-date: return the last update of [pkgname] |
---|
94 | --catalogue-license: return the license of [pkgname] |
---|
95 | --catalogue-version: return the version of [pkgname] |
---|
96 | --filelist: return the filelist of [pkgname] |
---|
97 | --help: show this help |
---|
98 | |
---|
99 | Supoort collections-* packages: |
---|
100 | collection-basic |
---|
101 | collection-bibtexextra |
---|
102 | collection-binextra |
---|
103 | (snip) |
---|
104 | collection-xetex |
---|
105 | }}} |
---|
106 | |
---|
107 | |
---|
108 | == 使い方 == |
---|
109 | |
---|
110 | === 1. TLNET を構築 === |
---|
111 | |
---|
112 | ローカルに [http://www.ctan.org/tex-archive/systems/texlive/tlnet TLNET] を構築するための一例を、 |
---|
113 | {{{ /usr/share/texlive-vtlpkg/_sync-tlnet.sh }}} に作っておきました。 |
---|
114 | この {{{ _sync-tlnet.sh }}} を実行すると、 |
---|
115 | TLNET の国内ミラーサーバの一つである JAIST の TLNET ftp://ftp.jaist.ac.jp/pub/CTAN/systems/texlive/tlnet/ と {{{ rsync }}} コマンドにより同期をとって、 |
---|
116 | ローカルに TLNET を構築できます。 |
---|
117 | {{{ |
---|
118 | $ bash /usr/share/texlive-vtlpkg/_sync-tlnet.sh |
---|
119 | }}} |
---|
120 | |
---|
121 | === 2. spec ファイルを生成 === |
---|
122 | |
---|
123 | 例えば、collection-basic の texlive-collection-basic-vl.spec を生成したい場合は、以下を実行します。 |
---|
124 | |
---|
125 | {{{ |
---|
126 | $ tlpdb2rpmspec collection-basic > texlive-collection-basic-vl.spec |
---|
127 | }}} |
---|
128 | |
---|
129 | {{{rpmbuild -ba texlive-collection-basic-vl.spec}}} を実行すると、 |
---|
130 | texlive-collection-basic-YYYY-NNvlVV.{noarch,src}.rpm, |
---|
131 | texlive-collection-basic-doc-YYYY-NNvlVV.src.rpm |
---|
132 | がビルドされます。 |
---|
133 | |
---|
134 | === 3. rpm を作成 === |
---|
135 | |
---|
136 | 1 で構築した TLNET 内の {{{ archive }}} ディレクトリを {{{ %_sourcedir }}} として、{{{ rpmbuild }}} コマンドを実行します。 |
---|
137 | {{{ |
---|
138 | $ rpmbuild -ba --define="%_sourcedir /var/local/tlnet/archive" texlive-collection-basic-vl.spec |
---|
139 | }}} |
---|
140 | |
---|
141 | 各カテゴリ別に texlive-collection-* を生成したい場合は、以下を実行することにより、rpmbuild まで実行します。 |
---|
142 | {{{ |
---|
143 | 最小(main):$ tlpdb2rpmspec --minimal-collections |
---|
144 | 標準(plus):$ tlpdb2rpmspec --standard-collections |
---|
145 | 最大(plus):$ tlpdb2rpmspec --full-collections |
---|
146 | }}} |
---|
147 | |
---|
148 | また、大量にパッケージを生成する場合は、tee を利用してログを出しておくことが望ましいです。 |
---|
149 | {{{ |
---|
150 | $ tlpdb2rpmspec --full-collections 2>&1 | tee 00full-collections.log |
---|
151 | }}} |
---|
152 | |
---|
153 | |
---|
154 | == macros.texlive == |
---|
155 | |
---|
156 | TeX Live 関連の RPM パッケージを作成する上でよく使われるものを {{{ /etc/rpm/macros.texlive }}} にまとめました。 |
---|
157 | |
---|
158 | {{{ |
---|
159 | # |
---|
160 | # RPM macros for our TeX Live |
---|
161 | # |
---|
162 | |
---|
163 | # default TeX Live directories |
---|
164 | %_tl_texmfroot %{_datadir} |
---|
165 | |
---|
166 | %_tl_texmfconfig ~/.texmf-config |
---|
167 | %_tl_texmfvar ~/.texmf-var |
---|
168 | %_tl_texmfhome ~/texmf |
---|
169 | %_tl_texmfsysconfig %{_sysconfdir}/texmf |
---|
170 | %_tl_texmfsysvar %{_var}/lib/texmf |
---|
171 | %_tl_texmflocal %{_prefix}/local/share/texmf |
---|
172 | %_tl_texmfvine %{_tl_texmfroot}/texmf |
---|
173 | %_tl_texmfdist %{_tl_texmfroot}/texmf-dist |
---|
174 | %_tl_vartexfonts %{_tl_texmfsysvar}/fonts |
---|
175 | |
---|
176 | %_tl_aliasttfdir %{_tl_texmfsysvar}/fonts/truetype/vine |
---|
177 | %_tl_varrundir %{_var}/run/texlive |
---|
178 | |
---|
179 | # some useful functions/macros |
---|
180 | %_tl_touch_run() %{expand:( %__mkdir_p %{_tl_varrundir}; touch %{_tl_varrundir}/run-%1; ) |
---|
181 | } |
---|
182 | |
---|
183 | %_tl_exec_upddeffont [ -x %{_sbindir}/update-defaultfont ] && \\\ |
---|
184 | %{_sbindir}/update-defaultfont 2> /dev/null |
---|
185 | |
---|
186 | %_tl_exec_texhash [ -e %{_tl_varrundir}/run-texhash ] && ( \\\ |
---|
187 | [ -x %{_bindir}/texhash ] && \\\ |
---|
188 | echo -n " "; echo -n "Running texhash... "; \\\ |
---|
189 | %{_bindir}/texhash 2> /dev/null; \\\ |
---|
190 | echo "done." ) && %__rm -f %{_tl_varrundir}/run-texhash; |
---|
191 | |
---|
192 | %_tl_exec_mtxrun [ -e %{_tl_varrundir}/run-mtxrun ] && ( \\\ |
---|
193 | [ -x %{_bindir}/mtxrun ] && \\\ |
---|
194 | echo -n " "; echo -n "Running mtxrun... "; \\\ |
---|
195 | export TEXMF=%{_tl_texmfdist} TEXMFCNF=%{_tl_texmfdist}/web2c TEXMFCACHE=%{_tl_texmfsysvar}; \\\ |
---|
196 | %{_bindir}/mtxrun --generate &> /dev/null; \\\ |
---|
197 | echo "done." ) && %__rm -f %{_tl_varrundir}/run-mtxrun; |
---|
198 | |
---|
199 | %_tl_exec_fmtutil [ -e %{_tl_varrundir}/run-fmtutil ] && ( \\\ |
---|
200 | [ -x %{_bindir}/fmtutil-sys ] && \\\ |
---|
201 | echo -n " "; echo -n "Running fmtutil-sys... "; \\\ |
---|
202 | %{_bindir}/fmtutil-sys --all &> /dev/null; \\\ |
---|
203 | echo "done." ) && %__rm -f %{_tl_varrundir}/run-fmtutil; |
---|
204 | |
---|
205 | %_tl_exec_updmap [ -e %{_tl_varrundir}/run-updmap ] && ( \\\ |
---|
206 | [ -x %{_bindir}/updmap-sys ] && \\\ |
---|
207 | echo -n " "; echo -n "Running updmap-sys... "; \\\ |
---|
208 | yes | %{_bindir}/updmap-sys --syncwithtrees --nohash --quiet &>/dev/null; \\\ |
---|
209 | %{_bindir}/updmap-sys --nohash --quiet &> /dev/null; \\\ |
---|
210 | echo "done." ) && %__rm -f %{_tl_varrundir}/run-updmap; |
---|
211 | |
---|
212 | |
---|
213 | # %_tl_enable_map [maptype] [map] |
---|
214 | %_tl_enable_map() %{expand: %{_bindir}/updmap-sys --nomkmap --nohash --quiet --enable %1 %2 >/dev/null 2>&1 && %_tl_touch_run updmap |
---|
215 | } |
---|
216 | |
---|
217 | # %_tl_disable_map [map] |
---|
218 | %_tl_disable_map() %{expand: %{_bindir}/updmap-sys --nomkmap --nohash --quiet --disable %1 >/dev/null 2>&1 && %_tl_touch_run updmap |
---|
219 | } |
---|
220 | |
---|
221 | # end of file |
---|
222 | }}} |
---|
223 | |
---|
224 | |
---|
225 | |
---|
226 | |
---|
227 | == テスト事項 == |
---|
228 | |
---|
229 | === パッケージングの検証 === |
---|
230 | |
---|
231 | 1. {{{$ tlpdb2rpmspec --full-collections}}} で生成されたすべての rpm パッケージをインストールする。 |
---|
232 | 1. TeX Live の scheme-full からインストールされる {{{ $TEXLIVE/texmf-dist }}} と {{{ /usr/share/texmf-dist }}} との差分比較して確認する。 |
---|
233 | |
---|
234 | |
---|
235 | == 資料 == |
---|
236 | |
---|
237 | === texlive.tlpdb のフィールド一覧 === |
---|
238 | |
---|
239 | {{{ |
---|
240 | $ sed -e "s/^\([-A-z0-9]*\) .*$/\1/g" /var/local/tlnet/tlpkg/texlive.tlpdb | sort | uniq |
---|
241 | |
---|
242 | binfiles |
---|
243 | catalogue |
---|
244 | catalogue-ctan |
---|
245 | catalogue-date |
---|
246 | catalogue-license |
---|
247 | catalogue-version |
---|
248 | category |
---|
249 | containermd5 |
---|
250 | containersize |
---|
251 | depend |
---|
252 | doccontainermd5 |
---|
253 | doccontainersize |
---|
254 | docfiles |
---|
255 | execute |
---|
256 | longdesc |
---|
257 | name |
---|
258 | postaction |
---|
259 | relocated |
---|
260 | revision |
---|
261 | runfiles |
---|
262 | shortdesc |
---|
263 | srccontainermd5 |
---|
264 | srccontainersize |
---|
265 | srcfiles |
---|
266 | }}} |
---|
267 | |
---|
268 | === ライセンスのリスト === |
---|
269 | {{{ |
---|
270 | $ egrep "^catalogue-license" /var/local/tlnet/tlpkg/texlive.tlpdb | sed -e "s,catalogue-license[[:blank:]]*,," | sort | uniq |
---|
271 | apache2 |
---|
272 | artistic |
---|
273 | bsd |
---|
274 | collection |
---|
275 | fdl |
---|
276 | gfl |
---|
277 | gfsl |
---|
278 | gpl |
---|
279 | gpl2 |
---|
280 | gpl3 |
---|
281 | knuth |
---|
282 | lgpl |
---|
283 | lgpl2.1 |
---|
284 | lppl |
---|
285 | lppl1 |
---|
286 | lppl1.2 |
---|
287 | lppl1.3 |
---|
288 | noinfo |
---|
289 | nosource |
---|
290 | ofl |
---|
291 | opl |
---|
292 | other-free |
---|
293 | other-nonfree |
---|
294 | pd |
---|
295 | }}} |
---|
296 | |
---|
297 | |
---|
298 | |
---|
299 | |
---|
300 | == texlive-vtlpkg の主な更新履歴 == |
---|
301 | |
---|
302 | === TeX Live 2014 === |
---|
303 | [browser:projects/texlive-vtlpkg/trunk] |
---|
304 | |
---|
305 | 次期 Vine Linux 7 に対応する予定。 |
---|
306 | |
---|
307 | === TeX Live 2013 === |
---|
308 | [browser:projects/texlive-vtlpkg/2013] |
---|
309 | |
---|
310 | TeX Live 2012 以前の texlive-vtlpkg では、 |
---|
311 | リリースされたバージョンのソースアーカイブスをまとめた texlive-sources パッケージから texlive-collection-* を生成していた。 |
---|
312 | |
---|
313 | TeX Live 2013 以降の texlive-vtlpkg は、TLNET のパッケージから texlive-collection-* を生成するようにした。 |
---|
314 | この変更により、TeX Live の current へ追従しやすくなった。 |
---|
315 | |
---|
316 | === TeX Live 2012 === |
---|
317 | [browser:projects/texlive-vtlpkg/2012] |
---|
318 | |
---|
319 | === TeX Live 2011 === |
---|
320 | [browser:projects/texlive-vtlpkg/tags/2011] |
---|
321 | |
---|
322 | rpm-4.8.1 を利用するため、 |
---|
323 | {{{_use_internal_dependency_generator 0}}} を用いれば、簡単に制御できた。 |
---|
324 | {{{ |
---|
325 | %global _use_internal_dependency_generator 0 |
---|
326 | %global __find_provides %{nil} |
---|
327 | %global __find_requires %{nil} |
---|
328 | }}} |
---|
329 | |
---|
330 | === TeX Live 2009 === |
---|
331 | [browser:projects/texlive-vtlpkg/branches/2009] |
---|
332 | |
---|
333 | Vine Linux 6 および Vine Linux 5 に対応しているため、 |
---|
334 | spec ファイルがやや煩雑になっている。 |
---|
335 | {{{ |
---|
336 | %define __find_provides %{nil} |
---|
337 | %define __find_requires %{nil} |
---|
338 | %define __perl_provides %{nil} |
---|
339 | %define __perl_requires %{nil} |
---|
340 | |
---|
341 | Autoreq: 0 |
---|
342 | }}} |
---|