ices.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ##
  2. ## ices.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2009 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_base 0.4
  25. %define V_snap 20090901
  26. # package information
  27. Name: ices
  28. Summary: MP3 Streaming Source Client for Icecast
  29. URL: http://www.icecast.org/ices.php
  30. Vendor: Alexander Havang
  31. Packager: OpenPKG Foundation e.V.
  32. Distribution: OpenPKG Community
  33. Class: EVAL
  34. Group: Audio
  35. License: GPL
  36. Version: %{V_base}.%{V_snap}
  37. Release: 20090902
  38. # list of sources
  39. Source0: http://people.xiph.org/~brendan/snapshots/ices0/ices-%{V_base}-%{V_snap}.tar.gz
  40. Source1: ices.conf
  41. Source2: rc.ices
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20060823
  46. PreReq: OpenPKG, openpkg >= 20060823
  47. BuildPreReq: libshout, libxml, vorbis-libs, flac, lame, perl
  48. PreReq: libshout, libxml, vorbis-libs, flac, lame, perl
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. Ices, armed with a list of MP3 files, sends a continuous stream of
  53. MP3 data to an Icecast server. The server is then responsible for
  54. accepting client connections and feeding the MP3 stream to them.
  55. %track
  56. prog ices = {
  57. version = %{V_base}-%{V_snap}
  58. url = http://people.xiph.org/~brendan/snapshots/ices0/
  59. regex = ices-(__VER__\-\d{4}\d{2}01)\.tar\.gz
  60. }
  61. %prep
  62. %setup -q -n ices-%{V_base}
  63. %build
  64. # configure program
  65. CC="%{l_cc}" \
  66. CFLAGS="%{l_cflags -O}" \
  67. CPPFLAGS="%{l_cppflags}" \
  68. LDFLAGS="%{l_ldflags}" \
  69. ./configure \
  70. --prefix=%{l_prefix} \
  71. --sysconfdir=%{l_prefix}/etc/ices \
  72. --with-xml-config=%{l_prefix}/bin/xml2-config \
  73. --with-perl=%{l_prefix}/bin/perl \
  74. --with-vorbis=%{l_prefix} \
  75. --with-lame=%{l_prefix} \
  76. --with-flac=%{l_prefix}
  77. # build program
  78. %{l_make} %{l_mflags -O}
  79. %install
  80. # install program
  81. rm -rf $RPM_BUILD_ROOT
  82. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  83. # install default configuration
  84. # post-adjust installation
  85. mv $RPM_BUILD_ROOT%{l_prefix}/etc/ices/modules/ices.pm.dist \
  86. $RPM_BUILD_ROOT%{l_prefix}/etc/ices/modules/ices.pm
  87. # strip down installation
  88. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  89. rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc/ices >/dev/null 2>&1 || true
  90. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/ices/ices.conf.dist >/dev/null 2>&1 || true
  91. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/ices/modules/ices.py.dist >/dev/null 2>&1 || true
  92. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/ices/modules/ices.sh.dist >/dev/null 2>&1 || true
  93. # install default configuration
  94. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  95. %{SOURCE ices.conf} $RPM_BUILD_ROOT%{l_prefix}/etc/ices/
  96. # install run-command script
  97. %{l_shtool} mkdir -f -p -m 755 \
  98. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  99. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  100. %{SOURCE rc.ices} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  101. # create run-time directory
  102. %{l_shtool} mkdir -f -p -m 755 \
  103. $RPM_BUILD_ROOT%{l_prefix}/var/ices
  104. # determine installation files
  105. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  106. %{l_files_std} \
  107. '%config %{l_prefix}/etc/ices/*' \
  108. '%attr(-,%{l_nusr},%{l_ngrp}) %{l_prefix}/var/ices'
  109. %files -f files
  110. %clean
  111. rm -rf $RPM_BUILD_ROOT
  112. %post
  113. # after upgrade, restart service
  114. [ $1 -eq 2 ] || exit 0
  115. eval `%{l_rc} ices status 2>/dev/null`
  116. [ ".$ices_active" = .yes ] && %{l_rc} ices restart
  117. exit 0
  118. %preun
  119. # before erase, stop service and remove log files
  120. [ $1 -eq 0 ] || exit 0
  121. %{l_rc} ices stop 2>/dev/null
  122. rm -f $RPM_INSTALL_PREFIX/var/ices/* >/dev/null 2>&1 || true
  123. exit 0