Wednesday, 9 March 2011

EX423 Requirements

EX436 Requirements

Create a custom RPM spec file and build a binary RPM from source code

RPM Documentation
cd /usr/share/doc/rpm-*

Create user for building RPMS
[root@dhcp ~]# useradd makerpm

[root@dhcp ~]# su - makerpm

Create RPMMACRO file
[makerpm@dhcp ~]# vim .rpmmacros
add
%_topdir %(echo $HOME)/rpmbuild

Create directory structure
[makerpm@dhcp ~]# mkdir ~/rpmbuild
[makerpm@dhcp ~]# mkdir ~/rpmbuild{SPECS,BUILD,RPMS,SOURCES,SRPMS}

Example SPEC file
Summary: summary
Version: version
Group: group
License: license
Name: name
Provides: name
Release: release
Packager: packager
URL: url
Source: source
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}
%description
description
%prep
%setup -q
%build
./configure
make
%install
make DESTDIR=$RPM_BUILD_ROOT install
%files

Install an RHN Satellite server

Mount the ISO
[root@dhcp ~]# mount /dev/cdrom /mnt

Run installer
[root@dhcp ~]# /mnt/install.pl

Tuesday, 8 March 2011

Set up an SVN version control repository

Install SVN
[root@dhcp ~]# yum install subversion -y

Create local repo
[root@dhcp ~]# svnadmin create /var/svn/repo

Import files
[root@dhcp ~]# svn import -m "initial import" /etc file:///var/svn/repos/config

Add base channels from ISO images

Mount the ISO
[root@sat01 ~]# mount /dev/cdrom /mnt

Make the import directory
[root@sat01 ~]# mkdir /var/rhn-sat-import/RHEL5.5

Copy the files from the ISO
[root@sat01 ~]# cp -ruv /mnt* /var/rhn-sat-import/RHEL5.5

Unmount the ISO
[root@sat01 ~]# umount /mnt

List the available channels
[root@sat01 ~]# satellite-sync --list-channels --mount-point /var/rhn-sat-import/RHEL5.5

Import a specific channel
[root@sat01 ~]# satellite-sync -c rhel5-i386 --mount-point /var/rhn-sat-import/RHEL5.5

EX401 Requirements