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