Remove boilerplate stuff from copyright
[pazpar2-moved-to-github.git] / pazpar2.spec
1 %define idmetaversion %(. ./IDMETA; echo $VERSION|tr -d '\n')
2 Summary: Metasearcher
3 Name: pazpar2
4 Version: %{idmetaversion}
5 Release: 1indexdata
6 License: GPL
7 Group: Applications/Internet
8 Vendor: Index Data ApS <info@indexdata.dk>
9 Source: pazpar2-%{version}.tar.gz
10 BuildRoot: %{_tmppath}/%{name}-%{version}-root
11 BuildRequires: libyaz4-devel >= 4.2.40
12 Packager: Adam Dickmeiss <adam@indexdata.dk>
13 URL: http://www.indexdata.com/pazpar2
14 Summary: pazpar2 daemon
15 Requires: libyaz4 >= 4.2.40
16
17 %description
18 Pazpar2 is a high-performance, user interface-independent, data
19 model-independent metasearching middleware featuring merging, relevance
20 ranking, record sorting, and faceted results.
21
22 %package -n pazpar2-js
23 Summary: pazpar2 JS
24 Group: Data
25 Requires: pazpar2
26
27 %post
28 if [ $1 = 1 ]; then
29         /sbin/chkconfig --add pazpar2
30         /sbin/service pazpar2 start > /dev/null 2>&1
31 else
32         /sbin/service pazpar2 restart > /dev/null 2>&1
33 fi
34 %preun
35 if [ $1 = 0 ]; then
36         /sbin/service pazpar2 stop > /dev/null 2>&1
37         /sbin/chkconfig --del pazpar2
38 fi
39
40 %description -n pazpar2-js
41 This package includes the Java Script library pz2.js. It also adds an
42 Alias for Apache2 so that this library and other demo portals are
43 available.
44
45 %posttrans -n pazpar2-js
46 if [ -d /etc/httpd/conf.d ]; then
47         ln -sf /etc/pazpar2/ap2pazpar2-js.cfg /etc/httpd/conf.d/pazpar2-js.conf
48 fi
49 %preun -n pazpar2-js
50 if [ $1 = 0 ]; then
51         if [ -L /etc/httpd/conf.d/pazpar2-js.conf ]; then
52                 rm /etc/httpd/conf.d/pazpar2-js.conf
53         fi
54 fi
55 %package -n pazpar2-doc
56 Summary: pazpar2 documentation
57 Group: Data
58
59 %description -n pazpar2-doc
60 This package includes documentation for Pazpar2 - the metasearcher.
61
62 %prep
63 %setup
64
65 %build
66
67 CFLAGS="$RPM_OPT_FLAGS" \
68  ./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
69         --with-yaz=/usr/bin
70 make CFLAGS="$RPM_OPT_FLAGS"
71
72 %install
73 rm -fr ${RPM_BUILD_ROOT}
74 make prefix=${RPM_BUILD_ROOT}/%{_prefix} mandir=${RPM_BUILD_ROOT}/%{_mandir} \
75         libdir=${RPM_BUILD_ROOT}/%{_libdir} install
76 mkdir -p ${RPM_BUILD_ROOT}/etc/pazpar2
77 mkdir -p ${RPM_BUILD_ROOT}/etc/pazpar2/settings
78 mkdir -p ${RPM_BUILD_ROOT}/etc/pazpar2/services-enabled
79 mkdir -p ${RPM_BUILD_ROOT}/etc/pazpar2/services-available
80 cp etc/server.xml ${RPM_BUILD_ROOT}/etc/pazpar2/
81 cp etc/default.xml ${RPM_BUILD_ROOT}/etc/pazpar2/services-available/
82 cp etc/services/*.xml ${RPM_BUILD_ROOT}/etc/pazpar2/services-available/
83 cp etc/settings/*.xml ${RPM_BUILD_ROOT}/etc/pazpar2/settings/
84 cp etc/*.xsl ${RPM_BUILD_ROOT}/etc/pazpar2/
85 mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d
86 install -m755 rpm/pazpar2.init ${RPM_BUILD_ROOT}/etc/rc.d/init.d/pazpar2
87 echo "Alias /pazpar2 /usr/share/pazpar2" >${RPM_BUILD_ROOT}/etc/pazpar2/ap2pazpar2-js.cfg
88 mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
89 install -m644 rpm/pazpar2.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/pazpar2
90
91 %clean
92 rm -fr ${RPM_BUILD_ROOT}
93
94 %files
95 %defattr(-,root,root)
96 %doc README LICENSE NEWS
97 %{_sbindir}/pazpar2
98 %dir %{_sysconfdir}/pazpar2
99 %dir %{_sysconfdir}/pazpar2/settings
100 %dir %{_sysconfdir}/pazpar2/services-enabled
101 %dir %{_sysconfdir}/pazpar2/services-available
102 %config %{_sysconfdir}/pazpar2/*.xml
103 %config %{_sysconfdir}/pazpar2/*.xsl
104 %config %{_sysconfdir}/pazpar2/settings/*.xml
105 %config %{_sysconfdir}/pazpar2/services-available/*.xml
106 %config %{_sysconfdir}/rc.d/init.d/pazpar2
107 %config(noreplace) /etc/logrotate.d/pazpar2
108 %{_mandir}/man5/pazpar2*
109 %{_mandir}/man7/pazpar2*
110 %{_mandir}/man8/pazpar2*
111
112 %files -n pazpar2-js
113 %defattr(-,root,root)
114 %{_datadir}/pazpar2/js/pz2.js
115 %config %{_sysconfdir}/pazpar2/ap2pazpar2-js.cfg
116
117 %files -n pazpar2-doc
118 %defattr(-,root,root)
119 %{_defaultdocdir}/pazpar2