BuildRequires: mysql-devel
BuildRequires: libstdc++-devel
BuildRequires: zlib-devel
-Requires(pre): user-aspseek
+Requires(pre): /bin/id
+Requires(pre): /usr/sbin/useradd
+Requires(postun): /usr/sbin/userdel
Requires(post): fileutils
Requires(post,preun): /sbin/chkconfig
Requires(post,postun): /sbin/ldconfig
%clean
rm -rf $RPM_BUILD_ROOT
+%pre
+if [ -n "`id -u aspseek 2>/dev/null`" ]; then
+ if [ "`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 /home/services/aspseek -s /bin/false -c "ASPSEEK User" -g root aspseek 1>&2
+fi
+
%post
/sbin/ldconfig
/sbin/chkconfig --add %{name}
%postun
/sbin/ldconfig
+if [ "$1" = "0" ]; then
+ /usr/sbin/userdel aspseek
+fi
%post db-mysql
/sbin/ldconfig