ngircd.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. ##
  2. ## ngircd.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_opkg 0.11.1
  25. %define V_dist 0.11.1
  26. # package information
  27. Name: ngircd
  28. Summary: Next Generation IRC Server
  29. URL: http://arthur.ath.cx/~alex/ngircd/
  30. Vendor: Alexander Barton
  31. Packager: OpenPKG Foundation e.V.
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: InstantMessaging
  35. License: GNU
  36. Version: %{V_opkg}
  37. Release: 20080227
  38. # package options
  39. %option with_fsl yes
  40. # list of sources
  41. Source0: ftp://ftp.berlios.de/pub/ngircd/ngircd-%{V_dist}.tar.gz
  42. Source1: rc.ngircd
  43. Source2: fsl.ngircd
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20060823, zlib
  48. PreReq: OpenPKG, openpkg >= 20060823, zlib
  49. %if "%{with_fsl}" == "yes"
  50. BuildPreReq: fsl
  51. PreReq: fsl
  52. %endif
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. ngIRCd is an Open-Source server for the Internet Relay Chat (IRC)
  57. It's written from scratch and not deduced from the "grandfather of
  58. IRC daemons", the daemon of the IRCNet.
  59. %track
  60. prog ngircd = {
  61. version = %{V_dist}
  62. url = ftp://ftp.berlios.de/pub/ngircd/
  63. regex = ngircd-(\d+(\.\d+)+)\.tar\.gz
  64. }
  65. %prep
  66. %setup -q -n ngircd-%{V_dist}
  67. %{l_shtool} subst \
  68. -e 's;^\(docdir = $(datadir)/\)doc/\($(PACKAGE)\);\1\2;' \
  69. doc/Makefile.in
  70. %build
  71. CC="%{l_cc}" \
  72. CXX="%{l_cxx}" \
  73. CFLAGS="%{l_cflags -O} -DPID_FILE" \
  74. CXXFLAGS="%{l_cxxflags -O}" \
  75. CPPFLAGS="%{l_cppflags}" \
  76. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  77. LIBS="%{l_fsl_libs}" \
  78. ./configure \
  79. --prefix=%{l_prefix} \
  80. --sysconfdir=%{l_prefix}/etc/ngircd
  81. %{l_make} %{l_mflags -O}
  82. %install
  83. rm -rf $RPM_BUILD_ROOT
  84. %{l_shtool} mkdir -f -p -m 755 \
  85. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  86. $RPM_BUILD_ROOT%{l_prefix}/etc/ngircd \
  87. $RPM_BUILD_ROOT%{l_prefix}/var/ngircd/run \
  88. $RPM_BUILD_ROOT%{l_prefix}/var/ngircd/log
  89. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  90. %{l_shtool} echo \
  91. 'Welcome to ngIRCd (%{l_openpkg_release -F "OpenPKG-%%t"})' \
  92. >$RPM_BUILD_ROOT%{l_prefix}/etc/ngircd/ngircd.motd
  93. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  94. # add startup script
  95. cp doc/sample-ngircd.conf ngircd.conf
  96. %{l_shtool} install -c -m 600 \
  97. -e 's|;\(Listen = \).*$|\1 127.0.0.1|' \
  98. -e 's|;\(ServerUID = \).*$|\1 %{l_ruid}|' \
  99. -e 's|;\(ServerGID = \).*$|\1 %{l_rgid}|' \
  100. -e 's|;\(MotdFile = \).*$|\1 %{l_prefix}/etc/ngircd/ngircd.motd|' \
  101. -e 's|;\(PidFile = \).*$|\1 %{l_prefix}/var/ngircd/run/ngircd.pid|' \
  102. ngircd.conf \
  103. $RPM_BUILD_ROOT%{l_prefix}/etc/ngircd/
  104. # add startup script
  105. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  106. %{SOURCE rc.ngircd} \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  108. # install OSSP fsl configuration
  109. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  110. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  111. %{SOURCE fsl.ngircd} \
  112. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  113. # determine installation files
  114. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  115. %{l_files_std} \
  116. '%config %{l_prefix}/etc/fsl/fsl.ngircd' \
  117. '%config %{l_prefix}/etc/ngircd/*' \
  118. '%attr(0755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/ngircd' \
  119. '%attr(0755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/ngircd/run' \
  120. '%attr(0755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/ngircd/log' \
  121. '%doc %{l_prefix}/share/doc/ngircd/*'
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT