Merge branch 'daemon-ext'
[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 %if %{with xmllib}
12     %define with_xmllib 1
13 %endif
14 %if %{with imap_utf7_support}
15     %define with_imap_utf7_support 1
16 %endif
17
18 Summary:   library with functions common in Intra2net programs
19 Name:      libi2ncommon
20 Version:   2.11
21 Release:   1
22 License:   GPLv2 + linking exception
23 Group:     Development/Libraries
24 Vendor:    Intra2net AG
25 Source:    %{name}-%{version}.tar.bz2
26 BuildRequires: boost-devel >= 1.32.0
27 BuildRequires: libtool openssl-devel
28
29 %if "%{with_imap_utf7_support}" == "1"
30 BuildRequires: libiconv
31 %endif
32
33 %description 
34 library with functions common in Intra2net programs
35
36 %package   devel
37 Summary:   library with functions common in Intra2net programs
38 Group:     Intra2net/Development
39 Requires:  libi2ncommon = %{version}
40 Requires: boost-devel >= 1.32.0
41
42
43 %description devel
44 library with functions common in Intra2net programs
45
46
47 %package config
48 Summary:    library with a config module
49 Group:      Intra2net
50 Requires:   libi2ncommon = %{version}
51
52 %description config
53 library with a config module.
54 The config module provides a global configuration system with decentralized
55 declaration of the config variables.
56
57 %if "%{with xmllib}" == "1"
58 %package xml
59 Summary:    library with a xml module
60 Group:      Intra2net
61 Requires:   libi2ncommon = %{version}
62 BuildRequires: libxml++-devel
63
64 %description xml
65 The xml module provides common xml functions.
66 %endif
67
68 %package utils
69 Summary:    library with open source utility modules
70 Group:      Intra2net
71 License:    GPL version 2 + linking exception
72
73 %description utils
74 Library with open source utility modules.
75
76 %prep
77 %setup -q
78
79 %build
80 mkdir build
81 cd build
82
83 export CFLAGS="$RPM_OPT_FLAGS"
84 export CXXFLAGS="$RPM_OPT_FLAGS"
85
86 CMAKE_OPTS=""
87 %if "%{with_xmllib}" == "1"
88     CMAKE_OPTS="$CMAKE_OPTS -DBUILD_XMLLIB=ON"
89 %endif
90 %if "%{with_imap_utf7_support}" == "1"
91     CMAKE_OPTS="$CMAKE_OPTS -DIMAP_UTF7_SUPPORT=ON"
92 %endif
93
94 cmake -DCMAKE_INSTALL_PREFIX="%{_prefix}" $CMAKE_OPTS ../
95
96 make %{?_smp_mflags} VERBOSE=1
97
98 %check
99 cd build
100 make check
101
102 %install
103
104 cd build
105 make DESTDIR=$RPM_BUILD_ROOT install
106
107 %clean
108 rm -fr $RPM_BUILD_ROOT
109
110 %post -p /sbin/ldconfig
111
112 %postun -p /sbin/ldconfig
113
114 %files
115 %defattr(-,root,root)
116 %doc COPYING.GPL Linking-Exception.txt
117 %{_libdir}/libi2ncommon.so*
118
119 %files devel
120 %defattr(-,root,root)
121 %{_libdir}/*.*a*
122 %{_libdir}/libi2ncommon.so
123 %{_libdir}/pkgconfig/*.pc
124 %{_includedir}/libi2ncommon/*
125
126 %files config
127 %defattr(-,root,root)
128 %doc COPYING.GPL Linking-Exception.txt
129 %{_libdir}/libi2ncommon_config.so*
130
131 %if "%{with xmllib}" == "1"
132 %files xml
133 %defattr(-,root,root)
134 %doc COPYING.GPL Linking-Exception.txt
135 %{_libdir}/libi2ncommon_xml.so*
136 %endif
137
138 %files utils
139 %defattr(-,root,root)
140 %doc COPYING.GPL Linking-Exception.txt
141 %{_libdir}/libi2ncommon_utils.so*