ircd.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. ##
  2. ## ircd.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 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/servers.html
  29. Vendor: Jarkko Oikarinen
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG
  32. Class: BASE
  33. Group: Network
  34. License: BSD
  35. Version: 2.10.3p6
  36. Release: 20040226
  37. # package options
  38. %option with_fsl yes
  39. # list of sources
  40. Source0: ftp://ftp.irc.org/irc/server/irc%{version}.tgz
  41. Source1: rc.ircd
  42. Source2: ircd.conf
  43. Source3: fsl.ircd
  44. Patch0: ircd.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130
  49. PreReq: OpenPKG, openpkg >= 20040130
  50. BuildPreReq: zlib
  51. PreReq: zlib
  52. %if "%{with_fsl}" == "yes"
  53. BuildPreReq: fsl >= 1.2.0
  54. PreReq: fsl >= 1.2.0
  55. %endif
  56. AutoReq: no
  57. AutoReqProv: no
  58. %description
  59. This is the classical IRCnet daemon. It is the server program for
  60. the Internet Relay Chat (IRC) service. Its function is to serve
  61. the client program with messages and commands. All commands and
  62. user messages are passed directly to the server for processing and
  63. relaying to other server sites.
  64. %track
  65. prog ircd = {
  66. version = %{version}
  67. url = ftp://ftp.irc.org/irc/server/
  68. regex = irc(__VER__)\.tgz
  69. }
  70. %prep
  71. %setup -q -n irc%{version}
  72. %patch -p0
  73. %build
  74. CC="%{l_cc}" \
  75. CFLAGS="%{l_cflags -O} %{l_cppflags}" \
  76. CPPFLAGS="%{l_cppflags}" \
  77. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  78. LIBS="%{l_fsl_libs}" \
  79. ./configure \
  80. --prefix=%{l_prefix} \
  81. --sysconfdir=%{l_prefix}/etc/ircd \
  82. --libdir=%{l_prefix}/lib/ircd \
  83. --localstatedir=%{l_prefix}/var/ircd \
  84. --with-zlib-prefix=%{l_prefix} \
  85. --with-zlib \
  86. --disable-dsm
  87. ( cd *-*-*
  88. %{l_shtool} subst \
  89. -e 's;^#undef ZIP_LINKS;#define ZIP_LINKS;' \
  90. config.h
  91. %{l_make} %{l_mflags -O} server \
  92. ircd_dir=%{l_prefix} \
  93. ircd_conf_dir=%{l_prefix}/etc/ircd \
  94. ircd_var_dir=%{l_prefix}/var/ircd \
  95. ircd_log_dir=%{l_prefix}/var/ircd
  96. ) || exit $?
  97. %install
  98. rm -rf $RPM_BUILD_ROOT
  99. %{l_shtool} mkdir -f -p -m 755 \
  100. $RPM_BUILD_ROOT%{l_prefix}/var
  101. ( cd *-*-*
  102. %{l_make} %{l_mflags} install-server \
  103. prefix=$RPM_BUILD_ROOT%{l_prefix} \
  104. ircd_dir=$RPM_BUILD_ROOT%{l_prefix} \
  105. ircd_conf_dir=$RPM_BUILD_ROOT%{l_prefix}/etc/ircd \
  106. ircd_var_dir=$RPM_BUILD_ROOT%{l_prefix}/var/ircd \
  107. ircd_log_dir=$RPM_BUILD_ROOT%{l_prefix}/var/ircd
  108. ) || exit $?
  109. mv $RPM_BUILD_ROOT%{l_prefix}/sbin/chkconf \
  110. $RPM_BUILD_ROOT%{l_prefix}/sbin/ircd-chkconf
  111. mv $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/example.conf \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.conf.sample
  113. %{l_shtool} install -c -m 644 %{SOURCE ircd.conf} \
  114. $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.conf
  115. %{l_shtool} install -c -m 644 /dev/null \
  116. $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.motd
  117. %{l_shtool} install -c -m 644 /dev/null \
  118. $RPM_BUILD_ROOT%{l_prefix}/etc/ircd/ircd.tune
  119. rm -rf $RPM_BUILD_ROOT%{l_prefix}/bin
  120. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/irc.1
  121. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* 2>/dev/null || true
  122. # install run-command script
  123. %{l_shtool} mkdir -f -p -m 755 \
  124. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  125. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  126. %{SOURCE rc.ircd} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  127. # install OSSP fsl configuration
  128. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  129. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  130. %{SOURCE fsl.ircd} \
  131. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  132. # determine installation files
  133. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  134. %{l_files_std} \
  135. '%not %dir %{l_prefix}/etc/fsl' \
  136. '%config %{l_prefix}/etc/fsl/fsl.ircd' \
  137. '%config %{l_prefix}/etc/ircd/*'
  138. %files -f files
  139. %clean
  140. rm -rf $RPM_BUILD_ROOT
  141. %post
  142. # after upgrade, restart service
  143. [ $1 -eq 2 ] || exit 0
  144. eval `%{l_rc} ircd status 2>/dev/null`
  145. [ ".$ircd_active" = .yes ] && %{l_rc} ircd restart
  146. exit 0
  147. %preun
  148. # before erase, stop service and remove log files
  149. [ $1 -eq 0 ] || exit 0
  150. %{l_rc} ircd stop 2>/dev/null
  151. rm -f $RPM_INSTALL_PREFIX/var/ircd/ircd.log* >/dev/null 2>&1 || true
  152. exit 0