- Create an initial spec file from either a template or a spec file for a similar application.
- Try a build.
- You should expect that the above should fail. Check the log file (/tmp/
.log) for where it failed. Fix the problem. Generally a typo or the build needs a patch - Repeat 2-3 until the prep and build works. If it actually installs the packages, then go to 7
- Look in the RPM_BUILD_ROOT directory tree in /var/tmp
for what was installed, and adjust the %files section of the spec file to match the installation. - Go back and repeat from 2 (Note: you can short-cut this with pkgbuild)
- Publish the spec file(s), patches, ChangeLog etc and your done.
jdsbuild@prae> cd /tmp
jdsbuild@prae> gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2
jdsbuild@prae> mv xfwm4-4.4.1 xfwm4-4.4.1-orig
jdsbuild@prae> gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2
#
# Fix the files which need to be patched.
#
jdsbuild@prae> diff -ur xfwm4-4.4.1-orig xfwm4-4.4.1 > ~/spec-files-xfce/patches/xfwm4-01-fixbadcode.diff
At this point add an entry for the patch xfwm4-01-fixbadcode.diff into the spec file and try again.
If you need to add another patch, just remove the patched directory, and un-tar again.
Maybe you want to merge a fix into an existing patch. Just patch the directory in /tmp and then make the changes.
jdsbuild@prae> cd /tmp
jdsbuild@prae> gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2
jdsbuild@prae> mv xfwm4-4.4.1 xfwm4-4.4.1-orig
jdsbuild@prae> gtar fxj ~/packages/SOURCES/xfwm4-4.4.1.tar.bz2
jdsbuild@prae> cd xfwm4-4.4.1
jdsbuild@prae> gpatch -p1 < ~/spec-files-xfce/patches/xfwm4-01-fixbadcode.diff jdsbuild@prae> cd /tmp
#
# Fix the files which need to be patched.
#
jdsbuild@prae> diff -ur xfwm4-4.4.1-orig xfwm4-4.4.1 > ~/spec-files-xfce/patches/xfwm4-01-fixbadcode.diff
Using a shell like bash with command line editing, the process can be quite quick and easy.
Have Fun!!!