[ic] SRPM Build Problems w/ Patch

Cameron B. Prince interchange-users@icdevgroup.org
Sat May 17 00:47:00 2003


Hi guys,

I tried to create new RPMs from the SRPM tonight and I discovered that it
won't build... It seems that makecat now requires the user interch to exist
before it's ran. (Maybe it always has and this was overlooked.)

When I run rpmbuild --rebuild interchange-4.9.6-1.src.rpm I get:

There were errors in copying the demo files.  Cannot
continue.  Check to see if permissions are correct.
The problem was:

        User does not exist: interch

error: Bad exit status from /var/tmp/rpm-tmp.89796 (%build)

I tracked it down to the instruction to run bin/makecat:

[root@localhost interchange]#        bin/makecat \
>                 -F \
>                 --nocfg \
>                 --norunning \
>                 --demotype=foundation \
>                 --catalogname=foundation \
>                 --basedir=/var/tmp/interchange-4.9.6-buildroot/var/lib/int
erchange \
>                 --catroot=/var/tmp/interchange-4.9.6-buildroot/var/lib/int
erchange/foundation \
>                 --documentroot=/var/www/html \
>                 --samplehtml=/var/www/html/foundation \
>                 --sampleurl=http://localhost/foundation \
>                 --imagedir=/var/www/html/foundation/images \
>                 --imageurl=/foundation/images \
>                 --sharedir=/var/www/html \
>                 --shareurl= \
>                 --cgidir=/var/www/cgi-bin \
>                 --cgibase=/cgi-bin \
>                 --cgiurl=/cgi-bin/foundation \
>                 --interchangeuser=interch \
>                 --interchangegroup=interch \
>                 --permtype=user \
>                 --serverconf=/etc/httpd/conf/httpd.conf \
>                 --vendroot=/var/tmp/interchange-4.9.6-buildroot/usr/lib/in
terchange \
>                 --linkmode=UNIX \
>                 --servername=localhost \
>                 --catuser=interch \
>                 --mailorderto=interch@localhost \
>                 cachedir=/var/tmp \
>                 logdir=/var/log \
>                 demomode=1
interch is not a valid user name on this machine.


I inspected the spec file and found that the instruction to create the user
is below the makecat call. I moved this block to the top of %build and it
seems to have solved that problem...

The build then died on an unpackaged file: /var/log/interchange/error.log I
explicitly defined the file in the %files section and it's now building
correctly...

Here's a diff:

--- SPECS/interchange.spec.orig 2003-01-07 13:59:06.000000000 -0600
+++ SPECS/interchange.spec      2003-05-17 12:43:46.000000000 -0500
@@ -67,6 +67,12 @@
        echo "RPM_BUILD_ROOT has stupid value"
        exit 1
 fi
+
+# Create interch user/group if they don't already exist
+/usr/sbin/groupadd -g 52 %ic_group 2>/dev/null || :
+/usr/sbin/useradd -u 52 -g %ic_group -c "Interchange server" -s /bin/bash \
+        -r -d %{_localstatedir}/lib/interchange %ic_user 2>/dev/null || :
+
 %__rm -rf $RPM_BUILD_ROOT
 %__mkdir_p $RPM_BUILD_ROOT

@@ -209,12 +215,6 @@

 /sbin/service interchange stop >/dev/null 2>&1 || :

-# Create interch user/group if they don't already exist
-/usr/sbin/groupadd -g 52 %ic_group 2>/dev/null || :
-/usr/sbin/useradd -u 52 -g %ic_group -c "Interchange server" -s /bin/bash \
-       -r -d %{_localstatedir}/lib/interchange %ic_user 2>/dev/null || :
-
-
 %files foundation

 %defattr(-, root, root)
@@ -230,6 +230,7 @@
 %dir %{_localstatedir}/log/interchange
 %dir %{_localstatedir}/lib/interchange
 %config(noreplace) %verify(not size mtime md5)
%{_sysconfdir}/interchange.cfg
+%{_localstatedir}/log/interchange/error.log

 %defattr(-, root, root)


Later,
Cameron