make message catalogs before installing them
[wxWidgets.git] / wxBase.spec
1 %define pref /usr
2 %define ver 2.7.0
3 %define ver2 2.7
4 %define rel 1
5
6 # Configurable settings (use --with(out) unicode on rpmbuild command line):
7 %define unicode 0
8 %{?_with_unicode: %{expand: %%define unicode 1}}
9 %{?_without_unicode: %{expand: %%define unicode 0}}
10
11 %if %{unicode}
12 %define name wx-base-unicode
13 %define wxconfig base-unicode-release-%{ver2}
14 %define wxconfiglink wxbaseu-%{ver2}-config
15 %else
16 %define name wx-base
17 %define wxconfig base-ansi-release-%{ver2}
18 %define wxconfiglink wxbase-%{ver2}-config
19 %endif
20
21 Summary: wxBase library - non-GUI support classes of wxWidgets toolkit
22 Name: %{name}
23 Version: %{ver}
24 Release: %{rel}
25 License: wxWindows Licence
26 Group: Development/Libraries
27 Source: wxBase-%{ver}.tar.bz2
28 URL: http://www.wxwidgets.org
29 Packager: Vadim Zeitlin <vadim@wxwindows.org>
30 Prefix: %{pref}
31 BuildRoot: %{_tmppath}/%{name}-root
32 Provides: wxBase
33
34 %description
35 wxBase is a collection of C++ classes providing basic data structures (strings,
36 lists, arrays), powerful wxDateTime class for date manipulations, portable
37 wrappers around many OS-specific functions allowing to build the same program
38 under all supported folders, wxThread class for writing multithreaded programs
39 using either Win32 or POSIX threads and much more. wxBase currently supports
40 the following platforms: Win32, generic Unix (Linux, FreeBSD, Solaris, HP-UX,
41 ...) and BeOS.
42
43 %package devel
44 Summary: wxBase headers needed for developping with wxBase
45 Group: Development/Libraries
46 Requires: %{name} = %{ver}
47 Provides: wxBase-devel
48
49 %description devel
50 Header files for wxBase. You need them to develop programs using wxBase.
51
52 %package static
53 Summary: wxBase static libraries
54 Group: Development/Libraries
55 Requires: %{name}-devel = %{ver}
56
57 %description static
58 Static libraries for wxBase. You need them if you want to link statically against wxBase.
59
60 %prep
61 %setup -q -n wxBase-%{ver}
62
63 %build
64 if [ "$SMP" != "" ]; then
65 export MAKE="make -j$SMP"
66 else
67 export MAKE="make"
68 fi
69
70 mkdir obj-shared
71 cd obj-shared
72 ../configure --prefix=%{pref} --disable-gui \
73 %if %{unicode}
74 --enable-unicode
75 %else
76 --with-odbc
77 %endif
78 $MAKE
79 cd ..
80
81 mkdir obj-static
82 cd obj-static
83 ../configure --prefix=%{pref} --disable-gui --disable-shared \
84 %if %{unicode}
85 --enable-unicode
86 %else
87 --with-odbc
88 %endif
89 $MAKE
90 cd ..
91
92 %install
93 rm -rf $RPM_BUILD_ROOT
94 make -C locale allmo
95 make -C obj-static DESTDIR=$RPM_BUILD_ROOT prefix=%{pref} install
96 make -C obj-shared DESTDIR=$RPM_BUILD_ROOT prefix=%{pref} install
97
98 %find_lang wxstd
99
100 %clean
101 rm -rf $RPM_BUILD_ROOT
102
103 %post
104 /sbin/ldconfig
105
106 %postun
107 /sbin/ldconfig
108
109 %post devel
110 # link wx-config when you install RPM.
111 ln -sf %{_libdir}/wx/config/%{wxconfig} %{_bindir}/wx-config
112 # link wx-config with explicit name.
113 ln -sf %{_libdir}/wx/config/%{wxconfig} %{_bindir}/%{wxconfiglink}
114 /sbin/ldconfig
115
116 %postun devel
117 /sbin/ldconfig
118
119 %preun devel
120 if test -f %{_bindir}/wx-config -a -f /usr/bin/md5sum ; then
121 SUM1=`md5sum %{_libdir}/wx/config/%{wxconfig} | cut -c 0-32`
122 SUM2=`md5sum %{_bindir}/wx-config | cut -c 0-32`
123 if test "x$SUM1" = "x$SUM2" ; then
124 rm -f %{_bindir}/wx-config
125 fi
126 fi
127 rm -f %{_bindir}/%{wxconfiglink}
128
129 %files -f wxstd.lang
130 %defattr (-,root,root)
131 %doc COPYING.LIB *.txt
132 %{_libdir}/libwx_base*-%{ver2}.so.*
133
134 %files devel
135 %defattr (-,root,root)
136 %{_bindir}/wx-config
137 %dir %{_includedir}/wx-%{ver2}
138 %{_includedir}/wx-%{ver2}/*
139 %{_libdir}/libwx_base*-%{ver2}.so
140 %dir %{_libdir}/wx
141 %{_libdir}/wx/*
142 %{_datadir}/aclocal/*.m4
143 %{_datadir}/bakefile/presets/*
144 %{_datadir}/locale/*/LC_MESSAGES/*.mo
145
146 %files static
147 %defattr (-,root,root)
148 %{_libdir}/lib*.a