Build documentation optionally
[libi2ncommon] / libi2ncommon.spec
CommitLineData
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
11Summary: library with functions common in Intra2net programs
12Name: libi2ncommon
13Version: ##VERSION##
b599d4b1 14Release: 1
0e23f538 15License: GPLv2 + linking exception
e93545dd
GE
16Group: Intranator
17Vendor: Intra2net AG
18Source: %{name}-%{version}.tar.gz
19Buildroot: /tmp/%{name}-%{version}-root
20Prefix: /usr/intranator
5ff2acd9 21Requires: libi2ncommon-utils = %{version}
e93545dd 22BuildPrereq: libtool
5ff2acd9 23BuildRequires: boost-devel >= 1.32.0
bb5b934a 24Obsoletes: libgettext
16c2256f 25
e93545dd
GE
26
27%description
28library with functions common in Intra2net programs
29
30%package devel
31Summary: library with functions common in Intra2net programs
32Group: Intranator/Development
5ff2acd9 33Requires: libi2ncommon = %{version}
16c2256f
RP
34Requires: boost-devel >= 1.32.0
35
e93545dd
GE
36
37%description devel
38library with functions common in Intra2net programs
39
23d53eb1
RP
40
41%package config
42Summary: library with a config module
43Group: Intranator
44Requires: libi2ncommon = %{version}
45
46%description config
47library with a config module.
48The config module provides a global configuration system with decentralized
49declaration of the config variables.
50
80156cdf 51%if %{with xmllib}
ce6792dd
TJ
52%package xml
53Summary: library with a xml module
54Group: Intranator
55Requires: libi2ncommon = %{version}
56
57%description xml
58The xml module provides common xml functions.
80156cdf 59%endif
23d53eb1 60
f3311b30
TJ
61%package utils
62Summary: library with open source utility modules
63Group: Intranator
64License: GPL version 2 + linking exception
65
66%description utils
67Library with open source utility modules.
68
e93545dd
GE
69%prep
70%setup -q
71
72%build
73export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/intranator/lib/pkgconfig
e93545dd 74
263b5807
TJ
75mkdir build
76cd build
77
78export CFLAGS="$RPM_OPT_FLAGS"
79export CXXFLAGS="$RPM_OPT_FLAGS"
80156cdf
TJ
80
81CMAKE_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
89cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" $CMAKE_OPTS ../
263b5807
TJ
90
91make %{?_smp_mflags} VERBOSE=1
92
93%check
94cd build
95make check
e93545dd
GE
96
97%install
263b5807
TJ
98
99cd build
e93545dd
GE
100make DESTDIR=$RPM_BUILD_ROOT install
101
102%clean
103rm -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*