Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/idzebra
[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.com/zebra
12 BuildRequires: libyaz5-devel >= 5.0.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: libyaz5 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} libyaz5-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 install DESTDIR=${RPM_BUILD_ROOT}
67 rm ${RPM_BUILD_ROOT}/%{_libdir}/*.la
68 rm ${RPM_BUILD_ROOT}/%{_bindir}/zebraidx
69 rm ${RPM_BUILD_ROOT}/%{_mandir}/man1/zebraidx.*
70 rm ${RPM_BUILD_ROOT}/%{_bindir}/zebrasrv
71 rm ${RPM_BUILD_ROOT}/%{_mandir}/man8/zebrasrv.*
72 rm ${RPM_BUILD_ROOT}/%{_mandir}/man1/idzebra-config.*
73 mkdir -p ${RPM_BUILD_ROOT}/etc/idzebra
74 mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d
75 install -m755 rpm/zebrasrv.init ${RPM_BUILD_ROOT}/etc/rc.d/init.d/zebrasrv
76 mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
77 install -m644 rpm/zebrasrv.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/zebrasrv
78
79 %clean
80 rm -fr ${RPM_BUILD_ROOT}
81
82 %files -n %{namev}
83 %defattr(-,root,root)
84 %doc README LICENSE.zebra NEWS
85 %config /usr/share/idzebra-2.0/tab
86 %{_bindir}/zebrasrv-*
87 %{_bindir}/zebraidx-*
88 %{_bindir}/idzebra-abs2dom*
89 /usr/share/doc/idzebra-2.0
90 %{_mandir}/*/zebraidx-*
91 %{_mandir}/*/zebrasrv-*
92 %{_mandir}/*/idzebra-abs2dom*
93 /usr/share/idzebra-2.0-examples
94 %dir %{_sysconfdir}/idzebra
95 %config %{_sysconfdir}/rc.d/init.d/zebrasrv
96 %config(noreplace) /etc/logrotate.d/zebrasrv
97
98 %files -n lib%{namev}
99 %{_libdir}/*.so.*
100
101 %files -n lib%{namev}-modules
102 %{_libdir}/idzebra-2.0/modules/*
103
104 %files -n lib%{namev}-devel
105 %{_bindir}/idzebra-config-*
106 %{_includedir}/idzebra-2.0
107 %{_libdir}/*.so
108 %{_libdir}/*.a
109 %{_mandir}/*/idzebra-config-*
110 /usr/share/aclocal/*.m4
111
112 %post -n lib%{namev}
113 /sbin/ldconfig 
114 %postun -n lib%{namev}
115 /sbin/ldconfig 
116 %post -n %{namev}
117 if [ $1 = 1 ]; then
118         /sbin/chkconfig --add zebrasrv
119         /sbin/service zebrasrv start > /dev/null 2>&1
120 else
121         /sbin/service zebrasrv restart > /dev/null 2>&1
122 fi
123 %preun -n %{namev}
124 if [ $1 = 0 ]; then
125         /sbin/service zebrasrv stop > /dev/null 2>&1
126         /sbin/chkconfig --del zebrasrv
127 fi
128