8e103262d9f90b0c98f626ef68f1cd1e482a4156
[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 BuildRequires: wget
50 BuildRequires: cyrus-sasl-devel
51 BuildRequires: libgcrypt-devel
52 Packager: Adam Dickmeiss <adam@indexdata.dk>
53 URL: http://www.indexdata.com/yaz
54
55 %description
56 This package contains both a test-server and clients (normal & ssl)
57 for the ANSI/NISO Z39.50 protocol for Information Retrieval.
58
59 %package -n libyaz5
60 Summary: Z39.50 Library
61 Group: Libraries
62 Requires: libxslt, gnutls, libicu, libgcrypt
63
64 %description -n libyaz5
65 YAZ is a library for the ANSI/NISO Z39.50 protocol for Information
66 Retrieval.
67
68 %post -n libyaz5 -p /sbin/ldconfig 
69 %postun -n libyaz5 -p /sbin/ldconfig 
70
71 %package -n libyaz5-devel
72 Summary: Z39.50 Library - development package
73 Group: Development/Libraries
74 Requires: libyaz5 = %{version}, libxml2-devel, libxslt-devel, libicu-devel
75 Conflicts: libyaz-devel, libyaz4-devel
76
77 %description -n libyaz5-devel
78 Development libraries and includes for the libyaz package.
79
80 %package -n yaz-illclient
81 Summary: ILL client
82 Group: Applications/Communication
83 Requires: readline, libyaz5 = %{version}
84
85 %description -n yaz-illclient
86 yaz-illclient: an ISO ILL client.
87
88 %package -n yaz-icu
89 Summary: Command line utility for ICU utilities of YAZ
90 Group: Applications/Communication
91 Requires: libyaz5 = %{version}
92
93 %description -n yaz-icu
94 The yaz-icu program is a command-line based client which exposes the ICU
95 chain facility of YAZ.
96
97 %prep
98 %setup
99
100 wget -q http://ftp.indexdata.dk/pub/support/libmemcached-1.0.18.tar.gz
101 tar zxf libmemcached-1.0.18.tar.gz
102
103 %build
104
105 YD=`pwd`
106 cd libmemcached-1.0.18
107 ./configure --disable-shared --prefix=${YD}/libmemcached
108 make install
109 cd ..
110 PKG_CONFIG_PATH=${YD}/libmemcached/lib/pkgconfig CFLAGS="$RPM_OPT_FLAGS" \
111  ./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
112         --enable-shared --enable-tcpd --with-xslt --with-gnutls --with-icu
113 make CFLAGS="$RPM_OPT_FLAGS"
114
115 %install
116 rm -fr ${RPM_BUILD_ROOT}
117 make install DESTDIR=${RPM_BUILD_ROOT}
118 rm ${RPM_BUILD_ROOT}/%{_libdir}/*.la
119
120 %clean
121 rm -fr ${RPM_BUILD_ROOT}
122
123 %files
124 %defattr(-,root,root)
125 %doc README LICENSE NEWS
126 %{_bindir}/yaz-client
127 %{_bindir}/yaz-ztest
128 %{_bindir}/zoomsh
129 %{_bindir}/yaz-marcdump
130 %{_bindir}/yaz-iconv
131 %{_bindir}/yaz-json-parse
132 %{_bindir}/yaz-url
133 %{_mandir}/man1/yaz-client.*
134 %{_mandir}/man1/yaz-json-parse.*
135 %{_mandir}/man1/yaz-url.*
136 %{_mandir}/man8/yaz-ztest.*
137 %{_mandir}/man1/zoomsh.*
138 %{_mandir}/man1/yaz-marcdump.*
139 %{_mandir}/man1/yaz-iconv.*
140 %{_mandir}/man7/yaz-log.*
141 %{_mandir}/man7/bib1-attr.*
142
143 %files -n libyaz5
144 %defattr(-,root,root)
145 %{_libdir}/*.so.*
146
147 %files -n libyaz5-devel
148 %defattr(-,root,root)
149 %{_bindir}/yaz-config
150 %{_bindir}/yaz-asncomp
151 %{_includedir}/yaz
152 %{_libdir}/pkgconfig/yaz.pc
153 %{_libdir}/*.so
154 %{_libdir}/*.a
155 %{_datadir}/aclocal/yaz.m4
156 %{_mandir}/man1/yaz-asncomp.*
157 %{_mandir}/man7/yaz.*
158 %{_mandir}/man?/yaz-config.*
159 %{_datadir}/doc/yaz
160 %{_datadir}/yaz
161
162 %files -n yaz-illclient
163 %defattr(-,root,root)
164 %{_bindir}/yaz-illclient
165 %{_mandir}/man1/yaz-illclient.*
166
167 %files -n yaz-icu
168 %defattr(-,root,root)
169 %{_bindir}/yaz-icu
170 %{_mandir}/man1/yaz-icu.*