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