BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: mysql-devel
BuildRequires: libstdc++-devel
+BuildRequires: rpmbuild(macros) >= 1.159
BuildRequires: zlib-devel
Requires(pre): /bin/id
Requires(pre): /usr/sbin/useradd
Requires(post,postun): /sbin/ldconfig
Requires: webserver
Requires: %{name}-db-%{version}
+Provides: user(aspseek)
Obsoletes: swish++
Obsoletes: mnogosearch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
rm -rf $RPM_BUILD_ROOT
%pre
-if [ -n "`id -u aspseek 2>/dev/null`" ]; then
- if [ "`id -u aspseek`" != "50" ]; then
+if [ -n "`/bin/id -u aspseek 2>/dev/null`" ]; then
+ if [ "`/bin/id -u aspseek`" != 50 ]; then
echo "Error: user aspseek doesn't have uid=50. Correct this before installing aspseek." 1>&2
exit 1
fi
else
- /usr/sbin/useradd -u 50 -r -d /srv/aspseek -s /bin/false -c "ASPSEEK User" -g root aspseek 1>&2
+ /usr/sbin/useradd -u 50 -d /srv/aspseek -s /bin/false -c "ASPSEEK User" -g root aspseek 1>&2
fi
%post
/sbin/chkconfig --add %{name}
touch /var/log/aspseek.log
chown aspseek:root /var/log/aspseek.log
+# create $HOME if possible, we are not allowed to remove it later
+if [ ! -d /srv/aspseek ]; then
+ if mkdir /srv/aspseek; then
+ chown aspseek:root /srv/aspseek
+ chmod 755 /srv/aspseek
+ fi
+fi
%preun
if [ "$1" = "0" ]; then
%postun
/sbin/ldconfig
if [ "$1" = "0" ]; then
- /usr/sbin/userdel aspseek
+ %userremove aspseek
fi
%post db-mysql