ircd.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. ##
  2. ## ircd.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: ircd
  27. Summary: IRCnet Internet Relay Chat (IRC) Server
  28. URL: http://www.irc.org/~irc/server/
  29. Vendor: Jarkko Oikarinen
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [BASE]
  32. Group: Network
  33. License: BSD
  34. Version: 2.10.3p4
  35. Release: 20031012
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: ftp://ftp.irc.org/irc/server/irc%{version}.tgz
  40. Source1: rc.ircd
  41. Source2: ircd.conf
  42. Source3: fsl.ircd
  43. Patch0: ircd.patch
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20030718
  48. PreReq: OpenPKG, openpkg >= 20030718
  49. BuildPreReq: zlib
  50. PreReq: zlib
  51. %if "%{with_fsl}" == "yes"
  52. BuildPreReq: fsl >= 1.2.0
  53. PreReq: fsl >= 1.2.0
  54. %endif
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. This is the classical IRCnet daemon. It is the server program for
  59. the Internet Relay Chat (IRC) service. Its function is to serve
  60. the client program with messages and commands. All commands and
  61. user messages are passed directly to the server for processing and
  62. relaying to other server sites.
  63. %prep
  64. %setup -q -n irc%{version}
  65. %patch -p0
  66. %build
  67. CC="%{l_cc}" \
  68. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  69. CPPFLAGS="%{l_cppflags}" \
  70. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  71. LIBS="%{l_fsl_libs}" \
  72. ./configure \
  73. --prefix=%{l_prefix} \
  74. --sysconfdir=%{l_prefix}/etc/ircd \
  75. --libdir=%{l_prefix}/lib/ircd \
  76. --localstatedir=%{l_prefix}/var/ircd \
  77. --with-zlib-prefix=%{l_prefix} \
  78. --with-zlib \
  79. --disable-dsm
  80. ( cd *-*-*
  81. %{l_shtool} subst \
  82. -e 's;^#undef ZIP_LINKS;#define ZIP_LINKS;' \
  83. config.h
  84. %{l_make} %{l_mflags -O} server \
  85. ircd_dir=%{l_prefix} \
  86. ircd_conf_dir=%{l_prefix}/etc/ircd \
  87. ircd_var_dir=%{l_prefix}/var/ircd \
  88. ircd_log_dir=%{l_prefix}/var/ircd
  89. ) || exit $?
  90. %install
  91. rm -rf $RPM_BUILD_ROOT
  92. %{l_shtool} mkdir -f -p -m 755 \
  93. $RPM_BUILD_ROOT%{l_prefix}/var
  94. ( cd *-*-*
  95. %{l_make} %{l_mflags} install-server \
  96. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  97. ircd_dir=$RPM_BUILD_ROOT%{l_prefix} \
  98. ircd_conf_dir=$RPM_BUILD_ROOT%{l_prefix}/etc/ircd \
  99. ircd_var_dir=$RPM_BUILD_ROOT%{l_prefix}/var/ircd \
  100. ircd_log_dir=$RPM_BUILD_ROOT%{l_prefix}/var/ircd
  101. ) || exit $?
  102. mv $RPM_BUILD_ROOT%{l_prefix}/sbin/chkconf \
  103. $RPM_BUILD_ROOT%{l_prefix}/sbin/ircd-chkconf
  104. mv $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/example.conf \
  105. $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.conf.sample
  106. %{l_shtool} install -c -m 644 %{SOURCE ircd.conf} \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.conf
  108. %{l_shtool} install -c -m 644 /dev/null \
  109. $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.motd
  110. %{l_shtool} install -c -m 644 /dev/null \
  111. $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.tune
  112. rm -rf $RPM_BUILD_ROOT%{l_prefix}/bin
  113. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/irc.1
  114. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
  115. # install run-command script
  116. %{l_shtool} mkdir -f -p -m 755 \
  117. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  118. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  119. %{SOURCE rc.ircd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  120. # install OSSP fsl configuration
  121. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  122. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  123. %{SOURCE fsl.ircd} \
  124. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  125. # determine installation files
  126. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  127. %{l_files_std} \
  128. '%not %dir %{l_prefix}/etc/fsl' \
  129. '%config %{l_prefix}/etc/fsl/fsl.ircd' \
  130. '%config %{l_prefix}/etc/ircd/*'
  131. %files -f files
  132. %clean
  133. rm -rf $RPM_BUILD_ROOT
  134. %post
  135. # after upgrade, restart service
  136. [ $1 -eq 2 ] || exit 0
  137. eval `%{l_rc} ircd status 2>/dev/null`
  138. [ ".$ircd_active" = .yes ] && %{l_rc} ircd restart
  139. exit 0
  140. %preun
  141. # before erase, stop service and remove log files
  142. [ $1 -eq 0 ] || exit 0
  143. %{l_rc} ircd stop 2>/dev/null
  144. rm -f $RPM_INSTALL_PREFIX/var/ircd/ircd.log* >/dev/null 2>&1 || true
  145. exit 0