OT: using mock to build for SLES

Matt Domsch Matt_Domsch at dell.com
Tue Mar 7 04:13:14 UTC 2006


I've been looking at using mock to build srpms for Novell/SuSE SLES
product, rather than using their build.rpm script.  With one little
change to mock (below), seems to work pretty well.  opensuse-10.x is
still a little weird, but SLES9 x86 and x86_64 seem to be building
fine.

Here's the mock patch to pass -m to useradd, and I'll follow up with
the buildroots.xml and mock cfg file example too.

Thanks,
Matt

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

--- mock.orig	2006-03-05 20:58:49.000000000 -0600
+++ mock	2006-03-06 08:30:51.000000000 -0600
@@ -556,8 +556,8 @@
         if not os.path.exists(self.rootdir + self.homedir):
             if not os.path.exists(os.path.join(self.rootdir, 'usr/sbin/useradd')):
                 raise RootError, "Could not find useradd in chroot, maybe the install failed?"
-            cmd = '/usr/sbin/useradd -u %s -d %s %s' % (self.config['chrootuid'], 
-                    self.homedir, self.config['chrootuser'])
+            cmd = '/usr/sbin/useradd -m -u %s -d %s %s' % (self.config['chrootuid'], 
+                                                           self.homedir, self.config['chrootuser'])
             self.do_chroot(cmd, fatal = True)
 
     def _build_dir_setup(self):
@@ -571,9 +571,9 @@
         for subdir in ('RPMS', 'SRPMS', 'SOURCES', 'SPECS', 'BUILD', 'originals'):
             cmd = "mkdir -p %s/%s" % (self.builddir, subdir)
             self.do_chroot(cmd, fatal = True)
-            cmd = "chown %s.%s %s/%s" % (self.config['chrootuser'], 
-               self.config['chrootgroup'], self.builddir, subdir)
-            self.do_chroot(cmd, fatal = True)
+        cmd = "chown -R %s.%s %s" % (self.config['chrootuser'], 
+                                     self.config['chrootgroup'], self.builddir)
+        self.do_chroot(cmd, fatal = True)
         
         # rpmmacros default
         macrofile_out = '%s%s/.rpmmacros' % (self.rootdir, self.homedir)




More information about the Fedora-buildsys-list mailing list