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