Fri, 03 Aug 2012 20:11:53 +0200
Neutralize buggy code causing OpenPKG to have 'fatal problems' in
spite of correct installation, configuration, and operation. An
administrator suffering from this failure is even unable to
uninstall the flawed software.
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: 20081215
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 Prefix: %{l_prefix}
50 BuildRoot: %{l_buildroot}
51 BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, gcc::with_cxx = yes
52 PreReq: OpenPKG, openpkg >= 20060823
53 %if "%{with_ssl}" == "yes"
54 BuildPreReq: openssl
55 PreReq: openssl
56 %endif
57 %if "%{with_x11}" == "yes"
58 BuildPreReq: X11
59 PreReq: X11
60 %endif
61 %if "%{with_qt}" == "yes"
62 BuildPreReq: qt < 4, pkgconfig
63 PreReq: qt < 4
64 %endif
65 %if "%{with_gtk}" == "yes"
66 BuildPreReq: gtk
67 PreReq: gtk
68 %endif
69 %if "%{with_tcl}" == "yes"
70 BuildPreReq: tcl
71 PreReq: tcl
72 %endif
73 AutoReq: no
74 AutoReqProv: no
76 %description
77 The acronym MICO expands to MICO Is CORBA. The intention of this
78 project is to provide a freely available and fully compliant
79 implementation of the CORBA standard. The following design
80 principles guided the implementation of MICO:
81 - Start from scratch, and only use standard APIs (Posix/Win32)
82 - Don't rely on propietary or specialized libraries
83 - Use standard C++ for the implementation
84 - Only make use of widely available, free, non-proprietary tools
85 - Only implement what is required for a CORBA compliant implementation
86 - Provide a clear design even for implementation internals
88 %track
89 prog mico = {
90 version = %{version}
91 url = http://www.mico.org/down.html
92 regex = mico-(__VER__)\.tar\.gz
93 }
95 %prep
96 %setup -q -n mico
98 %build
99 CC="%{l_cc}"
100 CXX="%{l_cxx}"
101 CFLAGS="%{l_cflags -O}"
102 CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated"
103 CPPFLAGS="%{l_cppflags}"
104 includedir=""
105 %if "%{with_qt}" == "yes"
106 CFLAGS="$CFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
107 CXXFLAGS="$CXXFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-other qt`"
108 CPPFLAGS="$CPPFLAGS `%{l_prefix}/bin/pkg-config --cflags-only-I qt`"
109 includedir="$includedir %{l_prefix}/include/qt"
110 LDFLAGS="$LDFLAGS `%{l_prefix}/bin/pkg-config --libs-only-L qt`"
111 %endif
112 %if "%{with_ssl}" == "yes"
113 includedir="$includedir %{l_prefix}/include/openssl"
114 %endif
115 %if "%{with_gtk}" == "yes"
116 includedir="$includedir %{l_prefix}/include/gtk"
117 %endif
118 %if "%{with_tcl}" == "yes"
119 includedir="$includedir %{l_prefix}/include/tcl"
120 %endif
121 for dir in $includedir; do
122 CPPFLAGS="$CPPFLAGS -I$dir"
123 done
124 LDFLAGS="%{l_ldflags}"
125 JAVAC=no
126 export CC CXX CFLAGS CXXFLAGS CPPFLAGS LDFLAGS JAVAC
127 ./configure \
128 --prefix=%{l_prefix} \
129 %if "%{with_ssl}" == "yes"
130 --with-ssl=%{l_prefix} \
131 %endif
132 %if "%{with_x11}" == "yes"
133 --with-x \
134 --x-includes=`%{l_rc} --query x11_incdir` \
135 --x-libraries=`%{l_rc} --query x11_libdir` \
136 %else
137 --without-x \
138 %endif
139 %if "%{with_qt}" == "yes"
140 --with-qt=%{l_prefix} \
141 %endif
142 %if "%{with_gtk}" == "yes"
143 --with-gtk=%{l_prefix} \
144 %endif
145 %if "%{with_tcl}" == "yes"
146 --with-tcl=%{l_prefix} \
147 %endif
148 --disable-mini-stl \
149 --disable-shared
150 touch cpp/.depend
151 %{l_make} %{l_mflags -O}
153 %install
154 rm -rf $RPM_BUILD_ROOT
156 # make directory structure
157 %{l_shtool} mkdir -f -p -m 755 \
158 $RPM_BUILD_ROOT%{l_prefix}/bin \
159 $RPM_BUILD_ROOT%{l_prefix}/lib \
160 $RPM_BUILD_ROOT%{l_prefix}/include/mico \
161 $RPM_BUILD_ROOT%{l_prefix}/include/coss \
162 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
163 $RPM_BUILD_ROOT%{l_prefix}/var/mico \
164 $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
165 $RPM_BUILD_ROOT%{l_prefix}/man/man5 \
166 $RPM_BUILD_ROOT%{l_prefix}/man/man8
168 # install binaries, libraries, headers
169 %{l_make} %{l_mflags} install \
170 LDCONFIG=true \
171 INSTDIR=$RPM_BUILD_ROOT%{l_prefix} \
172 SHARED_INSTDIR=$RPM_BUILD_ROOT%{l_prefix}
174 # install our own things
175 %{l_shtool} install -c -m 755 %{l_value -s -a} \
176 %{SOURCE rc.mico} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
178 # cleanup installation files
179 rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc
180 rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/ministl
181 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mico-setup.*
182 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
183 ( cd $RPM_BUILD_ROOT%{l_prefix}/lib
184 for name in mico micoaux micocoss micoir; do
185 mv lib${name}%{version}.a lib${name}.a
186 done
187 %if "%{with_x11}" == "yes"
188 mv libmicox%{version}.a libmicox.a
189 %endif
190 %if "%{with_qt}" == "yes"
191 mv libmicoqt%{version}.a libmicoqt.a
192 %endif
193 %if "%{with_gtk}" == "yes"
194 mv libmicogtk%{version}.a libmicogtk.a
195 %endif
196 %if "%{with_tcl}" == "yes"
197 mv libmicotcl%{version}.a libmicotcl.a
198 %endif
199 ) || exit $?
201 # generate files listing
202 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
203 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mico'
205 %files -f files
207 %clean
208 rm -rf $RPM_BUILD_ROOT
210 %pre
211 # before upgrade, save status and stop service
212 [ $1 -eq 2 ] || exit 0
213 eval `%{l_rc} mico status 2>/dev/null | tee %{l_tmpfile}`
214 %{l_rc} mico stop 2>/dev/null
215 exit 0
217 %post
218 if [ $1 -eq 2 ]; then
219 # after upgrade, restore status
220 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
221 [ ".$mico_active" = .yes ] && %{l_rc} mico start
222 fi
223 exit 0
225 %preun
226 # before erase, stop service
227 [ $1 -eq 0 ] || exit 0
228 %{l_rc} mico stop 2>/dev/null
229 exit 0