Make unit test for imap modified utf7 optional
[libi2ncommon] / libi2ncommon.spec
1 %bcond_with Intra2net
2 %bcond_with xmllib
3 %bcond_with imap_utf7_support
4
5 # Detect Intra2net build environment
6 %if %{with Intra2net}
7     %define with_xmllib 1
8     %define with_imap_utf7_support 1
9 %endif
10
11 Summary:   library with functions common in Intra2net programs
12 Name:      libi2ncommon
13 Version:   ##VERSION##
14 Release:   1
15 License:   GPLv2 + linking exception
16 Group:     Intranator
17 Vendor:    Intra2net AG
18 Source:    %{name}-%{version}.tar.gz
19 Buildroot: /tmp/%{name}-%{version}-root
20 Prefix:    /usr/intranator
21 Requires:  libi2ncommon-utils = %{version}
22 BuildPrereq: libtool
23 BuildRequires: boost-devel >= 1.32.0
24 Obsoletes: libgettext
25
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
33 Requires:  libi2ncommon = %{version}
34 Requires: boost-devel >= 1.32.0
35
36
37 %description devel
38 library with functions common in Intra2net programs
39
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
51 %if %{with xmllib}
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.
59 %endif
60
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
69 %prep
70 %setup -q
71
72 %build
73 export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/intranator/lib/pkgconfig
74
75 mkdir build
76 cd build
77
78 export CFLAGS="$RPM_OPT_FLAGS"
79 export CXXFLAGS="$RPM_OPT_FLAGS"
80
81 CMAKE_OPTS=""
82 %if %{with xmllib}
83     CMAKE_OPTS="$CMAKE_OPTS -DBUILD_XMLLIB=ON"
84 %endif
85 %if %{with imap_utf7_support}
86     CMAKE_OPTS="$CMAKE_OPTS -DIMAP_UTF7_SUPPORT=ON"
87 %endif
88
89 cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" $CMAKE_OPTS ../
90
91 make %{?_smp_mflags} VERBOSE=1
92
93 %check
94 cd build
95 make check
96
97 %install
98
99 cd build
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)
110 %doc COPYING.GPL
111 %{prefix}/lib/libi2ncommon.so*
112
113 %files devel
114 %defattr(-,root,root)
115 # No static library for now
116 #%{prefix}/lib/*.*a*
117 %{prefix}/lib/pkgconfig/*.pc
118 %{prefix}/include/
119
120 %files config
121 %defattr(-,root,root)
122 %doc COPYING.GPL
123 %{prefix}/lib/libi2ncommon_config.so*
124
125 %if %{with xmllib}
126 %files xml
127 %defattr(-,root,root)
128 %doc COPYING.GPL
129 %{prefix}/lib/libi2ncommon_xml.so*
130 %endif
131
132 %files utils
133 %defattr(-,root,root)
134 %doc COPYING.GPL
135 %{prefix}/lib/libi2ncommon_utils.so*