source: projects/emacsen-common/branches/0.4.x/doc/04-CreateElispPackages.tex @ 7238

Revision 7238, 7.9 KB checked in by daisuke, 10 years ago (diff)

import emacsen-common

Line 
1%#!platex emacsen-common
2%%%
3%%% emacsen-common
4%%% --- Section 4: How to create emacsen-common-aware elisp packages
5%%% MATSUBAYASHI 'Shaolin' Kohji <shaolin@vinelinux.org>
6%%% Time-stamp: <2001/12/24 15:38:55 shaolin>
7
8
9%--------8<--------8<--------8<--------8<--------8<--------8<--------
10\newpage
11
12 
13\section{emacsen-common Âбþ elisp ¥Ñ¥Ã¥±¡¼¥¸¤ÎºîÀ®ÊýË¡}
14
15¸½ºß VineSeed ¤ä VineSeedPlus ¤Ë»Ä¤Ã¤Æ¤¤¤ëµìÊý¼°¤Ë¤è¤ë elisp ¥Ñ¥Ã¥±¡¼¥¸¤ò
16emacsen-common Êý¼°¤ËÂбþ¤µ¤»¤ë¡¤¤¢¤ë¤¤¤Ï¿·µ¬¤Ç emacsen-common Âбþ
17¥Ñ¥Ã¥±¡¼¥¸¤òºîÀ®¤¹¤ë¤Î¤ËɬÍפʾðÊó¤ò½ñ¤¤¤Æ¤¤¤Þ¤¹¡¥
18
19¥Ñ¥Ã¥±¡¼¥¸¤Î¹½À®¤Ï´ðËÜŪ¤Ë¤Ï¼¡¤ÎÄ̤ê¤Ç¤¹¡¥
20
21\begin{description}
22 \item[\BoldText{/usr/share/emacs/site-lisp/[¥Ñ¥Ã¥±¡¼¥¸Ì¾]}]
23\ \\
24  \BoldText{.el} ¥Õ¥¡¥¤¥ë¤È¡¤¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë¤ËɬÍפȤʤë
25  ¤½¤Î¾¤Î¥Õ¥¡¥¤¥ë (Makefile ¤ä *-MK, *-CFG ¤½¤Î¾) ¤¬¼ý¤Þ¤ê¤Þ¤¹¡¥
26 \item[\BoldText{/usr/lib/emacsen-common/packages/\{install,remove\}/[¥Ñ¥Ã¥±¡¼¥¸Ì¾]}]
27\ \\
28  ¤½¤Î¥Ñ¥Ã¥±¡¼¥¸¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¤È¤­¤Ë¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë/¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë
29  °Ù¤Î¥¹¥¯¥ê¥×¥È¤È¡¤¥Ñ¥Ã¥±¡¼¥¸¤¬¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿»þ¤Ë¼Â¹Ô¤µ¤ì¤ë¥¹¥¯¥ê¥×¥È
30  ¤¬¼ý¤á¤é¤ì¤Þ¤¹¡¥
31 \item[\BoldText{\%docdir/[¥Ñ¥Ã¥±¡¼¥¸Ì¾]}]
32\ \\
33  ¤½¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉí°¤¹¤ë¥É¥­¥å¥á¥ó¥ÈÅù¤¬¼ý¤á¤é¤ì¤Þ¤¹¡¥
34  ¤³¤ì¤Ï½¾Íè¤ÈÁ´¤¯Æ±ÍͤǤ¹¡¥
35\end{description}
36
37
38\subsection{spec ¥Õ¥¡¥¤¥ë¤Ç¤Îµ­½ÒÊýË¡}
39
40Á°¤Î¥»¥¯¥·¥ç¥ó¤Ç½Ò¤Ù¤¿Ä̤ê,¥Ñ¥Ã¥±¡¼¥¸¤ò build ¤¹¤ëºÝ¤Ë¤Ï
41¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë¤ò¤·¤Ê¤¯¤Ê¤ê¤Þ¤¹¤Î¤Ç,spec ¥Õ¥¡¥¤¥ë¤â¤«¤Ê¤ê¤¹¤Ã¤­¤ê
42¤·¤¿¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹.
43
44°Ê²¼¡¤Wanderlust (¥Ñ¥Ã¥±¡¼¥¸Ì¾¤Ï¸½ºß¤Ï \BoldText{wl-el}) ¤Î
45spec ¥Õ¥¡¥¤¥ë¤ò»²¹Í¤ËÀâÌÀ¤·¤Þ¤¹¡¥
46\BoldText{\%\{origname\}} ¤È¤¤¤¦¤Î¤Ï¤³¤³¤Ç¤Ï \BoldText{wl} ¤È
47Æɤߤ«¤¨¤Æ²¼¤µ¤¤¡¥
48
49
50
51\subsubsection{\%build ¥»¥¯¥·¥ç¥ó}
52¤Þ¤º¡¤¥Ñ¥Ã¥±¡¼¥¸ºîÀ®»þ¤Î¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¤
53\BoldText{\%build} ¥»¥¯¥·¥ç¥ó¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤¹¡¥
54
55
56\subsubsection{\%install ¥»¥¯¥·¥ç¥ó}
57³¤¤¤Æ \BoldText{\%install} ¥»¥¯¥·¥ç¥ó¡¥
58¤³¤³¤Ç¤Ïñ½ã¤Ë¡¤É¬Íפʥǥ£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Æ¤¤¤ë¤À¤±¤Ç¤¹¡¥
59
60\begin{verbatim}
61
62%install
63
64[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
65[ "${RPM_BUILD_ROOT}" != "/" ] && mkdir -p ${RPM_BUILD_ROOT}
66
67mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{origname}/etc/icons
68mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/emacsen-common/packages/install
69mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/emacsen-common/packages/remove
70mkdir -p ${RPM_BUILD_ROOT}%{_infodir}
71
72\end{verbatim}
73
74¼¡¤Ë¡¤¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ëµÚ¤Ó¼ÂºÝ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ÎºÝ¤ËɬÍפʥե¡¥¤¥ë¤ò
75¥³¥Ô¡¼¤·¤Æ¤¤¤Þ¤¹¡¥
76
77\begin{verbatim}
78
79#
80# install el files
81#
82
83cp -a WL-* Makefile wl \
84        ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{origname}
85cp -a utils elmo \
86        ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{origname}
87cp etc/icons/* \
88        ${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/%{origname}/etc/icons
89
90\end{verbatim}
91
92Éí°¤Î info ¥Õ¥¡¥¤¥ë¤Ïº£¤Þ¤ÇÄ̤ê make ¤·¤Æ³ºÅö¾ì½ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤À¤±¤Ç¤¹¡¥
93
94\begin{verbatim}
95
96#
97#  build & install info
98#
99
100make EMACS=emacs info
101make EMACS=emacs INFODIR=${RPM_BUILD_ROOT}%{_infodir} install-info
102
103\end{verbatim}
104
105ºÇ¸å¤Ë¡¤elisp ¤ò¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë/¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤ê¡¤ºï½ü¤·¤¿¤ê¤¹¤ë
106¥¹¥¯¥ê¥×¥È¤ò³ºÅö¾ì½ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡¥¤³¤³¤Ç½Ð¤Æ¤¯¤ë¥Þ¥¯¥í¤ò
107ͽ¤áÄêµÁ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹ (VineSeed ºÇ¿·¤Î rpm ¤Ç¤Ï´û¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹)¡¥
108¤³¤Î¥Þ¥¯¥í¤Ï¡¤¥Ñ¥Ã¥±¡¼¥¸ºîÀ®»þ¤ËŸ³«¤µ¤ì¤Þ¤¹¡¥
109
110\begin{verbatim}
111
112#
113# install  script( bytecompile el and install elc , remove )   
114#
115
116%_installemacsenscript %{origname} %{SOURCE1}
117
118%_removeemacsenscript  %{origname} %{SOURCE2}
119
120\end{verbatim}
121
122
123
124\subsubsection{\%post ¥»¥¯¥·¥ç¥ó}
125
126¼¡¤Ë¡¤¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤¬¼ÂºÝ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿ºÝ¤Ë¼Â¹Ô¤µ¤ì¤ë¥¹¥¯¥ê¥×¥È¤Ç
127¤¢¤ë \BoldText{\%post} ¥»¥¯¥·¥ç¥ó¤ò¤ß¤Æ¤¤¤­¤Þ¤¹¡¥
128¤³¤³¤Ç¤âͽ¤áÄêµÁ¤µ¤ì¤¿ rpm ¥Þ¥¯¥í¤¬Â¿Ê¬¤Ë»È¤ï¤ì¤Æ¤¤¤Þ¤¹¤Î¤ÇÃí°Õ¤·¤Æ²¼¤µ¤¤¡¥
129
130¤Þ¤ººÇ½é¤Ë¡¤\BoldText{\$1 = 2} ¤Î¾ì¹ç¡¤Â¨¤Á¥Ñ¥Ã¥±¡¼¥¸¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É¤Î
131¾ì¹ç¡¤´û¤Ë¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë \BoldText{.elc}
132Åù¤òºï½ü¤¹¤ë°Ù¤Î¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡¥
133
134
135\begin{verbatim}
136
137%post
138
139#
140# bytecompile and install
141#
142
143if [ "$1" = 2 ]; then
144
145%_emacsenPackageRemove %{origname}
146
147fi
148
149\end{verbatim}
150
151³¤¤¤Æ¡¤¤³¤Î elisp ¥Ñ¥Ã¥±¡¼¥¸¤ò emacsen-common ¤ËÅÐÏ¿¤·¤Þ¤¹¡¥
152\\
153¨¤Á¡¤\BoldText{/var/lib/emacsen-common/installed-elisp} ¤Ë \BoldText{wl} ¤¬
154½ñ¤­¹þ¤Þ¤ì¤Þ¤¹¡¥
155
156\begin{verbatim}
157
158%_addemacsenlist %{origname}
159
160\end{verbatim}
161
162¤½¤·¤Æ¡¤¸½ºß¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë emacsen ¤Î flavor ¤½¤ì¤¾¤ì¤Ë¤Ä¤¤¤Æ¡¤
163¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë¤È¥¤¥ó¥¹¥È¡¼¥ë¤ò¹Ô¤¦¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡¥
164
165\begin{verbatim}
166
167%_emacsenPackageInstall %{origname}
168
169\end{verbatim}
170
171ºÇ¸å¤Ë¡¤º£¤Þ¤Ç¤ÈƱÍͤˡ¤Éí°¤Î info ¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡¥
172
173\begin{verbatim}
174
175/sbin/install-info %{_infodir}/wl-ja.info.gz %{_infodir}/dir \
176        --section="Message User Agent"
177/sbin/install-info %{_infodir}/wl.info.gz %{_infodir}/dir \
178        --section="Message User Agent"
179
180\end{verbatim}
181
182
183
184\subsubsection{\%preun ¥»¥¯¥·¥ç¥ó}
185
186º£Å٤ϵդ˥ѥ屡¼¥¸¤¬¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ëºÝ¤Ë¼Â¹Ô¤µ¤ì¤ë
187\BoldText{\%preun} ¥»¥¯¥·¥ç¥ó¤Ç¤¹¡¥
188
189¥¢¥Ã¥×¥°¥ì¡¼¥É¤Ë¤è¤ë¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤Î¾ì¹ç¤Ë¤Ï
190²¿¤â¤·¤Ê¤¤ÍÍ¡¤ËÜÅö¤Ë¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤ÎºÝ¤À¤±¤Ë¼Â¹Ô¤µ¤ì¤ëÍͤË
191 \BoldText{\$1 = 0} ¤ÇȽÄꤷ¤Æ¤¤¤Þ¤¹¡¥
192
193¤½¤Î¸å¡¤¼ÂºÝ¤Ë¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë¤È¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿ \BoldText{.elc}
194¥Õ¥¡¥¤¥ëÅù¤òºï½ü¤· (\BoldText{\%\_emacsenPackageRemove})¡¤
195³¤¤¤Æ \BoldText{/var/lib/emacsen-common/installed-packages} ¤«¤é
196wl ¤òÈ´¤­ (\BoldText{\%\_removeemacsenscript})¡¤
197ºÇ¸å¤Ë info ¥Õ¥¡¥¤¥ë¤ò¥¢¥ó¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤Þ¤¹¡¥
198
199\begin{verbatim}
200
201if [ "$1" = 0 ]; then
202
203%_emacsenPackageRemove %{origname}
204
205%_removeemacsenlist %{origname}
206
207/sbin/install-info --delete %{_infodir}/wl-ja.info.gz %{_infodir}/dir \
208        --section="Message User Agent"
209/sbin/install-info --delete %{_infodir}/wl.info.gz %{_infodir}/dir \
210        --section="Message User Agent"
211fi
212
213\end{verbatim}
214
215
216
217\subsection{¤³¤³¤Þ¤Ç¤Î¤Þ¤È¤á}
218
219¼ÂºÝ¤Ë¤³¤ÎÍͤ˺î¤é¤ì¤¿ elisp ¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ºÝ¤Î
220µóÆ°¤Ë¤Ä¤¤¤ÆÎã¤ò»È¤Ã¤ÆÀâÌÀ¤·¤Þ¤¹¡¥
221´û¤Ë emacs-20.7 ¤È xemacs-21.1.14 ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë´Ä¶­¤Ç
222wl-el ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¾ì¹ç¤Ë¤É¤Î¤è¤¦¤Êή¤ì¤Ë¤Ê¤ë¤«ÄɤäƤ¤¤­¤Þ¤·¤ç¤¦¡¥
223
224\begin{itemize}
225 \item wl-el ¥Ñ¥Ã¥±¡¼¥¸¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë
226 \item wl-el ¥Ñ¥Ã¥±¡¼¥¸¤¬¥¢¥Ã¥×¥°¥ì¡¼¥É¤Ç¤¢¤ë¾ì¹ç¡¤
227       \BoldText{\%\_emacsenPackageRemove wl} ¤¬¼Â¹Ô¤µ¤ì¡¤
228       ´û¤Ë¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë/¥Ç¥£¥ì¥¯¥È¥ê¤¬ºï½ü¤µ¤ì¤ë¡¥
229\\
230       ¤³¤ÎÎã¤Ç¤Ï
231       \begin{itemize}
232        \item \BoldText{/usr/share/emacs-20.7/site-lisp/wl}
233        \item \BoldText{/usr/share/xemacs-21.1.14/\{etc,lisp\}/wl}
234       \end{itemize}
235       ¤¬ºï½ü¤µ¤ì¤ë¡¥
236 \item \BoldText{\%\_addemacsenlist wl} ¤¬¼Â¹Ô¤µ¤ì¡¤
237       \BoldText{/var/lib/emacsen-common/installed-elisp} ¤Ë
238       wl ¤È¤¤¤¦¥¨¥ó¥È¥ê¤¬Äɲ䵤ì¤ë
239 \item \BoldText{\%\_emacsenPackageInstall wl} ¤¬¼Â¹Ô¤µ¤ì¡¤
240       ¸½ºß¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë emacsen ¤½¤ì¤¾¤ì¤ËÂФ·¤Æ
241       ¥Ð¥¤¥È¥³¥ó¥Ñ¥¤¥ë¤È¥¤¥ó¥¹¥È¡¼¥ë¤¬¹Ô¤ï¤ì¤ë¡¥
242\\
243       ¤³¤ÎÎã¤Ç¤Ï
244       \begin{itemize}
245        \item \BoldText{/usr/share/emacs-20.7/site-lisp/wl}
246        \item \BoldText{/usr/share/xemacs-21.1.14/\{etc,lisp\}/wl}
247       \end{itemize}
248       ¤Ë¤½¤ì¤¾¤ì¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¡¥
249\end{itemize}
250
251
252
253\subsection{install,remove ¥¹¥¯¥ê¥×¥È¤Î½ñ¤­Êý}
254
255ÀèÄø¤«¤é²¿ÅÙ¤«½Ð¤Æ¤­¤¿¥Þ¥¯¥í \BoldText{\%\_emacsenPackageInstall wl} ¤È
256\BoldText{\%\_emacsenPackageRemove wl} ¤Ï¡¤¼ÂºÝ¤Ë¤Ï¤½¤ì¤¾¤ì
257\BoldText{/usr/lib/emacsen-common/\{install,remove\}/wl} ¤ò
258¼Â¹Ô¤·¤Æ¤¤¤Þ¤¹¡¥
259
260¤³¤Î¥¹¥¯¥ê¥×¥È¤Ï³Æ elisp ¥Ñ¥Ã¥±¡¼¥¸¤ËÉí°¤µ¤»¤Æ¤ª¤¯¤â¤Î¤Ê¤Î¤Ç¡¤
261¥¹¥¯¥ê¥×¥È¤âÍÑ°Õ¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡¥
262
263¹¬¤¤¡¤´û¤Ë VineSeed ¤ä VineSeedPlus ¤Ë¤Ï emacsen-common Âбþ¤Ë¤µ¤ì¤¿
264elisp ¥Ñ¥Ã¥±¡¼¥¸¤¬¤¤¤¯¤Ä¤â¸ºß¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¤¼ÂºÝ¤Ë¤Ï¤½¤Á¤é¤ò¸«¤Æ¤â¤é¤¨¤Ð
265¤ª¤ª¤è¤½¤É¤¦¤¤¤Ã¤¿¤³¤È¤ò¹Ô¤Ã¤Æ¤¤¤ë¤«Ê¬¤«¤ë¤«¤È»×¤¤¤Þ¤¹¡¥
266
267¤³¤ì¤é¤Î¥¹¥¯¥ê¥×¥È¤Î°ú¿ô¤Ë¤Ï emacsen ¤Î flavor ¤¬ÅϤµ¤ì¤Þ¤¹¤Î¤Ç¡¤
268¤É¤Î flavor ¤Î¾ì¹ç¤Ï¤É¤ÎÍͤ˥Х¤¥È¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤É¤³¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤«¡¤
269¤ò¤³¤Î¥¹¥¯¥ê¥×¥È¤Ëµ­½Ò¤·¤Æ¤ª¤¯¤ï¤±¤Ç¤¹¡¥
270
271¤Ä¤Þ¤ê¡¤ÀèÄø¤Î wl ¤ÎÎã¤Ç¤Ï¡¤
272\BoldText{\%\_emacsenPackageInstall wl}
273¤È¤¤¤¦¹Ô¤Ç¡¤
274
275\begin{itemize}
276 \item \BoldText{/usr/lib/emacsen-common/packages/install/wl emacs-20.7}
277 \item \BoldText{/usr/lib/emacsen-common/packages/install/wl xemacs-21.1.14}
278\end{itemize}
279
280¤È¤¤¤¦ 2¤Ä¤Î¥¹¥¯¥ê¥×¥È¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥
281
282
283\subsubsection{install ¥¹¥¯¥ê¥×¥È}
284
285(¸½ºß½ñ¤¤¤Æ¤ëÅÓÃæ)
286
287
288\subsubsection{remove ¥¹¥¯¥ê¥×¥È}
289
290(¸½ºß½ñ¤¤¤Æ¤ëÅÓÃæ)
Note: See TracBrowser for help on using the repository browser.