Commit | Line | Data |
---|---|---|
80156cdf TJ |
1 | %bcond_with Intra2net |
2 | %bcond_with xmllib | |
652f47a7 | 3 | %bcond_with imap_utf7_support |
80156cdf TJ |
4 | |
5 | # Detect Intra2net build environment | |
6 | %if %{with Intra2net} | |
7 | %define with_xmllib 1 | |
652f47a7 | 8 | %define with_imap_utf7_support 1 |
80156cdf TJ |
9 | %endif |
10 | ||
e93545dd GE |
11 | Summary: library with functions common in Intra2net programs |
12 | Name: libi2ncommon | |
13 | Version: ##VERSION## | |
b599d4b1 | 14 | Release: 1 |
0e23f538 | 15 | License: GPLv2 + linking exception |
e93545dd GE |
16 | Group: Intranator |
17 | Vendor: Intra2net AG | |
18 | Source: %{name}-%{version}.tar.gz | |
19 | Buildroot: /tmp/%{name}-%{version}-root | |
20 | Prefix: /usr/intranator | |
5ff2acd9 | 21 | Requires: libi2ncommon-utils = %{version} |
e93545dd | 22 | BuildPrereq: libtool |
5ff2acd9 | 23 | BuildRequires: boost-devel >= 1.32.0 |
bb5b934a | 24 | Obsoletes: libgettext |
16c2256f | 25 | |
e93545dd GE |
26 | |
27 | %description | |
28 | library with functions common in Intra2net programs | |
29 | ||
30 | %package devel | |
31 | Summary: library with functions common in Intra2net programs | |
32 | Group: Intranator/Development | |
5ff2acd9 | 33 | Requires: libi2ncommon = %{version} |
16c2256f RP |
34 | Requires: boost-devel >= 1.32.0 |
35 | ||
e93545dd GE |
36 | |
37 | %description devel | |
38 | library with functions common in Intra2net programs | |
39 | ||
23d53eb1 RP |
40 | |
41 | %package config | |
42 | Summary: library with a config module | |
43 | Group: Intranator | |
44 | Requires: libi2ncommon = %{version} | |
45 | ||
46 | %description config | |
47 | library with a config module. | |
48 | The config module provides a global configuration system with decentralized | |
49 | declaration of the config variables. | |
50 | ||
80156cdf | 51 | %if %{with xmllib} |
ce6792dd TJ |
52 | %package xml |
53 | Summary: library with a xml module | |
54 | Group: Intranator | |
55 | Requires: libi2ncommon = %{version} | |
56 | ||
57 | %description xml | |
58 | The xml module provides common xml functions. | |
80156cdf | 59 | %endif |
23d53eb1 | 60 | |
f3311b30 TJ |
61 | %package utils |
62 | Summary: library with open source utility modules | |
63 | Group: Intranator | |
64 | License: GPL version 2 + linking exception | |
65 | ||
66 | %description utils | |
67 | Library with open source utility modules. | |
68 | ||
e93545dd GE |
69 | %prep |
70 | %setup -q | |
71 | ||
72 | %build | |
73 | export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/intranator/lib/pkgconfig | |
e93545dd | 74 | |
263b5807 TJ |
75 | mkdir build |
76 | cd build | |
77 | ||
78 | export CFLAGS="$RPM_OPT_FLAGS" | |
79 | export CXXFLAGS="$RPM_OPT_FLAGS" | |
80156cdf TJ |
80 | |
81 | CMAKE_OPTS="" | |
82 | %if %{with xmllib} | |
83 | CMAKE_OPTS="$CMAKE_OPTS -DBUILD_XMLLIB=ON" | |
84 | %endif | |
652f47a7 TJ |
85 | %if %{with imap_utf7_support} |
86 | CMAKE_OPTS="$CMAKE_OPTS -DIMAP_UTF7_SUPPORT=ON" | |
87 | %endif | |
80156cdf TJ |
88 | |
89 | cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" $CMAKE_OPTS ../ | |
263b5807 TJ |
90 | |
91 | make %{?_smp_mflags} VERBOSE=1 | |
92 | ||
93 | %check | |
94 | cd build | |
95 | make check | |
e93545dd GE |
96 | |
97 | %install | |
263b5807 TJ |
98 | |
99 | cd build | |
e93545dd GE |
100 | make DESTDIR=$RPM_BUILD_ROOT install |
101 | ||
102 | %clean | |
103 | rm -fr $RPM_BUILD_ROOT | |
104 | ||
105 | %post | |
106 | /sbin/ldconfig | |
107 | ||
108 | %files | |
109 | %defattr(-,root,root) | |
0e23f538 | 110 | %doc COPYING.GPL |
e93545dd GE |
111 | %{prefix}/lib/libi2ncommon.so* |
112 | ||
113 | %files devel | |
114 | %defattr(-,root,root) | |
263b5807 TJ |
115 | # No static library for now |
116 | #%{prefix}/lib/*.*a* | |
e93545dd GE |
117 | %{prefix}/lib/pkgconfig/*.pc |
118 | %{prefix}/include/ | |
23d53eb1 RP |
119 | |
120 | %files config | |
121 | %defattr(-,root,root) | |
0e23f538 | 122 | %doc COPYING.GPL |
23d53eb1 RP |
123 | %{prefix}/lib/libi2ncommon_config.so* |
124 | ||
80156cdf | 125 | %if %{with xmllib} |
ce6792dd TJ |
126 | %files xml |
127 | %defattr(-,root,root) | |
0e23f538 | 128 | %doc COPYING.GPL |
ce6792dd | 129 | %{prefix}/lib/libi2ncommon_xml.so* |
80156cdf | 130 | %endif |
f3311b30 TJ |
131 | |
132 | %files utils | |
133 | %defattr(-,root,root) | |
0e23f538 | 134 | %doc COPYING.GPL |
f3311b30 | 135 | %{prefix}/lib/libi2ncommon_utils.so* |