Added checking for header files in order to get proper define directives in the confi...
[libasyncio] / libasyncio.spec.in
CommitLineData
6cb16c21
KK
1# @HAVE_LIBI2NCOMMON_TRUE@%define with_libi2ncommon 1
2# @HAVE_LIBI2NCOMMON_FALSE@%define with_libi2ncommon 0
3# @HAVE_LIBT2N_TRUE@%define with_libt2n 1
4# @HAVE_LIBT2N_FALSE@%define with_libt2n 0
5%define with_libi2ncommon 1
6%define with_libt2n 1
9ce4fe3f
RP
7
8Summary: library with asynchronous io functionality
9Name: libasyncio
10Version: @VERSION@
11Release: 1
12License: GPL version 2 + linking exception
13Group: Intranator
14Vendor: Intra2net AG
15Source: %{name}-%{version}.tar.gz
6cb16c21 16# Buildroot: /tmp/%{name}-%{version}-root
9ce4fe3f
RP
17Prefix: /usr
18Requires: libi2ncommon >= 1.0
6cb16c21 19Requires: boost >= 1.32.0
9ce4fe3f 20Requires: libasynio-utils = %{version}
6cb16c21 21# BuildRequires: libtool
9ce4fe3f
RP
22BuildRequires: boost-devel >= 1.32.0
23Obsoletes: libsimpleio
24
25%description
26library with asynchronous io functionality
27
28
29%package devel
30Summary: library with asynchronous io functionality
31Group: Intranator/Development
32Requires: libi2ncommon-devel
33Requires: boost-devel >= 1.32.0
34Obsoletes: libsimpleio-devel
35
36
37%description devel
38development files for library with asynchronous io functionality
39
40
41%package utils
42Summary: library with asynchronous io functionality
43Group: Intranator
6cb16c21 44%if %{with libi2ncommon}
9ce4fe3f
RP
45Requires: libi2ncommon >= 1.0
46%endif
6cb16c21 47Requires: boost >= 1.32.0
9ce4fe3f
RP
48
49%description utils
50A collection of util function and classes used within asyncio, but
51are also usable for other purposes, too.
52
53
54%package utils-devel
55Summary: library with asynchronous io functionality
56Group: Intranator/Development
f430a825 57Requires: boost-devel >= 1.32.0
9ce4fe3f
RP
58
59%description utils-devel
60development files for asyncio utils.
61
62
6cb16c21 63%if %{with libt2n}
9ce4fe3f
RP
64%package t2n
65Summary: glue library for using t2n with libasyncio
66Group: Intranator
67BuildRequires: libt2n-devel >= 0.4
68Requires: libt2n >= 0.4
69Obsoletes: libsimpleio-t2n
70
71%description t2n
72glue lib for using t2n with simpleio.
73
74
75%package t2n-devel
76Summary: glue library for using t2n with libasyncio
77Group: Intranator/Development
78Requires: libt2n-devel >= 0.4
79
80%description t2n-devel
81development files for glue lib for using t2n with simpleio.
82%endif
83
84
85
86%prep
87%setup -q
88
89%build
90export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/intranator/lib/pkgconfig
6cb16c21
KK
91# autoreconf --force -i
92# ./configure $RPM_BUILD_WITH_OPTIMIZE --prefix=%{prefix}
9ce4fe3f 93
6cb16c21
KK
94mkdir build
95cd build
96
97export CFLAGS="$RPM_OPT_FLAGS"
98export CXXFLAGS="$RPM_OPT_FLAGS"
99
100CMAKE_OPTS=""
101%if %{with libi2ncommon}
102 CMAKE_OPTS="$CMAKE_OPTS -DWITH_LIBI2NCOMMON=ON"
103%endif
104%if %{with libt2n}
105 CMAKE_OPTS="$CMAKE_OPTS -DWITH_LIBT2N=ON"
106%endif
107
108cmake -DCMAKE_INSTALL_PREFIX="%{prefix}" $CMAKE_OPTS ../
109
110dmake %{?_smp_mflags}
111
112# for dir in utils asyncio; do
113# make -C $dir headerlist
114# done
9ce4fe3f 115
436fb144 116export BOOST_TEST_LOG_LEVEL=test_suite
6cb16c21 117dmake check
9ce4fe3f
RP
118
119%install
6cb16c21 120cd build
9ce4fe3f
RP
121make DESTDIR=$RPM_BUILD_ROOT install
122
9a820dfd
TJ
123# Remove unpackaged files
124rm -f $RPM_BUILD_ROOT/usr/lib/libasyncio_utils.a
125rm -f $RPM_BUILD_ROOT/usr/lib/libasyncio_utils.la
126
9ce4fe3f
RP
127%clean
128rm -fr $RPM_BUILD_ROOT
129
130%post
131/sbin/ldconfig
132
133%files
134%defattr(-,root,root)
135%doc LICENSE COPYING.GPL
136%{prefix}/lib/libasyncio.so*
137
138%files devel -f headerlist.asyncio
139%defattr(-,root,root)
140%{prefix}/lib/libasyncio.*a*
141%{prefix}/lib/pkgconfig/libasyncio.pc
142
143
144%files utils
145%defattr(-,root,root)
146%{prefix}/lib/libasyncio_utils.so*
147
148
149%files utils-devel -f headerlist.utils
150%defattr(-,root,root)
151%{prefix}/lib/libasyncio.*a*
152%{prefix}/lib/pkgconfig/libasyncio_utils.pc
153
6cb16c21 154%if %{with libt2n}
9ce4fe3f
RP
155%files t2n
156%defattr(-,root,root)
157%doc LICENSE
158%{prefix}/lib/libasyncio_t2n.so*
159
160%files t2n-devel
161%defattr(-,root,root)
162%{prefix}/lib/libasyncio_t2n.*a*
163%{prefix}/lib/pkgconfig/libasyncio_t2n.pc
164%{prefix}/include/asyncio_t2n*.hpp
165%endif