Mon, 28 Jan 2013 17:37:18 +0100
Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.
1 ##
2 ## mico.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 ##
24 # package information
25 Name: mico
26 Summary: CORBA Toolkit
27 URL: http://www.mico.org/
28 Vendor: The MICO Project
29 Packager: OpenPKG Foundation e.V.
30 Distribution: OpenPKG Community
31 Class: PLUS
32 Group: RPC
33 License: LGPL/GPL
34 Version: 2.3.13
35 Release: 20120800
37 # package options
38 %option with_ssl no
39 %option with_x11 no
40 %option with_qt no
41 %option with_gtk no
42 %option with_tcl no
44 # list of sources
45 Source0: http://www.mico.org/mico-%{version}.tar.gz
46 Source2: rc.mico
48 # build information
49 BuildPreReq: OpenPKG, openpkg >= 20100101, make, gcc, gcc::with_cxx = yes
50 PreReq: OpenPKG, openpkg >= 20100101
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 < 4, pkgconfig
61 PreReq: qt < 4
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
72 %description
73 The acronym MICO expands to MICO Is CORBA. The intention of this
74 project is to provide a freely available and fully compliant
75 implementation of the CORBA standard. The following design
76 principles guided the implementation of MICO:
77 - Start from scratch, and only use standard APIs (Posix/Win32)
78 - Don't rely on propietary or specialized libraries
79 - Use standard C++ for the implementation
80 - Only make use of widely available, free, non-proprietary tools
81 - Only implement what is required for a CORBA compliant implementation
82 - Provide a clear design even for implementation internals
84 %track
85 prog mico = {
86 version = %{version}
87 url = http://www.mico.org/down.html
88 regex = mico-(__VER__)\.tar\.gz
89 }
91 %prep
92 %setup -q -n mico
93 %{l_shtool} subst \
94 -e '/#include <mico\/impl.h>/a#include "limits.h"' \
95 orb/fast_array.cc
97 %build
98 CC="%{l_cc}"
99 CXX="%{l_cxx}"
100 CFLAGS="%{l_cflags -O}"
101 CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated"
102 CPPFLAGS="%{l_cppflags}"
103 includedir=""
104 %if "%{with_qt}" == "yes"
105 CFLAGS="$CFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
106 CXXFLAGS="$CXXFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
107 CPPFLAGS="$CPPFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-I qt`"
108 includedir="$includedir %{l_prefix}/include/qt"
109 LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pkg-config --libs-only-L qt`"
110 %endif
111 %if "%{with_ssl}" == "yes"
112 includedir="$includedir %{l_prefix}/include/openssl"
113 %endif
114 %if "%{with_gtk}" == "yes"
115 includedir="$includedir %{l_prefix}/include/gtk"
116 %endif
117 %if "%{with_tcl}" == "yes"
118 includedir="$includedir %{l_prefix}/include/tcl"
119 %endif
120 for dir in $includedir; do
121 CPPFLAGS="$CPPFLAGS -I$dir"
122 done
123 LDFLAGS="%{l_ldflags}"
124 JAVAC=no
125 export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS JAVAC
126 ./configure \
127 --prefix=%{l_prefix} \
128 %if "%{with_ssl}" == "yes"
129 --with-ssl=%{l_prefix} \
130 %endif
131 %if "%{with_x11}" == "yes"
132 --with-x \
133 --x-includes=`%{l_rc} --query x11_incdir` \
134 --x-libraries=`%{l_rc} --query x11_libdir` \
135 %else
136 --without-x \
137 %endif
138 %if "%{with_qt}" == "yes"
139 --with-qt=%{l_prefix} \
140 %endif
141 %if "%{with_gtk}" == "yes"
142 --with-gtk=%{l_prefix} \
143 %endif
144 %if "%{with_tcl}" == "yes"
145 --with-tcl=%{l_prefix} \
146 %endif
147 --disable-mini-stl \
148 --disable-shared
149 touch cpp/.depend
150 %{l_make} %{l_mflags -O}
152 %install
153 # make directory structure
154 %{l_shtool} mkdir -f -p -m 755 \
155 $RPM_BUILD_ROOT%{l_prefix}/bin \
156 $RPM_BUILD_ROOT%{l_prefix}/lib \
157 $RPM_BUILD_ROOT%{l_prefix}/include/mico \
158 $RPM_BUILD_ROOT%{l_prefix}/include/coss \
159 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
160 $RPM_BUILD_ROOT%{l_prefix}/var/mico \
161 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
162 $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
163 $RPM_BUILD_ROOT%{l_prefix}/man/man8
165 # install binaries, libraries, headers
166 %{l_make} %{l_mflags} install \
167 LDCONFIG=true \
168 INSTDIR=$RPM_BUILD_ROOT%{l_prefix} \
169 SHARED_INSTDIR=$RPM_BUILD_ROOT%{l_prefix}
171 # install our own things
172 %{l_shtool} install -c -m 755 %{l_value -s -a} \
173 %{SOURCE rc.mico} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
175 # cleanup installation files
176 rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
177 rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/ministl
178 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mico-setup.*
179 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
180 ( cd $RPM_BUILD_ROOT%{l_prefix}/lib
181 for name in mico micoaux micocoss micoir; do
182 mv lib${name}%{version}.a lib${name}.a
183 done
184 %if "%{with_x11}" == "yes"
185 mv libmicox%{version}.a libmicox.a
186 %endif
187 %if "%{with_qt}" == "yes"
188 mv libmicoqt%{version}.a libmicoqt.a
189 %endif
190 %if "%{with_gtk}" == "yes"
191 mv libmicogtk%{version}.a libmicogtk.a
192 %endif
193 %if "%{with_tcl}" == "yes"
194 mv libmicotcl%{version}.a libmicotcl.a
195 %endif
196 ) || exit $?
198 # generate files listing
199 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
200 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mico'
202 %files -f files
204 %clean
206 %pre
207 # before upgrade, save status and stop service
208 [ $1 -eq 2 ] || exit 0
209 eval `%{l_rc} mico status 2>/dev/null | tee %{l_tmpfile}`
210 %{l_rc} mico stop 2>/dev/null
211 exit 0
213 %post
214 if [ $1 -eq 2 ]; then
215 # after upgrade, restore status
216 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
217 [ ".$mico_active" = .yes ] && %{l_rc} mico start
218 fi
219 exit 0
221 %preun
222 # before erase, stop service
223 [ $1 -eq 0 ] || exit 0
224 %{l_rc} mico stop 2>/dev/null
225 exit 0