diogene87.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. ##
  2. ## diogene87.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: diogene87
  26. Summary: Job Scheduling System
  27. URL: http://diogene87.org/
  28. Vendor: D. Parisot & S.G. Ytsma
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: EVAL
  32. Group: System
  33. License: GPL
  34. Version: 0.9.3
  35. Release: 20050526
  36. # package options
  37. %option with_fsl yes
  38. # list of sources
  39. Source0: http://osdn.dl.sourceforge.net/diogene87/diogene87-%{version}.tar.gz
  40. Source1: rc.diogene87
  41. Source2: fsl.diogene87
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20040130
  46. PreReq: OpenPKG, openpkg >= 20040130
  47. %if "%{with_fsl}" == "yes"
  48. BuildPreReq: fsl >= 1.2.0
  49. PreReq: fsl >= 1.2.0
  50. %endif
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. Diogene87 is a powerful scheduler system providing centralized
  55. management, jobs dependences, start condition, planning, log of job
  56. activity, job monitoring, statistic for job duration and resource
  57. control.
  58. %track
  59. prog diogene87 = {
  60. version = %{version}
  61. url = http://prdownloads.sourceforge.net/diogene87/
  62. regex = diogene87-(__VER__)\.tar\.gz
  63. }
  64. %prep
  65. %setup -q
  66. %build
  67. # configure program
  68. %{l_shtool} subst \
  69. -e 's;\(localstatedir./lib\)/diogene87;\1;g' \
  70. -e 's;\(localstatedir./run\)/diogene87;\1;g' \
  71. configure conf/Makefile.in
  72. CC="%{l_cc}" \
  73. CFLAGS="%{l_cflags -O}" \
  74. CPPFLAGS="%{l_cppflags}" \
  75. LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
  76. LIBS="%{l_fsl_libs}" \
  77. ./configure \
  78. --prefix=%{l_prefix} \
  79. --localstatedir=%{l_prefix}/var/diogene87 \
  80. --disable-smart-install
  81. # build program
  82. %{l_make} %{l_mflags -O}
  83. %install
  84. # install program
  85. rm -rf $RPM_BUILD_ROOT
  86. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  87. # strip down installation files
  88. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/diogene87
  89. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  90. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/*_dev*
  91. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/*_fr*
  92. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  93. # post-adjust default configuration
  94. %{l_shtool} subst \
  95. -e 's;^#\(PID_FILE.*\);\1;' \
  96. -e 's;^#\(USER_ACCOUNT\)=.*;\1=%{l_rusr};' \
  97. -e 's;^#\(IPPORT=.*\);\1;' \
  98. -e 's;^#\(IPADDR\)=.*;\1=127.0.0.1;' \
  99. $RPM_BUILD_ROOT%{l_prefix}/etc/diogene87/dio87d.conf
  100. # install OSSP fsl configuration
  101. %{l_shtool} mkdir -f -p -m 755 \
  102. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
  103. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  104. %{SOURCE fsl.diogene87} $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  105. # install run-command script
  106. %{l_shtool} mkdir -f -p -m 755 \
  107. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  108. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  109. %{SOURCE rc.diogene87} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  110. # create additional directories
  111. %{l_shtool} mkdir -f -p -m 755 \
  112. $RPM_BUILD_ROOT%{l_prefix}/var/diogene87/log
  113. # determine installation files
  114. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  115. %{l_files_std} \
  116. '%not %dir %{l_prefix}/etc/fsl' \
  117. '%config %{l_prefix}/etc/fsl/fsl.diogene87' \
  118. '%config %attr(640,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/diogene87/*' \
  119. '%attr(700,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/diogene87/run' \
  120. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/diogene87/lib' \
  121. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/diogene87/log'
  122. %files -f files
  123. %clean
  124. rm -rf $RPM_BUILD_ROOT
  125. %post
  126. # create initial database
  127. if [ $1 -eq 1 ]; then
  128. echo "Creating initial Diogene87 database" | %{l_rpmtool} msg -b -t info
  129. su %{l_rusr} -c "umask 077; $RPM_INSTALL_PREFIX/sbin/dio87d -I 2>/dev/null"
  130. fi
  131. # after upgrade, restart service
  132. [ $1 -eq 2 ] || exit 0
  133. eval `%{l_rc} diogene87 status 2>/dev/null`
  134. [ ".$diogene87_active" = .yes ] && %{l_rc} diogene87 restart
  135. exit 0
  136. %preun
  137. # before erase, stop service and remove log files
  138. [ $1 -eq 0 ] || exit 0
  139. %{l_rc} diogene87 stop 2>/dev/null
  140. rm -f $RPM_INSTALL_PREFIX/var/diogene87/lib/dio87d.data >/dev/null 2>&1 || true
  141. rm -f $RPM_INSTALL_PREFIX/var/diogene87/log/diogene87.log >/dev/null 2>&1 || true
  142. exit 0