be7089b79e3484c33cf9ae640b4951e4d8b382bc
[idzebra-moved-to-github.git] / idzebra.spec
1 %define idmetaversion %(. ./IDMETA; echo $VERSION|tr -d '\n')
2 Name: idzebra
3 %define namev idzebra-2.0
4 Version: %{idmetaversion}
5 Release: 2indexdata
6 License: GPL
7 Vendor: Index Data ApS <info@indexdata.dk>
8 Source: idzebra-%{version}.tar.gz
9 BuildRoot: %{_tmppath}/idzebra-%{version}-root
10 Packager: Adam Dickmeiss <adam@indexdata.dk>
11 URL: http://www.indexdata.dk/zebra/
12 BuildRequires: libyaz4-devel >= 4.2.0
13 BuildRequires: expat-devel, bzip2-devel, tcl, zlib-devel
14 Summary: High-performance, structured text indexing and retrival engine.
15 Group: Applications/Databases
16 %description
17 Zebra is a high-performance, general-purpose structured text indexing
18 and retrieval engine. It reads structured records in a variety of input
19 formats (eg. email, XML, MARC) and allows access to them through exact
20 boolean search expressions and relevance-ranked free-text queries. 
21
22 %package -n %{namev}
23 Summary: High-performance, structured text indexing and retrival engine.
24 Group: Applications/Databases
25 Requires: lib%{namev}-modules = %{version}
26 %description -n %{namev}
27 Zebra is a high-performance, general-purpose structured text indexing
28 and retrieval engine. It reads structured records in a variety of input
29 formats (eg. email, XML, MARC) and allows access to them through exact
30 boolean search expressions and relevance-ranked free-text queries. 
31
32
33 %package -n lib%{namev}
34 Summary: Zebra libraries
35 Group: Libraries
36 Requires: libyaz4 bzip2-libs
37 %description -n lib%{namev}
38 Libraries for the Zebra search engine.
39
40 %package -n lib%{namev}-modules
41 Summary: Zebra modules
42 Group: Libraries
43 Requires: lib%{namev} = %{version} expat tcl
44 %description -n lib%{namev}-modules
45 Modules for the Zebra search engine.
46
47 %package -n lib%{namev}-devel
48 Summary: Zebra development libraries
49 Group: Development/Libraries
50 Requires: lib%{namev} = %{version} libyaz4-devel bzip2-devel 
51 %description -n lib%{namev}-devel
52 Development libraries for the Zebra search engine.
53
54 %prep
55 %setup
56
57 %build
58
59 CFLAGS="$RPM_OPT_FLAGS" \
60  ./configure --prefix=/usr --libdir=%{_libdir} --mandir=%{_mandir}\
61         --enable-shared --with-yaz=/usr/bin
62 make CFLAGS="$RPM_OPT_FLAGS"
63
64 %install
65 rm -fr ${RPM_BUILD_ROOT}
66 make prefix=${RPM_BUILD_ROOT}/usr mandir=${RPM_BUILD_ROOT}/%{_mandir} \
67         libdir=${RPM_BUILD_ROOT}/%{_libdir} install
68 rm ${RPM_BUILD_ROOT}/%{_libdir}/*.la
69 rm ${RPM_BUILD_ROOT}/%{_bindir}/zebraidx
70 rm ${RPM_BUILD_ROOT}/%{_mandir}/man1/zebraidx.*
71 rm ${RPM_BUILD_ROOT}/%{_bindir}/zebrasrv
72 rm ${RPM_BUILD_ROOT}/%{_mandir}/man8/zebrasrv.*
73 rm ${RPM_BUILD_ROOT}/%{_mandir}/man1/idzebra-config.*
74 mkdir -p ${RPM_BUILD_ROOT}/etc/idzebra
75 mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d
76 install -m755 rpm/zebrasrv.init ${RPM_BUILD_ROOT}/etc/rc.d/init.d/zebrasrv
77 mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
78 install -m644 rpm/zebrasrv.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/zebrasrv
79
80 %clean
81 rm -fr ${RPM_BUILD_ROOT}
82
83 %files -n %{namev}
84 %defattr(-,root,root)
85 %doc README LICENSE.zebra NEWS
86 %config /usr/share/idzebra-2.0/tab
87 %{_bindir}/zebrasrv-*
88 %{_bindir}/zebraidx-*
89 %{_bindir}/idzebra-abs2dom*
90 /usr/share/doc/idzebra-2.0
91 %{_mandir}/*/zebraidx-*
92 %{_mandir}/*/zebrasrv-*
93 %{_mandir}/*/idzebra-abs2dom*
94 /usr/share/idzebra-2.0-examples
95 %dir %{_sysconfdir}/idzebra
96 %config %{_sysconfdir}/rc.d/init.d/zebrasrv
97 %config(noreplace) /etc/logrotate.d/zebrasrv
98
99 %files -n lib%{namev}
100 %{_libdir}/*.so.*
101
102 %files -n lib%{namev}-modules
103 %{_libdir}/idzebra-2.0/modules/*
104
105 %files -n lib%{namev}-devel
106 %{_bindir}/idzebra-config-*
107 %{_includedir}/idzebra-2.0
108 %{_libdir}/*.so
109 %{_libdir}/*.a
110 %{_mandir}/*/idzebra-config-*
111 /usr/share/aclocal/*.m4
112
113 %post -n lib%{namev}
114 /sbin/ldconfig 
115 %postun -n lib%{namev}
116 /sbin/ldconfig 
117 %post -n %{namev}
118 if [ $1 = 1 ]; then
119         /sbin/chkconfig --add zebrasrv
120         /sbin/service zebrasrv start > /dev/null 2>&1
121 else
122         /sbin/service zebrasrv restart > /dev/null 2>&1
123 fi
124 %preun -n %{namev}
125 if [ $1 = 0 ]; then
126         /sbin/service zebrasrv stop > /dev/null 2>&1
127         /sbin/chkconfig --del zebrasrv
128 fi
129