Finally I finished the spec-file and could build the RPM for kcometen4-1.0.3
Build environment used: /usr/src/packages (on a clean system).
OS: x86_64 Intell (dual core)
SuSE 11.1 x86_64
The source file is: http://www.mehercule.net/kcometen4/kcometen4-1.0.3.tar.gz
(You can find it also on kde-look.org, section screensavers)
The spec-file named kcometen4.spec:
#
# spec file for package kcometen4 (Version 1.0.3)
#
# Copyright 2009 Henkees Ingelse <henkees@henkees-markus.nl>
#
# License GPL; feel free to change/copy/adjust...
# The real work is done by John Stamp, see www.mehercule.net
#
# norootforbuild
Name: kcometen4
Version: 1.0.3
Release: 1
Vendor: http://www.mehercule.net
License: GPL
Summary: Screensaver
Group: System/GUI/KDE
Packager: Henkees Ingelse <henkees@henkees-markus.nl>
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Source: http://www.mehercule.net/kcometen4/kcometen4-1.0.3.tar.gz
BuildArch: x86_64
%description
KCometen4 is an OpenGL KDE screensaver. Inside a box is a nifty light show that features lightning and exploding comets. It lets you configure various effects like comet behavior, camera movement, box face images, etc.
%prep
%setup
%build
CFLAGS="x86_64 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables" CXXFLAGS="x86_64 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables"
%configure --prefix /usr
make -C $RPM_BUILD_DIR/%{name}-%{version}/build
%install -d
install -D $RPM_BUILD_DIR/%{name}-%{version}/build/src/kcometen4.kss $RPM_BUILD_ROOT/usr/bin/kcometen4.kss
install -D $RPM_BUILD_DIR/%{name}-%{version}/src/lightmap.png $RPM_BUILD_ROOT/usr/share/kde4/apps/kcometen4/pixmaps/lightmap.png
install -D $RPM_BUILD_DIR/%{name}-%{version}/src/particle.png $RPM_BUILD_ROOT/usr/share/kde4/apps/kcometen4/pixmaps/particle.png
install -D $RPM_BUILD_DIR/%{name}-%{version}/src/kcometen4.desktop $RPM_BUILD_ROOT/usr/share/kde4/services/ScreenSavers/kcometen4.desktop
install -D $RPM_BUILD_DIR/%{name}-%{version}/src/kcometen4.kss.1 $RPM_BUILD_ROOT/usr/local/man/man1/kcometen4.kss.1
%clean
rm -rf %{buildroot}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
/usr/bin/kcometen4.kss
/usr/local/man/man1/kcometen4.kss.1.gz
/usr/share/kde4/apps/kcometen4/pixmaps/lightmap.png
/usr/share/kde4/apps/kcometen4/pixmaps/particle.png
/usr/share/kde4/services/ScreenSavers/kcometen4.desktop
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog INSTALL
%changelog
* Sun Feb 9 2009 Henkees Ingelse <henkees@henkees-markus.nl>
- RPM made from sourcefile
Usage:
(You must have installed the development packages (base -, rpm-build -, kde -, kernel -, integrated development…)
- copy source to /usr/src/packages/SOURCES
- copy spec-file (with the name kcometen4.spec) to /usr/src/packages/SPECS
- open a terminal and cd to /usr/src/packages/SPECS
- enter the command: rpmbuild -ba kcometen4.spec
If everything went well, the RPM is written to /usr/src/packages/RPMS/x86_64 and the src.rpm to /usr/src/packages/SRPMS
Note: If you get compiling errors, you probably need a local “.rpmrc” file. (to be placed in /home/your_name/)
I did NOT need this in my last attempts.
An example of a .rpmrc which I used in the first attempts:
optflags: i386 -O2 -g
optflags: i486 -O2 -g
optflags: i586 -O2 -g
optflags: i686 -O2 -g
optflags: pentium3 -O2 -g
optflags: pentium4 -O2 -g
optflags: athlon -O2 -g
optflags: x86_64 -O2 -g
optflags: ia64 -O2 -g
optflags: amd64 -O2 -g
optflags: ia32e -O2 -g
arch_canon: athlon: athlon 1
arch_canon: pentium4: pentium4 1
arch_canon: pentium3: pentium3 1
arch_canon: i686: i686 1
arch_canon: i586: i586 1
arch_canon: i486: i486 1
arch_canon: i386: i386 1
arch_canon: x86_64: x86_64 1
arch_canon: amd64: amd64 1
arch_canon: ia32e: ia32e 1
arch_canon: ia64: ia64 9
os_canon: Linux: Linux 1
buildarchtranslate: athlon: i586
buildarchtranslate: pentium4: i586
buildarchtranslate: pentium3: i586
buildarchtranslate: i686: i586
buildarchtranslate: i586: i586
buildarchtranslate: i486: i386
buildarchtranslate: i386: i386
buildarchtranslate: x86_64: x86_64
buildarchtranslate: amd64: x86_64
buildarchtranslate: ia32e: x86_64
buildarchtranslate: ia64: ia64
arch_compat: athlon: i686
arch_compat: pentium4: pentium3
arch_compat: pentium3: i686
arch_compat: i686: i586
arch_compat: i586: i486
arch_compat: i486: i386
arch_compat: ia64: i686 noarch
buildarch_compat: ia64: noarch
buildarch_compat: x86_64: noarch
buildarch_compat: amd64: x86_64
buildarch_compat: ia32e: x86_64
I really hope that it will work on more systems than only on an Intell Dual core (x86_64), I could not test it on AMD/Athlon or other 64-bits systems.
Please don’t shoot me off when this is not working, I am not an expert.:shame:
Thanks!