mico.spec 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. ##
  2. ## mico.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: mico
  27. Summary: CORBA Toolkit
  28. URL: http://www.mico.org/
  29. Vendor: The MICO Project
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [PLUS]
  32. Group: System
  33. License: LGPL/GPL
  34. Version: 2.3.10
  35. Release: 20031008
  36. # package options
  37. %option with_ssl no
  38. %option with_x11 no
  39. %option with_qt no
  40. %option with_gtk no
  41. %option with_tcl no
  42. # list of sources
  43. Source0: http://www.mico.org/mico-%{version}.tar.gz
  44. Source2: rc.mico
  45. Patch0: mico.patch
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20030718, gcc, make
  50. PreReq: OpenPKG, openpkg >= 20030718
  51. %if "%{with_ssl}" == "yes"
  52. BuildPreReq: openssl
  53. PreReq: openssl
  54. %endif
  55. %if "%{with_x11}" == "yes"
  56. BuildPreReq: X11
  57. PreReq: X11
  58. %endif
  59. %if "%{with_qt}" == "yes"
  60. BuildPreReq: qt, pkgconfig
  61. PreReq: qt
  62. %endif
  63. %if "%{with_gtk}" == "yes"
  64. BuildPreReq: gtk
  65. PreReq: gtk
  66. %endif
  67. %if "%{with_tcl}" == "yes"
  68. BuildPreReq: tcl
  69. PreReq: tcl
  70. %endif
  71. AutoReq: no
  72. AutoReqProv: no
  73. %description
  74. The acronym MICO expands to MICO Is CORBA. The intention of this
  75. project is to provide a freely available and fully compliant
  76. implementation of the CORBA standard. The following design
  77. principles guided the implementation of MICO:
  78. - Start from scratch, and only use standard APIs (Posix/Win32)
  79. - Don't rely on propietary or specialized libraries
  80. - Use standard C++ for the implementation
  81. - Only make use of widely available, free, non-proprietary tools
  82. - Only implement what is required for a CORBA compliant implementation
  83. - Provide a clear design even for implementation internals
  84. %prep
  85. %setup -q -n mico
  86. %patch -p1
  87. %build
  88. CC="%{l_cc}"
  89. CXX="%{l_cxx}"
  90. CFLAGS="%{l_cflags -O}"
  91. CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated"
  92. CPPFLAGS="%{l_cppflags}"
  93. includedir=""
  94. %if "%{with_qt}" == "yes"
  95. CFLAGS="$CFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
  96. CXXFLAGS="$CXXFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
  97. CPPFLAGS="$CPPFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-I qt`"
  98. includedir="$includedir %{l_prefix}/include/qt"
  99. LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pkg-config --libs-only-L qt`"
  100. %endif
  101. %if "%{with_ssl}" == "yes"
  102. includedir="$includedir %{l_prefix}/include/openssl"
  103. %endif
  104. %if "%{with_gtk}" == "yes"
  105. includedir="$includedir %{l_prefix}/include/gtk"
  106. %endif
  107. %if "%{with_tcl}" == "yes"
  108. includedir="$includedir %{l_prefix}/include/tcl"
  109. %endif
  110. for dir in $includedir; do
  111. CPPFLAGS="$CPPFLAGS -I$dir"
  112. done
  113. LDFLAGS="%{l_ldflags}"
  114. JAVAC=no
  115. export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS JAVAC
  116. ./configure \
  117. --prefix=%{l_prefix} \
  118. %if "%{with_ssl}" == "yes"
  119. --with-ssl=%{l_prefix} \
  120. %endif
  121. %if "%{with_x11}" == "yes"
  122. --with-x \
  123. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  124. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir` \
  125. %else
  126. --without-x \
  127. %endif
  128. %if "%{with_qt}" == "yes"
  129. --with-qt=%{l_prefix} \
  130. %endif
  131. %if "%{with_gtk}" == "yes"
  132. --with-gtk=%{l_prefix} \
  133. %endif
  134. %if "%{with_tcl}" == "yes"
  135. --with-tcl=%{l_prefix} \
  136. %endif
  137. --disable-mini-stl \
  138. --disable-shared
  139. %{l_make} %{l_mflags}
  140. %install
  141. rm -rf $RPM_BUILD_ROOT
  142. # make directory structure
  143. %{l_shtool} mkdir -f -p -m 755 \
  144. $RPM_BUILD_ROOT%{l_prefix}/bin \
  145. $RPM_BUILD_ROOT%{l_prefix}/lib \
  146. $RPM_BUILD_ROOT%{l_prefix}/include/mico \
  147. $RPM_BUILD_ROOT%{l_prefix}/include/coss \
  148. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  149. $RPM_BUILD_ROOT%{l_prefix}/var/mico \
  150. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  151. $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
  152. $RPM_BUILD_ROOT%{l_prefix}/man/man8
  153. # install binaries, libraries, headers
  154. %{l_make} %{l_mflags} install \
  155. INSTDIR=$RPM_BUILD_ROOT%{l_prefix} \
  156. SHARED_INSTDIR=$RPM_BUILD_ROOT%{l_prefix}
  157. # install our own things
  158. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  159. %{SOURCE rc.mico} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  160. # cleanup installation files
  161. rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
  162. rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/ministl
  163. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mico-setup.*
  164. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  165. mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/nsd.8 \
  166. $RPM_BUILD_ROOT%{l_prefix}/man/man8/mico-nsd.8
  167. ( cd $RPM_BUILD_ROOT%{l_prefix}/lib
  168. for name in mico micoaux micocoss micoir; do
  169. mv lib${name}%{version}.a lib${name}.a
  170. done
  171. %if "%{with_x11}" == "yes"
  172. mv libmicox%{version}.a libmicox.a
  173. %endif
  174. %if "%{with_qt}" == "yes"
  175. mv libmicoqt%{version}.a libmicoqt.a
  176. %endif
  177. %if "%{with_gtk}" == "yes"
  178. mv libmicogtk%{version}.a libmicogtk.a
  179. %endif
  180. %if "%{with_tcl}" == "yes"
  181. mv libmicotcl%{version}.a libmicotcl.a
  182. %endif
  183. ) || exit $?
  184. # generate files listing
  185. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  186. '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mico'
  187. %files -f files
  188. %clean
  189. rm -rf $RPM_BUILD_ROOT
  190. %pre
  191. # before upgrade, save status and stop service
  192. [ $1 -eq 2 ] || exit 0
  193. eval `%{l_rc} mico status 2>/dev/null | tee %{l_tmpfile}`
  194. %{l_rc} mico stop 2>/dev/null
  195. exit 0
  196. %post
  197. if [ $1 -eq 2 ]; then
  198. # after upgrade, restore status
  199. eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
  200. [ ".$mico_active" = .yes ] && %{l_rc} mico start
  201. fi
  202. exit 0
  203. %preun
  204. # before erase, stop service
  205. [ $1 -eq 0 ] || exit 0
  206. %{l_rc} mico stop 2>/dev/null
  207. exit 0