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.32, libyazpp4-devel >= 1.3.0
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: libyazpp4 >= 1.3.0, libyaz4 >= 4.2.32
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}, libyazpp4-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 prefix=${RPM_BUILD_ROOT}/%{_prefix} mandir=${RPM_BUILD_ROOT}/%{_mandir} \
60 libdir=${RPM_BUILD_ROOT}/%{_libdir} install
61 rm ${RPM_BUILD_ROOT}/%{_libdir}/*.la
62 rm -fr ${RPM_BUILD_ROOT}/%{_prefix}/share/metaproxy
63 rm -f ${RPM_BUILD_ROOT}/%{_libdir}/metaproxy/*
64 mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}/metaproxy4/modules
65 mkdir -p ${RPM_BUILD_ROOT}/etc/metaproxy/filters-enabled
66 mkdir -p ${RPM_BUILD_ROOT}/etc/metaproxy/filters-available
67 mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
68 mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
69 mkdir -p ${RPM_BUILD_ROOT}/etc/sysconfig
70 install -m 644 rpm/metaproxy.xml ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.xml
71 install -m 644 rpm/metaproxy.user ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.user
72 install -m 755 rpm/metaproxy.init ${RPM_BUILD_ROOT}/etc/init.d/metaproxy
73 install -m 644 rpm/metaproxy.sysconfig ${RPM_BUILD_ROOT}/etc/sysconfig/metaproxy
74 install -m 644 rpm/metaproxy.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/metaproxy
77 rm -fr ${RPM_BUILD_ROOT}
79 %files -n libmetaproxy4
80 %doc README LICENSE NEWS
83 %dir %{_libdir}/metaproxy4/modules
85 %post -n libmetaproxy4 -p /sbin/ldconfig
87 %postun -n libmetaproxy4 -p /sbin/ldconfig
89 %files -n libmetaproxy4-devel
91 %{_includedir}/metaproxy
94 %{_bindir}/metaproxy-config
98 %{_prefix}/share/doc/metaproxy
101 %defattr(-,root,root)
104 %config /etc/init.d/metaproxy
105 %config(noreplace) /etc/metaproxy/metaproxy.xml
106 %config /etc/metaproxy/metaproxy.user
107 %dir /etc/metaproxy/filters-available
108 %dir /etc/metaproxy/filters-enabled
109 %config(noreplace) /etc/logrotate.d/metaproxy
110 %config(noreplace) /etc/sysconfig/metaproxy
113 . /etc/metaproxy/metaproxy.user
115 # 1. create group if not existing
116 if ! getent group | grep -q "^$SERVER_GROUP:" ; then
117 echo -n "Adding group $SERVER_GROUP.."
118 groupadd -r $SERVER_GROUP 2>/dev/null ||true
121 # 2. create user if not existing
122 if ! getent passwd | grep -q "^$SERVER_USER:"; then
123 echo -n "Adding system user $SERVER_USER.."
130 $SERVER_USER 2>/dev/null || true
134 if test ! -d $SERVER_HOME; then
136 chown $SERVER_USER:$SERVER_GROUP $SERVER_HOME
140 /sbin/chkconfig --add metaproxy
141 /sbin/service metaproxy start > /dev/null 2>&1
143 /sbin/service metaproxy restart > /dev/null 2>&1
147 if test -f /etc/init.d/metaproxy; then
148 /sbin/service metaproxy stop > /dev/null 2>&1
149 /sbin/chkconfig --del metaproxy
151 . /etc/metaproxy/metaproxy.user
152 test -d $SERVER_HOME && rm -fr $SERVER_HOME