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, libyaz5-devel >= 5.0.21, libyazpp6-devel >= 1.5.2
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: libmetaproxy6 = %{version}
25 Summary: Metaproxy documentation
29 Metaproxy documentation.
31 %package -n libmetaproxy6
32 Summary: Metaproxy library
34 Requires: libyazpp6 >= 1.5.2, libyaz5 >= 5.0.21
36 %description -n libmetaproxy6
37 The Metaproxy libraries.
39 %package -n libmetaproxy6-devel
40 Summary: Metaproxy development package
41 Group: Development/Libraries
42 Requires: libmetaproxy6 = %{version}, libyazpp6-devel, boost-devel
43 Conflicts: libmetaproxy3-devel, libmetaproxy4-devel, libmetaproxy5-devel
45 %description -n libmetaproxy6-devel
46 Development libraries and include files for the Metaproxy package.
53 CFLAGS="$RPM_OPT_FLAGS" \
54 ./configure --prefix=%{_prefix} --libdir=%{_libdir} --mandir=%{_mandir} \
55 --enable-shared --with-yazpp=/usr/bin
56 make CFLAGS="$RPM_OPT_FLAGS"
59 rm -fr ${RPM_BUILD_ROOT}
60 make install DESTDIR=${RPM_BUILD_ROOT}
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}/metaproxy6/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/metaproxy/ports.d
68 mkdir -p ${RPM_BUILD_ROOT}/etc/metaproxy/routes.d
69 mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d
70 mkdir -p ${RPM_BUILD_ROOT}/etc/init.d
71 mkdir -p ${RPM_BUILD_ROOT}/etc/sysconfig
72 install -m 644 rpm/metaproxy.xml ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.xml
73 install -m 644 rpm/metaproxy.user ${RPM_BUILD_ROOT}/etc/metaproxy/metaproxy.user
74 install -m 755 rpm/metaproxy.init ${RPM_BUILD_ROOT}/etc/init.d/metaproxy
75 install -m 644 rpm/metaproxy.sysconfig ${RPM_BUILD_ROOT}/etc/sysconfig/metaproxy
76 install -m 644 rpm/metaproxy.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/metaproxy
79 rm -fr ${RPM_BUILD_ROOT}
81 %files -n libmetaproxy6
82 %doc README LICENSE NEWS
85 %dir %{_libdir}/metaproxy6/modules
87 %post -n libmetaproxy6 -p /sbin/ldconfig
89 %postun -n libmetaproxy6 -p /sbin/ldconfig
91 %files -n libmetaproxy6-devel
93 %{_includedir}/metaproxy
96 %{_bindir}/metaproxy-config
97 %{_mandir}/man1/metaproxy-config.*
100 %defattr(-,root,root)
101 %{_prefix}/share/doc/metaproxy
104 %defattr(-,root,root)
107 %{_mandir}/man1/metaproxy.*
108 %config /etc/init.d/metaproxy
109 %config(noreplace) /etc/metaproxy/metaproxy.xml
110 %config /etc/metaproxy/metaproxy.user
111 %dir /etc/metaproxy/filters-available
112 %dir /etc/metaproxy/filters-enabled
113 %dir /etc/metaproxy/ports.d
114 %dir /etc/metaproxy/routes.d
115 %config(noreplace) /etc/logrotate.d/metaproxy
116 %config(noreplace) /etc/sysconfig/metaproxy
119 . /etc/metaproxy/metaproxy.user
121 # 1. create group if not existing
122 if ! getent group | grep -q "^$SERVER_GROUP:" ; then
123 echo -n "Adding group $SERVER_GROUP.."
124 groupadd -r $SERVER_GROUP 2>/dev/null ||true
127 # 2. create user if not existing
128 if ! getent passwd | grep -q "^$SERVER_USER:"; then
129 echo -n "Adding system user $SERVER_USER.."
136 $SERVER_USER 2>/dev/null || true
140 if test ! -d $SERVER_HOME; then
142 chown $SERVER_USER:$SERVER_GROUP $SERVER_HOME
146 /sbin/chkconfig --add metaproxy
147 /sbin/service metaproxy start > /dev/null 2>&1
149 /sbin/service metaproxy restart > /dev/null 2>&1
153 if test -f /etc/init.d/metaproxy; then
154 /sbin/service metaproxy stop > /dev/null 2>&1
155 /sbin/chkconfig --del metaproxy
157 . /etc/metaproxy/metaproxy.user
158 test -d $SERVER_HOME && rm -fr $SERVER_HOME