1 %define idmetaversion %(. ./IDMETA; echo $VERSION|tr -d '\n')
2 Summary: Z39.50/SRU router
4 Version: %{idmetaversion}
7 Group: Applications/Internet
8 Vendor: Index Data ApS <info@indexdata.dk>
9 Source: metaproxy-%{version}.tar.gz
10 BuildRoot: %{_tmppath}/%{name}-%{version}-root
11 Prefix: %{_prefix} /etc/metaproxy
12 BuildRequires: pkgconfig, libyaz4-devel >= 4.2.62, libyazpp5-devel >= 1.4.1
13 BuildRequires: libxslt-devel, boost-devel
14 Conflicts: cf-engine <= 2.12.5
15 Packager: Adam Dickmeiss <adam@indexdata.dk>
16 URL: http://www.indexdata.com/metaproxy
17 Group: Applications/Internet
18 Requires: libmetaproxy4 = %{version}
24 Summary: Metaproxy documentation
28 Metaproxy documentation.
30 %package -n libmetaproxy4
31 Summary: Metaproxy library
33 Requires: libyazpp5 >= 1.4.0, libyaz4 >= 4.2.62
35 %description -n libmetaproxy4
36 The Metaproxy libraries.
38 %package -n libmetaproxy4-devel
39 Summary: Metaproxy development package
40 Group: Development/Libraries
41 Requires: libmetaproxy4 = %{version}, libyazpp5-devel, boost-devel
42 Conflicts: libmetaproxy3-devel
44 %description -n libmetaproxy4-devel
45 Development libraries and include files for the Metaproxy package.
52 CFLAGS="$RPM_OPT_FLAGS" \
53 ./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
54 --enable-shared --with-yazpp=/usr/bin
55 make CFLAGS="$RPM_OPT_FLAGS"
58 rm -fr ${RPM_BUILD_ROOT}
59 make install DESTDIR=${RPM_BUILD_ROOT}
60 rm ${RPM_BUILD_ROOT}/%{_libdir}/*.la
61 rm -fr ${RPM_BUILD_ROOT}/%{_prefix}/share/metaproxy
62 rm -f ${RPM_BUILD_ROOT}/%{_libdir}/metaproxy/*
63 mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}/metaproxy4/modules
64 mkdir -p ${RPM_BUILD_ROOT}/etc/metaproxy/filters-enabled
65 mkdir -p ${RPM_BUILD_ROOT}/etc/metaproxy/filters-available
66 mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
67 mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
68 mkdir -p ${RPM_BUILD_ROOT}/etc/sysconfig
69 install -m 644 rpm/metaproxy.xml ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.xml
70 install -m 644 rpm/metaproxy.user ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.user
71 install -m 755 rpm/metaproxy.init ${RPM_BUILD_ROOT}/etc/init.d/metaproxy
72 install -m 644 rpm/metaproxy.sysconfig ${RPM_BUILD_ROOT}/etc/sysconfig/metaproxy
73 install -m 644 rpm/metaproxy.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/metaproxy
76 rm -fr ${RPM_BUILD_ROOT}
78 %files -n libmetaproxy4
79 %doc README LICENSE NEWS
82 %dir %{_libdir}/metaproxy4/modules
84 %post -n libmetaproxy4 -p /sbin/ldconfig
86 %postun -n libmetaproxy4 -p /sbin/ldconfig
88 %files -n libmetaproxy4-devel
90 %{_includedir}/metaproxy
93 %{_bindir}/metaproxy-config
94 %{_mandir}/man1/metaproxy-config.*
98 %{_prefix}/share/doc/metaproxy
101 %defattr(-,root,root)
104 %{_mandir}/man1/metaproxy.*
105 %config /etc/init.d/metaproxy
106 %config(noreplace) /etc/metaproxy/metaproxy.xml
107 %config /etc/metaproxy/metaproxy.user
108 %dir /etc/metaproxy/filters-available
109 %dir /etc/metaproxy/filters-enabled
110 %config(noreplace) /etc/logrotate.d/metaproxy
111 %config(noreplace) /etc/sysconfig/metaproxy
114 . /etc/metaproxy/metaproxy.user
116 # 1. create group if not existing
117 if ! getent group | grep -q "^$SERVER_GROUP:" ; then
118 echo -n "Adding group $SERVER_GROUP.."
119 groupadd -r $SERVER_GROUP 2>/dev/null ||true
122 # 2. create user if not existing
123 if ! getent passwd | grep -q "^$SERVER_USER:"; then
124 echo -n "Adding system user $SERVER_USER.."
131 $SERVER_USER 2>/dev/null || true
135 if test ! -d $SERVER_HOME; then
137 chown $SERVER_USER:$SERVER_GROUP $SERVER_HOME
141 /sbin/chkconfig --add metaproxy
142 /sbin/service metaproxy start > /dev/null 2>&1
144 /sbin/service metaproxy restart > /dev/null 2>&1
148 if test -f /etc/init.d/metaproxy; then
149 /sbin/service metaproxy stop > /dev/null 2>&1
150 /sbin/chkconfig --del metaproxy
152 . /etc/metaproxy/metaproxy.user
153 test -d $SERVER_HOME && rm -fr $SERVER_HOME