-
Notifications
You must be signed in to change notification settings - Fork 5
/
pazpar2.spec
148 lines (131 loc) · 4.14 KB
/
pazpar2.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
%define idmetaversion %(. ./IDMETA; echo $VERSION)
Name: pazpar2
Version: %{idmetaversion}
Release: 1.indexdata
License: GPL
Group: Applications/Internet
Vendor: Index Data ApS <[email protected]>
Source: pazpar2-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: libyaz5-devel >= 5.18.0
BuildRequires: pkgconfig
Packager: Adam Dickmeiss <[email protected]>
URL: http://www.indexdata.com/pazpar2
Summary: pazpar2 daemon
Requires: libyaz5 >= 5.29.0
Requires: pazpar2-xsl
%description
Pazpar2 is a high-performance, user interface-independent, data
model-independent metasearching middleware featuring merging, relevance
ranking, record sorting, and faceted results.
%package -n pazpar2-js
Summary: pazpar2 JS
Group: Data
Requires: pazpar2
%post
for f in /usr/share/pazpar2/xsl/*.xsl; do
e=/etc/pazpar2/`basename $f`
if test -f $e; then
if diff $e $f >/dev/null; then
rm $e
fi
fi
done
if [ $1 = 1 ]; then
/sbin/chkconfig --add pazpar2
/sbin/service pazpar2 start > /dev/null 2>&1
else
/sbin/service pazpar2 restart > /dev/null 2>&1
fi
%preun
if [ $1 = 0 ]; then
/sbin/service pazpar2 stop > /dev/null 2>&1
/sbin/chkconfig --del pazpar2
fi
%description -n pazpar2-js
This package includes the Java Script library pz2.js. It also adds an
Alias for Apache2 so that this library and other demo portals are
available.
%posttrans -n pazpar2-js
if [ -d /etc/httpd/conf.d ]; then
ln -sf /etc/pazpar2/ap2pazpar2-js.cfg /etc/httpd/conf.d/pazpar2-js.conf
fi
%preun -n pazpar2-js
if [ $1 = 0 ]; then
if [ -L /etc/httpd/conf.d/pazpar2-js.conf ]; then
rm /etc/httpd/conf.d/pazpar2-js.conf
fi
fi
%package -n pazpar2-xsl
Summary: XSLTs for converting to pz2 format
Group: Data
%description -n pazpar2-xsl
This package includes XSLTs for converting from various input XML formats
to Pazpar2's internal XML format.
%package -n pazpar2-doc
Summary: pazpar2 documentation
Group: Data
%description -n pazpar2-doc
This package includes documentation for Pazpar2 - the metasearcher.
%prep
%setup
%build
CFLAGS="$RPM_OPT_FLAGS" \
./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
--with-yaz=pkg
%if %{?make_build:1}%{!?make_build:0}
%make_build
%else
make -j4 CFLAGS="$RPM_OPT_FLAGS"
%endif
%install
rm -fr ${RPM_BUILD_ROOT}
make install DESTDIR=${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}/etc/pazpar2
mkdir -p ${RPM_BUILD_ROOT}/etc/pazpar2/settings
mkdir -p ${RPM_BUILD_ROOT}/etc/pazpar2/services-enabled
mkdir -p ${RPM_BUILD_ROOT}/etc/pazpar2/services-available
cp etc/server.xml ${RPM_BUILD_ROOT}/etc/pazpar2/
cp etc/default.xml ${RPM_BUILD_ROOT}/etc/pazpar2/services-available/
cp etc/services/*.xml ${RPM_BUILD_ROOT}/etc/pazpar2/services-available/
cp etc/settings/*.xml ${RPM_BUILD_ROOT}/etc/pazpar2/settings/
cp -r etc/settings/mkc ${RPM_BUILD_ROOT}/etc/pazpar2/settings
mkdir -p ${RPM_BUILD_ROOT}/usr/share/pazpar2/xsl
cp etc/xsl/*.xsl ${RPM_BUILD_ROOT}/usr/share/pazpar2/xsl
mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d
install -m755 rpm/pazpar2.init ${RPM_BUILD_ROOT}/etc/rc.d/init.d/pazpar2
echo "Alias /pazpar2 /usr/share/pazpar2" >${RPM_BUILD_ROOT}/etc/pazpar2/ap2pazpar2-js.cfg
mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
install -m644 rpm/pazpar2.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/pazpar2
%clean
rm -fr ${RPM_BUILD_ROOT}
%files
%defattr(-,root,root)
%doc README.md LICENSE NEWS
%{_sbindir}/pazpar2
%{_bindir}/pazpar2_play
%dir %{_sysconfdir}/pazpar2
%dir %{_sysconfdir}/pazpar2/settings
%dir %{_sysconfdir}/pazpar2/settings/mkc
%dir %{_sysconfdir}/pazpar2/services-enabled
%dir %{_sysconfdir}/pazpar2/services-available
%config %{_sysconfdir}/pazpar2/*.xml
%config %{_sysconfdir}/pazpar2/settings/*.xml
%config %{_sysconfdir}/pazpar2/settings/*/*.xml
%config %{_sysconfdir}/pazpar2/services-available/*.xml
%config %{_sysconfdir}/rc.d/init.d/pazpar2
%config(noreplace) /etc/logrotate.d/pazpar2
%{_mandir}/man1/pazpar2*
%{_mandir}/man5/pazpar2*
%{_mandir}/man7/pazpar2*
%{_mandir}/man8/pazpar2*
%files -n pazpar2-js
%defattr(-,root,root)
%{_datadir}/pazpar2/js/pz2.js
%config %{_sysconfdir}/pazpar2/ap2pazpar2-js.cfg
%files -n pazpar2-xsl
%defattr(-,root,root)
%{_datadir}/pazpar2/xsl
%files -n pazpar2-doc
%defattr(-,root,root)
%{_defaultdocdir}/pazpar2