Changes

From SME Server
Jump to navigationJump to search
m
→‎Setting up RPM Building for SME Server: added collapsable sudo section
Line 24: Line 24:  
rpm -Uvh http://fr2.rpmfind.net/linux/epel/6/i386/epel-release-6-8.noarch.rpm
 
rpm -Uvh http://fr2.rpmfind.net/linux/epel/6/i386/epel-release-6-8.noarch.rpm
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
You need to create a new user, for mock will not accept user root for building packages
 +
<div class="mw-collapsible mw-collapsed" data-collapsetext="Collapse" data-expandtext="More on creating a sudo user">
 +
 +
<syntaxhighlight lang="Bash">
 +
useradd <username>
 +
passwd <username>
 +
</syntaxhighlight>
 +
The new user needs to be granted sudo rights
 +
<syntaxhighlight lang="Bash">
 +
yum install sudo
 +
/usr/sbin/usermod -aG wheel <username>
 +
</syntaxhighlight>
 +
 +
Edit the file /etc/sudoers:
 +
<syntaxhighlight lang="Bash">
 +
nano /etc/sudoers
 +
</syntaxhighlight>
 +
go down and find the following lines:
 +
 +
<syntaxhighlight lang="Bash">
 +
## Allows people in group wheel to run all commands
 +
# %wheel ALL=(ALL) ALL
 +
</syntaxhighlight>
 +
 +
and remove the hash in front of %wheel so it looks like...
 +
<syntaxhighlight lang="Bash">
 +
## Allows people in group wheel to run all commands
 +
%wheel ALL=(ALL) ALL
 +
</syntaxhighlight>
 +
 +
Log out as root and login as <username>
 +
</div>
 +
    
So then the installation of mock is just:
 
So then the installation of mock is just:
    
==== Installing Mock ====
 
==== Installing Mock ====
# Install mock and python-ctypes packages (the latter for better setarch support)
+
Install mock, make and rpm-build and python-ctypes packages (the latter for better setarch support)
$ sudo yum --enablerepo=epel install mock python-ctypes
+
<syntaxhighlight lang="Bash">
# Also need make and rpm-build
+
sudo yum --enablerepo=epel install mock python-ctypes
$ sudo yum install make rpm-build
+
sudo yum install make rpm-build
 
+
</syntaxhighlight>
# Add yourself to the 'mock' group that will have now been created
+
Add yourself to the 'mock' group that will have now been created
$ sudo usermod -G mock [youraccount]
+
<syntaxhighlight lang="Bash">
 +
sudo usermod -G mock <username>
 +
</syntaxhighlight>
    
The mock package creates an /etc/mock directory with configs for various OS versions (mostly Fedoras). Shad has provided working configurations for SME Server here http://mirror.canada.pialasse.com/contribs/slords/mock/  
 
The mock package creates an /etc/mock directory with configs for various OS versions (mostly Fedoras). Shad has provided working configurations for SME Server here http://mirror.canada.pialasse.com/contribs/slords/mock/  

Navigation menu