efax-vl.spec 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. Summary: A program for faxing using a Class 1, 2 or 2.0 fax modem.
  2. Name: efax
  3. %define ver 0.9a
  4. %define rel 001114
  5. %define minor b0
  6. Version: %{ver}%{rel}%{minor}
  7. Release: 1%{?_dist_release}
  8. License: GPL
  9. Group: Applications/Communications
  10. Source: http://www.cce.com/efax/download/%{name}-%{ver}-%{rel}.tar.gz
  11. #Source: http://shino.pos.to/linux/%{name}-%{ver}%{rel}%{minor}.tar.gz
  12. Source1: http://shino.pos.to/linux/efax/efax.rc.sample
  13. Source2: http://shino.pos.to/linux/efax/efax.rc.sample.ja
  14. Source3: http://shino.pos.to/linux/efax/printcap.sample
  15. Source4: http://shino.pos.to/linux/fax.html
  16. Source5: http://shino.pos.to/linux/efax.html
  17. Source6: http://shino.pos.to/linux/efax/fax-%{minor}
  18. Source7: http://shino.pos.to/linux/efax/ppxpadduser
  19. Patch1: http://shino.pos.to/linux/efax/efax-0.9-numlines.patch
  20. Patch2: http://shino.pos.to/linux/efax/efax08a-time.patch
  21. Patch5: http://shino.pos.to/linux/efax/efax-0.9-nullptr.patch
  22. Patch6: http://shino.pos.to/linux/efax/efax-0.9a-frlen.patch
  23. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  24. Vendor: Project Vine
  25. Distribution: Vine Linux
  26. #Prefix: /usr
  27. %define lockdir /var/lock
  28. %define faxdir /var/spool/fax
  29. %define incomingdir /var/spool/fax/incoming
  30. %define outgoingdir /var/spool/fax/outgoing
  31. %define logdir /var/log/fax
  32. %define printcap /etc/printcap
  33. %define printcap2 /etc/printcap.local
  34. %define modemuser uucp
  35. %define lpuser lp
  36. %define efaxconf /etc/efax.rc
  37. %{!?_initrddir:%define _initrddir /etc/rc.d/init.d}
  38. Url: http://www.cce.com/efax
  39. %description
  40. Efax is a small ANSI C/POSIX program that sends and receives faxes using
  41. any Class 1, 2 or 2.0 fax modem.
  42. This package include pathces bugfixing fax start/stop commands and
  43. tools for fax spooling.
  44. You need to install efax if you want to send faxes and you have a
  45. Class 1, 2 or 2.0 fax modem.
  46. %description -l ja
  47. efax はクラス1, 2 または2.0 fax モデムを使用して fax を送受信するための小さな
  48. ANSI C/POSIX なプログラムです。
  49. このパッケージにはfax start/stop コマンドのバグフィックスと
  50. スプーリングに便利なパッチと設定が含まれています。
  51. クラス1, 2 または 2.0 fax モデムを使用して fax を送信する場合は efax を
  52. インストールする必要があります。
  53. %prep
  54. %setup -q -n %{name}-%{ver}-%{rel}
  55. %patch1 -p1 -b .numlines
  56. %patch2 -p1 -b .time
  57. %patch5 -p1 -b .nullptr
  58. %patch6 -p0 -b .frlen
  59. %__cp %{SOURCE1} ./
  60. %__cp %{SOURCE2} ./
  61. %__cp %{SOURCE3} ./
  62. %__cp %{SOURCE4} ./
  63. %__cp %{SOURCE5} ./
  64. %__mv fax fax.org
  65. %__cp %{SOURCE6} ./fax
  66. %__cp %{SOURCE7} ./
  67. %build
  68. make RPM_OPT_FLAGS="-ansi $RPM_OPT_FLAGS"
  69. %install
  70. %__rm -rf $RPM_BUILD_ROOT
  71. %__install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
  72. %__install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1
  73. %__install -d -m 775 $RPM_BUILD_ROOT%{faxdir}
  74. %__install -d -m 777 $RPM_BUILD_ROOT%{logdir}
  75. %__install -d -m 775 $RPM_BUILD_ROOT%{incomingdir}
  76. %__install -d -m 770 $RPM_BUILD_ROOT%{outgoingdir}
  77. touch $RPM_BUILD_ROOT%{outgoingdir}/lock
  78. chmod 644 $RPM_BUILD_ROOT%{outgoingdir}/lock
  79. %__install -d -m 755 $RPM_BUILD_ROOT/etc
  80. %__cp efax.rc.sample $RPM_BUILD_ROOT/etc/efax.rc
  81. #%#makeinstall
  82. make BINDIR=$RPM_BUILD_ROOT%{_bindir} MANDIR=$RPM_BUILD_ROOT%{_mandir} install
  83. cd $RPM_BUILD_ROOT%{_bindir}
  84. ln -s fax faxlpr
  85. %clean
  86. %__rm -rf $RPM_BUILD_ROOT
  87. #rm -rf $RPM_BUILD_DIR/%{name}-%{version}-%{rel}
  88. %pre
  89. (id %{lpuser} > /dev/null 2>&1 ) || adduser -d /var/%{lpuser} -c %{lpuser} %{lpuser}
  90. :
  91. %post
  92. [ -d %{lockdir} ] || mkdir -p %{lockdir}
  93. chmod 777 %{lockdir}
  94. if [ -w /etc/inittab ] ; then
  95. grep -q "/bin/fax answer" /etc/inittab || \
  96. echo -e "# Uncomment next line to enable efax auto answer\n#s1:345:respawn:/bin/sh /usr/bin/fax answer" \
  97. >> /etc/inittab
  98. fi
  99. #HEADER="##PRINTTOOL3## LOCAL"
  100. PRINTCAP=%{printcap}
  101. [ -w %{printcap2} ] && PRINTCAP=%{printcap2}
  102. if [ -w "$PRINTCAP" ] && ! grep -q "^fax:" $PRINTCAP ; then
  103. tail -n 7 %{_docdir}/%{name}-%{version}/printcap.sample >> $PRINTCAP
  104. #cat >> $PRINTCAP << EOF
  105. #$HEADER
  106. #fax:\
  107. # :sd=/var/spool/fax/outgoing:\
  108. # :mx#0:\
  109. # :sh:\
  110. # :lp=/dev/null:\
  111. # :if=/usr/bin/faxlpr:
  112. #EOF
  113. # restart lpd
  114. if (ps ax | grep -v grep | grep -q lpd) ; then
  115. [ -x %{_initrddir}/lpd ] && %{_initrddir}/lpd restart
  116. fi
  117. fi
  118. :
  119. %postun
  120. if [ $1 -eq 0 ] ; then
  121. # Delete fax entry from printcap
  122. PRINTCAP=%{printcap}
  123. [ -w %{printcap2} ] && PRINTCAP=%{printcap2}
  124. FILE=$PRINTCAP
  125. BEGIN=$(cat -n $FILE | grep 'fax:' | sed -e 's/^[ ]*//' -e 's/[^0-9].*//')
  126. END=$(cat -n $FILE | grep ':if=/usr/bin/faxlpr:' | sed -e 's/^[ ]*//' -e 's/[^0-9].*//')
  127. LINES=$(wc -l $FILE | sed -e 's/^[ ]*//' -e 's/[^0-9].*//')
  128. if [ -n "$BEGIN" -a -n "$END" -a -n "$LINES" ];then
  129. HEAD=$(expr $BEGIN - 2)
  130. TAIL=$(expr $LINES - $END)
  131. if [ $HEAD -ge 0 ];then
  132. rm -f $FILE.new
  133. (head -n $HEAD $FILE; tail -n $TAIL $FILE) > $FILE.new && \
  134. (mv -f $FILE $FILE.bak; mv $FILE.new $FILE)
  135. # restart lpd
  136. if (ps ax | grep -v grep | grep -q lpd) ; then
  137. [ -x %{_initrddir}/lpd ] && %{_initrddir}/lpd restart
  138. fi
  139. fi
  140. fi
  141. fi
  142. :
  143. %files
  144. %defattr(-,root,root)
  145. %doc README COPYING *.sample* *.html ppxpadduser
  146. %config %{_bindir}/fax
  147. %config(missingok, noreplace) %{efaxconf}
  148. %{_bindir}/efax
  149. %{_bindir}/efix
  150. %{_bindir}/faxlpr
  151. %{_mandir}/man1/fax.1*
  152. %{_mandir}/man1/efax.1*
  153. %{_mandir}/man1/efix.1*
  154. %attr(-,root,%{modemuser}) %dir %{faxdir}
  155. %attr(-,root,%{modemuser}) %{logdir}
  156. %attr(-,root,%{modemuser}) %{incomingdir}
  157. %attr(-,%{lpuser},%{lpuser}) %{outgoingdir}
  158. %changelog
  159. * Mon Sep 22 2008 Shu KONNO <owa@bg.wakwak.com> 0.9a001114b0-1vl5
  160. - applied new versioning policy, spec in utf-8
  161. * Sun Jul 30 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 0.9a001114b0-0vl2
  162. - rebuilt for VineSeed
  163. - s/Copyright/License/
  164. * Mon Feb 28 2005 Masaki SHINOMIYA <shino@pos.to> 0.9a001114b0-0vl1
  165. - use fax-b0, bugfix in handling '-m' option
  166. - bugfix in function faxmail by Marc Ferraton <mferrato@ogm-techno.org>
  167. - frlen.patch, REMID in fax both informed by Steven Doerfler <steven@lugaru.com>
  168. - post and postun scripts, (_initrddir)
  169. - accept '_054' as ','(comma)
  170. - noreplace efax.rc
  171. - build on Vine Linux 3.1
  172. * Sun Mar 31 2002 Jun Nishii <jun@vinelinux.org> 0.9a001114a7-0vl2
  173. - rebuild for Vine Linux 2.5
  174. * Wed Jan 30 2002 Masaki SHINOMIYA <shino@pos.to> 0.9a001114a7-0vl1 for Vine 2.1
  175. * Wed Jan 30 2002 Masaki SHINOMIYA <shino@pos.to> 0.9a001114a7-1
  176. - avoid 'bad units' error in some european locale
  177. * Sun Jan 6 2002 Masaki SHINOMIYA <shino@pos.to> 0.9a001114a6-0vl1 for Vine 2.1
  178. * Sun Jan 6 2002 Masaki SHINOMIYA <shino@pos.to> 0.9a001114a6-1
  179. - accept escape sequence, '_043'as'#', '_052'as'*'
  180. - change the release number
  181. - use macros
  182. * Sat Dec 15 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a001114-0a5
  183. - spec for rpm -tb
  184. - faxlpr to work with LPRng
  185. - patches taken from RHL efax-0.9-9
  186. * Sun Oct 7 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a001114-0a4
  187. - do not specify any distributions
  188. * Sun Oct 7 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a001114-0vl4
  189. - efax-spooling.patch introducing INCOMING and OUTGOING
  190. - symlink of faxlpr and efax.rc.sampl to use spooling
  191. - postscript including chmod some directories to 777 to enable pooling
  192. - CLASSINIT in efax.rc.sample
  193. - descriptions
  194. - html documents written by me
  195. * Mon Aug 20 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a001114-0vl3
  196. - efax-answer.patch to fix some problems in auto answering function
  197. - efax.rc to be a config
  198. * Sat Jun 20 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a001114-0vl2
  199. - fixed bugs in postscript
  200. - efax.rc.sample to be installed in /usr/doc directory
  201. * Sat Jun 16 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a001114-0vl1
  202. - rename for VinePlus package
  203. * Wed Jun 13 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a-001114c
  204. - create /etc/efax.rc if not exists
  205. - /dev/modem is now default
  206. * Wed Jun 6 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a-001114b
  207. - add log directory /var/log/fax
  208. * Tue May 29 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a-001114a
  209. - post-install-script, efax.rc.sample
  210. * Thu May 23 2001 Masaki SHINOMIYA <shino@pos.to> 0.9a-001114
  211. * Fri Oct 13 2000 MACHINO, Satoshi <machino@vinelinux.org> 0.9-1vl2
  212. - fixed in %files for brp-redhat scripts
  213. * Tue Jun 29 1999 Cristian Gafton <gafton@redhat.com>
  214. - updated to 0.9 (#3808)
  215. * Sun Mar 21 1999 Cristian Gafton <gafton@redhat.com>
  216. - auto rebuild in the new build environment (release 11)
  217. * Wed Feb 24 1999 Preston Brown <pbrown@redhat.com>
  218. - Injected new description and group.
  219. * Tue Feb 02 1999 Preston Brown <pbrown@redhat.com>
  220. - patch to fix null ptr dereference
  221. - added -ansi flag; fixes efix problem (produced bad tiff files)
  222. * Fri Dec 18 1998 Preston Brown <pbrown@redhat.com>
  223. - bumped spec number for initial rh 6.0 build
  224. * Tue Aug 11 1998 Jeff Johnson <jbj@redhat.com>
  225. - build root
  226. * Mon Apr 27 1998 Prospector System <bugs@redhat.com>
  227. - translations modified for de, fr, tr
  228. * Wed Oct 22 1997 Michael Fulbright <msf@redhat.com>
  229. - cleaned spec file to new standard, confirmed package is up to date
  230. * Tue Mar 25 1997 Erik Troan <ewt@redhat.com>
  231. - Added efax-08a-64bit.patch from David Mosberger