|
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 ## |
|
23 |
|
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.12 |
|
35 Release: 20080101 |
|
36 |
|
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 |
|
43 |
|
44 # list of sources |
|
45 Source0: http://www.mico.org/mico-%{version}.tar.gz |
|
46 Source2: rc.mico |
|
47 |
|
48 # build information |
|
49 Prefix: %{l_prefix} |
|
50 BuildRoot: %{l_buildroot} |
|
51 BuildPreReq: OpenPKG, openpkg >= 20060823, gcc, make |
|
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, pkgconfig |
|
63 PreReq: qt |
|
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 |
|
75 |
|
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 |
|
87 |
|
88 %track |
|
89 prog mico = { |
|
90 version = %{version} |
|
91 url = http://www.mico.org/down.html |
|
92 regex = mico-(__VER__)\.tar\.gz |
|
93 } |
|
94 |
|
95 %prep |
|
96 %setup -q -n mico |
|
97 |
|
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} |
|
152 |
|
153 %install |
|
154 rm -rf $RPM_BUILD_ROOT |
|
155 |
|
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 |
|
167 |
|
168 # install binaries, libraries, headers |
|
169 %{l_make} %{l_mflags} install \ |
|
170 INSTDIR=$RPM_BUILD_ROOT%{l_prefix} \ |
|
171 SHARED_INSTDIR=$RPM_BUILD_ROOT%{l_prefix} |
|
172 |
|
173 # install our own things |
|
174 %{l_shtool} install -c -m 755 %{l_value -s -a} \ |
|
175 %{SOURCE rc.mico} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
|
176 |
|
177 # cleanup installation files |
|
178 rm -rf $RPM_BUILD_ROOT%{l_prefix}/doc |
|
179 rm -rf $RPM_BUILD_ROOT%{l_prefix}/include/ministl |
|
180 rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/mico-setup.* |
|
181 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true |
|
182 mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/nsd.8 \ |
|
183 $RPM_BUILD_ROOT%{l_prefix}/man/man8/mico-nsd.8 |
|
184 ( cd $RPM_BUILD_ROOT%{l_prefix}/lib |
|
185 for name in mico micoaux micocoss micoir; do |
|
186 mv lib${name}%{version}.a lib${name}.a |
|
187 done |
|
188 %if "%{with_x11}" == "yes" |
|
189 mv libmicox%{version}.a libmicox.a |
|
190 %endif |
|
191 %if "%{with_qt}" == "yes" |
|
192 mv libmicoqt%{version}.a libmicoqt.a |
|
193 %endif |
|
194 %if "%{with_gtk}" == "yes" |
|
195 mv libmicogtk%{version}.a libmicogtk.a |
|
196 %endif |
|
197 %if "%{with_tcl}" == "yes" |
|
198 mv libmicotcl%{version}.a libmicotcl.a |
|
199 %endif |
|
200 ) || exit $? |
|
201 |
|
202 # generate files listing |
|
203 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ |
|
204 '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/mico' |
|
205 |
|
206 %files -f files |
|
207 |
|
208 %clean |
|
209 rm -rf $RPM_BUILD_ROOT |
|
210 |
|
211 %pre |
|
212 # before upgrade, save status and stop service |
|
213 [ $1 -eq 2 ] || exit 0 |
|
214 eval `%{l_rc} mico status 2>/dev/null | tee %{l_tmpfile}` |
|
215 %{l_rc} mico stop 2>/dev/null |
|
216 exit 0 |
|
217 |
|
218 %post |
|
219 if [ $1 -eq 2 ]; then |
|
220 # after upgrade, restore status |
|
221 eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} |
|
222 [ ".$mico_active" = .yes ] && %{l_rc} mico start |
|
223 fi |
|
224 exit 0 |
|
225 |
|
226 %preun |
|
227 # before erase, stop service |
|
228 [ $1 -eq 0 ] || exit 0 |
|
229 %{l_rc} mico stop 2>/dev/null |
|
230 exit 0 |
|
231 |