ndtpd-vl.spec 8.5 KB

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