[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Package review requested: mock 0.2 and yum-utils 0.2



On Sun, 2005-06-05 at 09:43 +0200, Aurelien Bompard wrote:
> mock:
>  - please give a full Source URL
>  - the URL tag is missing
>  - is "BuildRequires: gcc" really needed ?
>  - the buildroot is not the usual one (not very important, but...)
>  - the checks for '[ "$RPM_BUILD_ROOT" == "/" ]' are useless.
>  - the scriptlets should check for upgrade or fresh install

Here's a diff against the mock.spec in mock-0.2-1.src.rpm that fixes
these.  It also does not delete the mock group on exit which I believe
was discussed elsewhere.  And with the help of the attached
mock-0.2.cflags.patch uses RPM_OPT_FLAGS to compile mach-helper.

The only thing I'm not sure of is the URL.  I don't believe there's a
web page for mock as of yet so I stuck the sources directory in there.
Not all that helpful as it duplicates information deducible from the
Source0: line.  If the wiki UsingMach page was updated for UsingMock,
that might be a more appropriate place to point to (unless Seth already
has a web page started somewhere I didn't see.)

I successfully used mock as the build environment to build itself here
on x86_64.  Great work Seth!

-Toshio
--- mock-0.2/src/Makefile.cflags	2005-06-08 10:41:05.000000000 -0400
+++ mock-0.2/src/Makefile	2005-06-08 10:41:10.000000000 -0400
@@ -1,4 +1,5 @@
 CC=gcc
+CFLAGS=''
 EXECUTABLE=mock-helper
 SBINDIR=/usr/sbin
 MOCKGROUP=mock
@@ -6,7 +7,7 @@
 INSTALL=/usr/bin/install
 MKDIR=/bin/mkdir
 all: 
-	$(CC) -o $(EXECUTABLE) mock-helper.c 
+	$(CC) $(CFLAGS) -o $(EXECUTABLE) mock-helper.c 
 
 clean:
 	rm -f $(EXECUTABLE)
--- mock.spec.bak	2005-06-08 10:21:18.000000000 -0400
+++ mock.spec	2005-06-08 10:46:34.000000000 -0400
@@ -4,10 +4,12 @@
 Release: 1
 License: GPL
 Group: Development/Tools
-Source: %{name}-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}root
-BuildRequires: gcc
-Requires: python, yum >= 2.2.1
+Source: http://linux.duke.edu/~skvidal/mock/%{name}-%{version}.tar.gz
+Patch0: mock-0.2.cflags.patch
+URL: http://linux.duke.edu/~skvidal/mock
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires: python
+Requires: yum >= 2.2.1
 Requires(pre): shadow-utils
 
 
@@ -16,13 +18,14 @@
 
 %prep
 %setup -q
+%patch -p1 -b .cflags
 
 %build
-make
+make CFLAGS="$RPM_OPT_FLAGS"
 
 
 %install
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
 make DESTDIR=$RPM_BUILD_ROOT install
 # make the default.cfg link
 cd $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}
@@ -30,14 +33,12 @@
 
 
 %clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
 
 %pre
-groupadd -r mock >/dev/null 2>&1 || :
-
-%postun
-groupdel mock >/dev/null 2>&1 || :
-
+if [ $1 = "1" ]; then
+    groupadd -r mock >/dev/null 2>&1 || :
+fi
 
 %files
 %defattr(-, root, root)
@@ -50,6 +51,12 @@
 
 
 %changelog
+* Wed Jun 8 2005 Toshio Kuratomi <toshio tiki-lounge com>
+- No longer remove the mock group on package removal.
+- Only attempt to add the mock group on first install.
+- Several cleanups suggested by Aurelien Bompard.
+- Pass rpm's CFLAGS to compilation.
+  
 * Thu May 19 2005 Seth Vidal <skvidal phy duke edu>
 - second packaging and backing down the yum ver req
 

Attachment: signature.asc
Description: This is a digitally signed message part


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]