Arno Wilhelm
2003-01-20
Usually all rpm related software is kept under one directory which is usally /usr/src/redhat.
drwxr-xr-x 8 root root 4096 Jan 17 11:20 BUILD
drwxr-xr-x 8 root root 4096 Mar 28 11:20 RPMS
drwxr-xr-x 2 root root 4096 Jan 17 11:38 SOURCES
drwxr-xr-x 2 root root 4096 Jan 17 10:29 SPECS
drwxr-xr-x 2 root root 4096 Jan 20 11:09 SRPMS
> cd /usr/src/redhat/SRPMS
> rpm -Uvh dhcpcd-1.3.22pl1-6.src.rpm
1:dhcpcd ########################################### [100%]
> l ../SPECS/
-rw-r-r- 1 root root 7014 Jan 10 14:23 dhcpcd.spec
> l ../SOURCES/
-rw-r-r- 1 root root 711 Feb 5 2002 dhcpcd-1.3.21-noMoFakery.patch
-rw-r-r- 1 root root 905 Feb 11 2002 dhcpcd-1.3.21-noNISfakery.patch -rw-r-r- 1 root root 802 Dec 30 2001 dhcpcd-1.3.21-post.patch
-rw-r-r- 1 root root 134557 Mar 22 2002 dhcpcd-1.3.22-pl1.tar.gz
-rw-r-r- 1 root root 46345 Jul 5 2002 dhcpcd-nonius.patch
-rwxr-xr-x 1 root root 376 Jan 7 10:49 syslog.dhcpcd
> rpm -bp dhcpcd.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.42654
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf dhcpcd-1.3.22-pl1
+ /bin/gzip -dc /usr/src/redhat/SOURCES/dhcpcd-1.3.22-pl1.tar.gz
+ tar -xf -
+ STATUS=0 + '[' 0 -ne 0 ']'
+ cd dhcpcd-1.3.22-pl1
++ /usr/bin/id -u + '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,g-w,o-w .
+ echo 'Patch #4 (dhcpcd-nonius.patch):'
Patch #4 (dhcpcd-nonius.patch):
+ patch -p1 -s
+ exit 0
After you have unpacked the sources and patched them, you should make a copy of the prepared sources:
> l
drwxr-xr-x 4 root root 4096 Jan 20 11:45 dhcpcd-1.3.22-pl1
> cp -avf dhcpcd-1.3.22-pl1/ dhcpcd-1.3.22-pl2
> l
drwxr-xr-x 5 root root 4096 Jan 20 16:40 dhcpcd-1.3.22-pl1
drwxr-xr-x 4 root root 4096 Jan 20 11:45 dhcpcd-1.3.22-pl2
-rw-r-r- 1 root root 77201 Jan 20 16:42 dhcpcd-1.3.22-pl2.patch
> patch -p1 < ../dhcpcd-1.3.22-pl2.patch
patching file `arp.c'
patching file `client.c'
patching file `dhcpcd'
patching file `dhcpcd.c'
patching file `dhcpcd.exe'
patching file `dhcpcd.spec'
patching file `doc/log-messages.txt'
patching file `signals.c'
patching file `version'
> cd ..
> diff -r dhcpcd-1.3.22-pl1 dhcpcd-1.3.22-pl2
>
Now we have to copy the patch file to the SOURCES directory and adjust the spec file, so that it applies our new patch to the old sources.
> rm -rf dhcpcd-1.3.22-pl*
> cd ../SPECS/
After you have edited the spec file you must rebuild the rpm packages from the sources:
.....
Wrote: /usr/src/redhat/SRPMS/dhcpcd-1.3.22pl1-7.src.rpm
Wrote: /usr/src/redhat/RPMS/i386/dhcpcd-1.3.22pl1-7.i386.rpm
.....
%define mainver 1.3.22
%define patchlevel pl1
Summary: A DHCP (Dynamic Host Configuration Protocol) client.
Name: dhcpcd
Version: %{mainver}%{patchlevel}
Release: 7
License: GPL
Group: System Environment/Base
Source: http://www.phystech.com/ftp/dhcpcd-%{mainver}-%{patchlevel}.tar.gz
Source1: syslog.dhcpcd
Patch: dhcpcd-1.3.21-post.patch
#Patch1: dhcpcd-1.3.21-multicast.patch
Patch2: dhcpcd-1.3.21-noNISfakery.patch
Patch3: dhcpcd-1.3.21-noMoFakery.patch
Patch4: dhcpcd-nonius.patch
Patch5: dhcpcd-1.3.22-pl2.patch
URL: http://www.phystech.com/download/
BuildRoot: /var/tmp/dhcpd_client-root
Prereq: file, fileutils, grep
Requires: noniusetc_box >= 2.2-15
%description
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows
individual devices on an IP network to get their own network
configuration information (IP address, subnetmask, broadcast address,
etc.) from a DHCP server. The overall purpose of DHCP is to make it
easier to administer a large network. The dhcpcd package includes a
DHCP client daemon.
If you're going to use DHCP on your network, you'll need to install
the server package (dhcp) on the server, and a client package on the
client machines. The dhcpcd package includes a DHCP client, but we
suggest that you instead install the DHCP client included in the pump
package, which provides a faster and simpler DHCP client.
%prep
%setup -q -n dhcpcd-%{mainver}-%{patchlevel}
#%patch -p1
#%patch1 -p1
#%patch2 -p1
#%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
%configure -sbindir=/sbin
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
%makeinstall sbindir=$RPM_BUILD_ROOT/sbin
rm -rf $RPM_BUILD_ROOT/etc/dhcpc*
mkdir -p $RPM_BUILD_ROOT/etc/dhcpc
ln -s dhcpc $RPM_BUILD_ROOT/etc/dhcpcd
mkdir -p $RPM_BUILD_ROOT/etc/syslog.d
install %{SOURCE1} $RPM_BUILD_ROOT/etc/syslog.d/dhcpcd
%clean
rm -rf $RPM_BUILD_ROOT
%post
if [ ! -d /var/nonius/sys ]; then
mkdir -p /var/nonius/sys/
fi
for a in Notice Warning Error Info Fatal Security Panic; do
if [ ! -p /var/nonius/sys/Network_dhcpcd_$a ]; then
mknod /var/nonius/sys/Network_dhcpcd_$a p
fi
done
%files
%defattr(-,root,root)
%doc README dhcpcd-eth0.exe
/etc/dhcpcd
/etc/syslog.d/dhcpcd
%dir /etc/dhcpc
/sbin/dhcpcd
%{_mandir}/man8/dhcpcd.8*
%pre
exec > /dev/null 2> /dev/null
# We can't replace a directory with a symlink, but this directory is supposed
# to be a symlink.
if [ -d /etc/dhcpcd ] ; then
mv /etc/dhcpcd/* /etc/dhcpc
mv /etc/dhcpcd /etc/dhcpcd.rpmsave
fi
# Remove the circular link which was in a previous version of this package.
if [ -L /etc/dhcpc/dhcpc ] ; then
if file /etc/dhcpc/dhcpc | grep -q "symbolic link to dhcpc" ; then
rm /etc/dhcpc/dhcpc
# Leave a file for RPM to remove.
touch /etc/dhcpc/dhcpc
fi
fi
if [ -L /etc/dhcpc/dhcpcd ] && [ ! -f /etc/dhcpc/dhcpcd ]; then
rm -f /etc/dhcpc/dhcpcd
fi
%changelog
* Mon Jan 20 2003 yeda nasda <a.nasda@nonius.com>
- 1.3.22pl1-7
- Added identification numbers to log messages.
- Added description of log id numbers in doc directory.
* Mon Feb 11 2002 Elliot Lee <sopwith@redhat.com> 1.3.21pl2-5
- (noNISfakery.patch) update this patch to setdomainname()
* Tue Feb 05 2002 Elliot Lee <sopwith@redhat.com> 1.3.21pl2-4
- (noMoFakery.patch) Don't write RESOLV_CONF or NTP_CONF either, unless we have some values from the DHCP
server.
* Thu Jan 31 2002 Elliot Lee <sopwith@redhat.com> 1.3.21pl2-3
- (noNISfakery.patch) Don't write NIS_CONF out unless the server
actually sent a value back to us.
* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Fri Jan 04 2002 Elliot Lee <sopwith@redhat.com> 1.3.21pl2-1
- Update to pl2
- Fix #54600
* Tue Jul 08 1997 Erik Troan <ewt@redhat.com>
- built against glibc, updated to 0.65
* Mon Apr 21 1997 Otto Hammersmith <otto@redhat.com>
- fixed summary line... was a summary for tar.
This document was generated using the LaTeX2HTML translator Version 2002 (1.62)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -no_subdir -split 0 -show_section_numbers /tmp/lyx_tmpdir20661mKAAux/lyx_tmpbuf20661KDrWvz/SourceRpmPatch-Howto.tex