ndtpd-vl.spec 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. Summary: Server for accessing CD-ROM books with NDTP
  2. Summary(ja): NDTP を用いた CD-ROM 書籍をアクセスするためのサーバ
  3. Name: ndtpd
  4. Version: 3.1.5
  5. Release: 4%{?_dist_release}
  6. License: GPLv2
  7. Group: System Environment/Daemons
  8. Source: ftp://ftp.sra.co.jp/pub/net/ndtp/ndtpd/%{name}-%{version}.tar.gz
  9. Source1: ndtpd
  10. URL: http://www.sra.co.jp/people/m-kasahr/ndtpd/
  11. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  12. Requires: eb >= 3.3, zlib
  13. BuildRequires: eb-devel
  14. BuildRequires: zlib-devel
  15. Requires(post): grep /sbin/install-info
  16. Requires(preun): grep /sbin/install-info /sbin/chkconfig
  17. Distribution: Vine Linux
  18. Vendor: Project Vine
  19. %define ndtpdconfdir %{_sysconfdir}/ndtpd
  20. %description
  21. NDTPD is a server for accessing CD-ROM books with NDTP (Network
  22. Dictionary Transfer Protocol) on TCP. You can replace dserver with
  23. NDTPD. NDTPD can run on UNIX derived systems. It supports to access
  24. CD-ROM books of EB, EBG, EBXA, EBXA-C, S-EBXA and EPWING formats.
  25. CD-ROM books of those formats are popular in Japan. Since CD-ROM
  26. books themseves are stands on the ISO 9660 format, you can mount the
  27. discs by the same way as other ISO 9660 discs.
  28. %description -l ja
  29. NDTPD は TCP 上の NDTP (Network Disctionary Transfer Protocol) という
  30. プロトコルを用いて、CD-ROM 書籍へのアクセスを行うサーバです。
  31. dserver は NDTPD に置き換えることが可能です。
  32. NDTPD は UNIX 系 OS のシステム上で動作させることができます。EB, EBG,
  33. EBXA, EBXA-C, S-EBXA および EPWING 形式の CD-ROM 書籍に対応しています。
  34. これらの形式の CD-ROM 書籍は、日本で一般的に使われています。CD-ROM 書籍
  35. 自体はISO 9660 形式になっていますので、他の ISO 9660 形式と同じ要領で
  36. マウントすることができます。
  37. %prep
  38. %setup -q
  39. %build
  40. ./configure --prefix=%{_prefix} \
  41. --sysconfdir=%{ndtpdconfdir} \
  42. --localstatedir=%{_localstatedir} \
  43. --infodir=%{_infodir} \
  44. --with-eb-conf=%{_sysconfdir}/eb.conf \
  45. --with-zlib
  46. make all check info #dvi
  47. %install
  48. rm -rf %{buildroot}
  49. make DESTDIR=%{buildroot} install
  50. mkdir -p %{buildroot}%{_localstatedir}/ndtpd/log
  51. install -m 755 -D %{SOURCE1} %{buildroot}%{_initdir}/ndtpd
  52. rm -f %{buildroot}%{_infodir}/dir
  53. cd %{buildroot}%{ndtpdconfdir}
  54. cat ndtpd.conf.sample | sed -e 's|/usr/var|%{_localstatedir}|g' > ndtpd~
  55. [ -s ndtpd~ ] && (rm -f ndtpd.conf.sample; mv ndtpd~ ndtpd.conf.sample)
  56. %clean
  57. rm -rf %{buildroot}
  58. %pre
  59. if [ `grep ndtpgrp %{_sysconfdir}/group | wc -l` = 0 ]; then
  60. %{_sbindir}/groupadd ndtpgrp
  61. fi
  62. if [ `grep ndtpuser %{_sysconfdir}/passwd | wc -l` = 0 ]; then
  63. %{_sbindir}/useradd -M -r -g ndtpgrp -d %{_localstatedir}/ndtpd \
  64. -s "" -c "ndtpd" ndtpuser || :
  65. fi
  66. %post
  67. if [ -x /sbin/install-info ]; then
  68. for i in $(ls %{_infodir}/ndtpd*); do
  69. /sbin/install-info --info-dir=%{_infodir} $i
  70. done
  71. fi
  72. if [ -x /bin/grep -a -f /etc/services ] ; then
  73. grep -q "^ndtp" /etc/services || \
  74. echo "ndtp 2010/tcp # added by ndtpd RPM" >> /etc/services
  75. fi
  76. if [ -x /bin/grep -a -f /etc/syslog.conf ] ; then
  77. grep -q "ndtpd" /etc/syslog.conf || \
  78. echo "local0.info %{_localstatedir}/ndtpd/log/ndtpd.log" >> /etc/syslog.conf
  79. fi
  80. kill -HUP `/sbin/pidof syslogd`
  81. if [ -x /bin/grep -a -f /etc/inetd.conf ] ; then
  82. grep -q "ndtp" /etc/inetd.conf || \
  83. echo "#ndtp stream tcp nowait root /usr/sbin/ndtpd ndtpd --inetd" >> /etc/inetd.conf
  84. fi
  85. #kill -HUP `/sbin/pidof inetd`
  86. if [ -x /bin/grep -a -f /etc/hosts.allow ] ; then
  87. grep -q "ndtp" /etc/hosts.allow || \
  88. echo "ndtp: 127.0.0.1 : allow" >> /etc/hosts.allow
  89. fi
  90. #[ -x /sbin/chkconfig -a -x %{_initdir}/ndtpd ] && \
  91. #/sbin/chkconfig --add ndtpd
  92. if [ -f %{_localstatedir}/ndtpd/ndtpd.pid -a -x %{_initdir}/ndtpd ]; then
  93. %{_initdir}/ndtpd restart
  94. fi
  95. %preun
  96. if [ $1 = 0 ]; then
  97. if [ -x /sbin/install-info ]; then
  98. for i in $(ls %{_infodir}/ndtpd*); do
  99. /sbin/install-info --delete --info-dir=%{_infodir} $i
  100. done
  101. fi
  102. [ -x /sbin/chkconfig -a -x %{_initdir}/ndtpd ] && \
  103. /sbin/chkconfig --del ndtpd
  104. ls %{_localstatedir}/ndtpd/log/* &> /dev/null && \
  105. rm -f %{_localstatedir}/ndtpd/log/*
  106. if [ -x /bin/grep -a -f /etc/syslog.conf ] ; then
  107. if grep -q "ndtpd" /etc/syslog.conf ; then
  108. grep -v "ndtpd" /etc/syslog.conf > /etc/syslog.new && \
  109. mv -f /etc/syslog.new /etc/syslog.conf
  110. kill -HUP `/sbin/pidof syslogd`
  111. fi
  112. fi
  113. if [ -x /bin/grep -a -f /etc/inetd.conf ] ; then
  114. if grep -q "^ndtp" /etc/inetd.conf ; then
  115. grep -v "ndtp" /etc/inetd.conf > /etc/inetd.new && \
  116. mv -f /etc/inetd.new /etc/inetd.conf
  117. kill -HUP `/sbin/pidof inetd`
  118. fi
  119. fi
  120. if [ -x /bin/grep -a -f /etc/hosts.allow ] ; then
  121. if grep -q "ndtp" /etc/hosts.allow ; then
  122. grep -v "ndtp" /etc/hosts.allow > /etc/hosts.allow.new && \
  123. mv -f /etc/hosts.allow.new /etc/hosts.allow
  124. fi
  125. fi
  126. if [ -f %{_localstatedir}/ndtpd/ndtpd.pid -a -x %{_initdir}/ndtpd ]; then
  127. %{_initdir}/ndtpd stop
  128. fi
  129. rm -f %{_localstatedir}/ndtpd/*.lock
  130. fi
  131. :
  132. %postun
  133. if [ $1 = 0 ]; then
  134. if [ `grep ndtpuser %{_sysconfdir}/passwd | wc -l` = 1 ]; then
  135. %{_sbindir}/userdel ndtpuser
  136. fi
  137. if [ `grep ndtpgrp %{_sysconfdir}/group | wc -l` = 1 ]; then
  138. %{_sbindir}/groupdel ndtpgrp
  139. fi
  140. fi
  141. %files
  142. %defattr(-,root,root)
  143. %config %{ndtpdconfdir}/ndtpd.conf.sample
  144. %{_infodir}/ndtpd-ja.info*
  145. %{_infodir}/ndtpd.info*
  146. %{_libexecdir}/ndtpstat
  147. %{_sbindir}/ndtpcheck
  148. %{_sbindir}/ndtpcontrol
  149. %{_sbindir}/ndtpd
  150. %{_sbindir}/ndtpdaily
  151. %{_sbindir}/ndtpupgrade
  152. %{_initdir}/ndtpd
  153. %attr(-,ndtpuser,ndtpgrp) %{_localstatedir}/ndtpd
  154. %doc AUTHORS COPYING ChangeLog* INSTALL INSTALL-ja NEWS README README-ja UPGRADE UPGRADE-ja
  155. %changelog
  156. * Sun Jan 2 2011 IWAI, Masaharu <iwai@alib.jp> 3.1.5-4
  157. - build with eb 4.4.3
  158. * Wed Jul 22 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.1.5-3
  159. - rebuilt with eb-4.4.1
  160. * Fri Oct 10 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 3.1.5-2vl5
  161. - fixed release
  162. * Wed Oct 08 2008 Shu KONNO <owa@bg.wakwak.com> 3.1.5-1vl5
  163. - applied new versioning policy, spec in utf-8
  164. * Thu Dec 13 2007 IWAI, Masaharu <iwai@alib.jp> 3.1.5-0vl2
  165. - rebuild with eb-4.3
  166. * Sun Oct 3 2004 Kunio Murasawa <murasawa@fa2.so-net.ne.jp> 3.1.5-0vl1
  167. - new upstream release
  168. - changed Copyright to License
  169. - removed define _sysconfdir, _initdir, _localstatdir
  170. - fixed Requires: eb >= 3.3
  171. - fixed Group: System Environment/Daemons
  172. - added configure --infodir
  173. - removed rm info-[1-2]* in install section
  174. * Tue Sep 24 2002 Masaki Shinomiya <shino@pos.to> 3.1.3-0vl3
  175. - merge Vine-2.5 Plus's Spec file by Kyoichiro Suda <sudakyo@fat.coara.or.jp>
  176. - services, inetd.conf, syslog.conf, ndtpd.conf.sample, post, preun
  177. * Sat Jul 6 2002 IWAI Masaharu <iwai@alib.jp> 3.1.3-0vl2
  178. - update to 3.1.3 for VineSeed Plus
  179. - merged 3.1.3-0vl1 for Vine-2.5 Plus's Spec file
  180. - added startup script %%{SOURCE1}
  181. - fixed Distribution and Vendor tags
  182. - 3.1.3-0vl1 Changelog
  183. * Tue Jun 11 2002 Satoshi Tanaka <tnim@mint.freemail.ne.jp>
  184. - Update version 3.1.3 for the Vine Linux 2.x
  185. * Tue Mar 12 2002 Satoshi Tanaka <tnim@mint.freemail.ne.jp>
  186. - Update version 3.1.1 for the Vine Linux 2.1.5
  187. * Thu Nov 15 2001 Tomoya TAKA <taka@vinelinux.org> 3.0.2-0vl1
  188. - update to 3.0.2
  189. - add Requires: eb, zlib and BuildPrereq: zlib-devel
  190. - fix spec files, use rpm macros
  191. * Fri Jul 6 2001 UECHI Yasumasa <uh@u.dhis.portside.net>
  192. -3.0.1-0vl1
  193. - version up to 3.0.1
  194. - add user ndtpuser, group ndtpgrp
  195. * Sat Jun 23 2001 Tomoya TAKA <tomoya@olive.plala.or.jp>
  196. - 3.0-0vl2
  197. - add PreReq: /sbin/install-info, handle info pages in %%post and %%preun
  198. * Fri Jun 22 2001 UECHI Yasumasa <uh@u.dhis.portside.net>
  199. - 3.0-0vl1
  200. - version up to 3.0
  201. - remove EB library from this pkg
  202. * Wed Jun 14 2000 Masaki Kawamura <kawamura@ic.sci.yamaguchi-u.ac.jp>
  203. - add Provides: eb == 2.3.7, eb-devel == 2.3.7
  204. * Wed Apr 26 2000 Masaki Kawamura <kawamura@ic.sci.yamaguchi-u.ac.jp>
  205. - Update version 2.3.7 for the Vine Linux 2.0
  206. * Wed Dec 9 1998 ZUKERAN, shin <shin@ryukyu.ad.jp>
  207. - fix -version-info parameter with pje.patch.
  208. - fix ndtpd.init