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.69, 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.69
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/metaproxy/ports.d
67 mkdir -p ${RPM_BUILD_ROOT}/etc/metaproxy/routes.d
68 mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
69 mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
70 mkdir -p ${RPM_BUILD_ROOT}/etc/sysconfig
71 install -m 644 rpm/metaproxy.xml ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.xml
72 install -m 644 rpm/metaproxy.user ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.user
73 install -m 755 rpm/metaproxy.init ${RPM_BUILD_ROOT}/etc/init.d/metaproxy
74 install -m 644 rpm/metaproxy.sysconfig ${RPM_BUILD_ROOT}/etc/sysconfig/metaproxy
75 install -m 644 rpm/metaproxy.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/metaproxy
78 rm -fr ${RPM_BUILD_ROOT}
80 %files -n libmetaproxy4
81 %doc README LICENSE NEWS
84 %dir %{_libdir}/metaproxy4/modules
86 %post -n libmetaproxy4 -p /sbin/ldconfig
88 %postun -n libmetaproxy4 -p /sbin/ldconfig
90 %files -n libmetaproxy4-devel
92 %{_includedir}/metaproxy
95 %{_bindir}/metaproxy-config
96 %{_mandir}/man1/metaproxy-config.*
100 %{_prefix}/share/doc/metaproxy
103 %defattr(-,root,root)
106 %{_mandir}/man1/metaproxy.*
107 %config /etc/init.d/metaproxy
108 %config(noreplace) /etc/metaproxy/metaproxy.xml
109 %config /etc/metaproxy/metaproxy.user
110 %dir /etc/metaproxy/filters-available
111 %dir /etc/metaproxy/filters-enabled
112 %dir /etc/metaproxy/ports.d
113 %dir /etc/metaproxy/routes.d
114 %config(noreplace) /etc/logrotate.d/metaproxy
115 %config(noreplace) /etc/sysconfig/metaproxy
118 . /etc/metaproxy/metaproxy.user
120 # 1. create group if not existing
121 if ! getent group | grep -q "^$SERVER_GROUP:" ; then
122 echo -n "Adding group $SERVER_GROUP.."
123 groupadd -r $SERVER_GROUP 2>/dev/null ||true
126 # 2. create user if not existing
127 if ! getent passwd | grep -q "^$SERVER_USER:"; then
128 echo -n "Adding system user $SERVER_USER.."
135 $SERVER_USER 2>/dev/null || true
139 if test ! -d $SERVER_HOME; then
141 chown $SERVER_USER:$SERVER_GROUP $SERVER_HOME
145 /sbin/chkconfig --add metaproxy
146 /sbin/service metaproxy start > /dev/null 2>&1
148 /sbin/service metaproxy restart > /dev/null 2>&1
152 if test -f /etc/init.d/metaproxy; then
153 /sbin/service metaproxy stop > /dev/null 2>&1
154 /sbin/chkconfig --del metaproxy
156 . /etc/metaproxy/metaproxy.user
157 test -d $SERVER_HOME && rm -fr $SERVER_HOME