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