Prev: /dev/random Blocks Forever | Next: Making wpa_cli and wpa_supplicant Work With dbus |
(Index) |
I build SuSE RPM packages rarely enough that I need to do research on the procedure every time. This is an aid to my memory.
I don't actually know if the same procedure works for Red Hat/Fedora, CentOS, or other RPM-based distros, but there's a pretty good chance that they also use rpmbuild.
The command lines are illustrated for a fix to ifplugd. When you see this package name, substitute your own package.
Download the source RPM. It's strongly recommended to use the latest version available on SuSE, e.g. the Tumbleweed or Factory package. And test if your bug is present there, or already got fixed. Then install the source RPM, which ends up in /usr/src/packages/(various directories):
rpm -i ifplugd-0.28-236.1.src.rpm
Inspect /usr/src/packages/SPECS/ifplugd.spec ; the initial section will have BuildRequires lines. Obtain and install any missing packages. In some cases, finding build dependencies can be a challenge since the object you need is provided by some package with a non-obvious name.
Unpack the source code. This step won't work if build dependencies are missing.
rpmbuild -bp /usr/src/packages/SPECS/ifplugd.spec > /tmp/unpack.log 2>&1
cd
to the source directory. Do the research to fix whatever
bug. Copy the file(s) you are going to edit. Then edit them to fix the bug.
cd /usr/src/packages/BUILD/ifplugd-0.28/src/
cp -p nlapi.c nlapi.c.orig
vi nlapi.c
Back out to the package directory. Make a patch file. In the diff command the original file comes first, then the altered one, which should keep its original name. In the usual case that several files are altered, it's recommended to concatenate all the diffs in one file. The name of the patch file, in the SOURCES directory, should be descriptive but not prolix.
cd /usr/src/packages/BUILD/ifplugd-0.28 #--or in this case--
cd ..
diff -u src/nlapi.c.orig src/nlapi.c > ../../SOURCES/ifplugd-nlapi-bfr.pat
Edit the spec file with these changes:
Release: 236.2 (was 236.1)
Patch3: ifplugd-nlapi-bfr.pat
%patch3
Now compile the program and create the RPM package.
rpmbuild -bb /usr/src/packages/SPECS/ifplugd.spec > /tmp/compile.log 2>&1
Assuming there were no errors, the RPM package appears in /usr/src/packages/RPMS/x86_64/ifplugd-0.28-236.2.x86_64.rpm . There are architecture subdirectories in RPMS/ .
Assuming that your changes actually fixed the bug, file a bug report at SuSE's Bugzilla and attach the patch file. Be sure to identify carefully which version of the sources you altered.
Prev: /dev/random Blocks Forever | Next: Making wpa_cli and wpa_supplicant Work With dbus |
(Index) |