configure: only consider hiredis if libgcrypt is also present
[yaz-moved-to-github.git] / yaz.spec
1 # This file is part of the YAZ toolkit
2 # Copyright (C) Index Data
3 # See the file LICENSE for details.
4 #
5 # spec file for YAZ
6
7 %define idmetaversion %(. ./IDMETA; echo $VERSION|tr -d '\n')
8 Name: yaz
9 Summary: Z39.50 Programs
10 Version: %{idmetaversion}
11 Release: 4.redis
12
13 # determine system
14 %define is_mandrake %(test -e /etc/mandrake-release && echo 1 || echo 0)
15 %define is_suse %(test -e /etc/SuSE-release >/dev/null && echo 1 || echo 0)
16 %define is_suse11 %(grep 'VERSION = 11' /etc/SuSE-release >/dev/null 2>&1 && echo 1 || echo 0)
17 %define is_fedora %(test -e /etc/fedora-release && echo 1 || echo 0)
18 Requires: libxslt, gnutls, readline, libyaz5 = %{version}
19 Requires: hiredis
20 License: BSD
21 Group: Applications/Internet
22 Vendor: Index Data ApS <info@indexdata.dk>
23 Source: yaz-%{version}.tar.gz
24 BuildRoot: %{_tmppath}/%{name}-%{version}-root
25 Prefix: %{_prefix}
26
27 %define TCPWRAPPER tcp_wrappers
28
29 %if %is_fedora
30 %define TCPWRAPPER tcp_wrappers-devel
31 %endif
32
33 %if %is_suse
34 %define TCPWRAPPER tcpd-devel
35 %endif
36
37 BuildRequires: %{TCPWRAPPER}
38
39 %if %is_suse11
40 BuildRequires: libgnutls-devel
41 %else
42 BuildRequires: gnutls-devel
43 %endif
44
45 BuildRequires: pkgconfig
46 BuildRequires: libxml2-devel
47 BuildRequires: libxslt-devel
48 BuildRequires: readline-devel
49 BuildRequires: libicu-devel
50 BuildRequires: wget
51 BuildRequires: libgcrypt-devel
52 BuildRequires: hiredis-devel
53 Packager: Adam Dickmeiss <adam@indexdata.dk>
54 URL: http://www.indexdata.com/yaz
55
56 %description
57 This package contains both a test-server and clients (normal & ssl)
58 for the ANSI/NISO Z39.50 protocol for Information Retrieval.
59
60 %package -n libyaz5
61 Summary: Z39.50 Library
62 Group: Libraries
63 Requires: libxslt, gnutls, libicu, libgcrypt
64
65 %description -n libyaz5
66 YAZ is a library for the ANSI/NISO Z39.50 protocol for Information
67 Retrieval.
68
69 %post -n libyaz5 -p /sbin/ldconfig 
70 %postun -n libyaz5 -p /sbin/ldconfig 
71
72 %package -n libyaz5-devel
73 Summary: Z39.50 Library - development package
74 Group: Development/Libraries
75 Requires: libyaz5 = %{version}, libxml2-devel, libxslt-devel, libicu-devel
76 Conflicts: libyaz-devel, libyaz4-devel
77
78 %description -n libyaz5-devel
79 Development libraries and includes for the libyaz package.
80
81 %package -n yaz-illclient
82 Summary: ILL client
83 Group: Applications/Communication
84 Requires: readline, libyaz5 = %{version}
85
86 %description -n yaz-illclient
87 yaz-illclient: an ISO ILL client.
88
89 %package -n yaz-icu
90 Summary: Command line utility for ICU utilities of YAZ
91 Group: Applications/Communication
92 Requires: libyaz5 = %{version}
93
94 %description -n yaz-icu
95 The yaz-icu program is a command-line based client which exposes the ICU
96 chain facility of YAZ.
97
98 %prep
99 %setup
100
101 %build
102
103 CFLAGS="$RPM_OPT_FLAGS" \
104  ./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
105         --enable-shared --enable-tcpd --with-xslt --with-gnutls --with-icu \
106         --without-memcached --with-redis
107 make CFLAGS="$RPM_OPT_FLAGS"
108
109 %install
110 rm -fr ${RPM_BUILD_ROOT}
111 make install DESTDIR=${RPM_BUILD_ROOT}
112 rm ${RPM_BUILD_ROOT}/%{_libdir}/*.la
113
114 %clean
115 rm -fr ${RPM_BUILD_ROOT}
116
117 %files
118 %defattr(-,root,root)
119 %doc README LICENSE NEWS
120 %{_bindir}/yaz-client
121 %{_bindir}/yaz-ztest
122 %{_bindir}/zoomsh
123 %{_bindir}/yaz-marcdump
124 %{_bindir}/yaz-iconv
125 %{_bindir}/yaz-json-parse
126 %{_bindir}/yaz-url
127 %{_mandir}/man1/yaz-client.*
128 %{_mandir}/man1/yaz-json-parse.*
129 %{_mandir}/man1/yaz-url.*
130 %{_mandir}/man8/yaz-ztest.*
131 %{_mandir}/man1/zoomsh.*
132 %{_mandir}/man1/yaz-marcdump.*
133 %{_mandir}/man1/yaz-iconv.*
134 %{_mandir}/man7/yaz-log.*
135 %{_mandir}/man7/bib1-attr.*
136
137 %files -n libyaz5
138 %defattr(-,root,root)
139 %{_libdir}/*.so.*
140
141 %files -n libyaz5-devel
142 %defattr(-,root,root)
143 %{_bindir}/yaz-config
144 %{_bindir}/yaz-asncomp
145 %{_includedir}/yaz
146 %{_libdir}/pkgconfig/yaz.pc
147 %{_libdir}/*.so
148 %{_libdir}/*.a
149 %{_datadir}/aclocal/yaz.m4
150 %{_mandir}/man1/yaz-asncomp.*
151 %{_mandir}/man7/yaz.*
152 %{_mandir}/man?/yaz-config.*
153 %{_datadir}/doc/yaz
154 %{_datadir}/yaz
155
156 %files -n yaz-illclient
157 %defattr(-,root,root)
158 %{_bindir}/yaz-illclient
159 %{_mandir}/man1/yaz-illclient.*
160
161 %files -n yaz-icu
162 %defattr(-,root,root)
163 %{_bindir}/yaz-icu
164 %{_mandir}/man1/yaz-icu.*