[opensuse-packaging] please find flaws in my spec file, menu questions?
Internal evidence suggests the following spec file originally
came from kdevelop under mandriva. I am trying to fix it
so that it work with the major rpm distros and also with opensuse buildservice.
Please find fault with this spec file as I have modified it.
I am concerned with the macros:
%update_menus and %clean_menus in %post and %postun
Are these macros Mandrakeisms? what package do these macros depend on?
How should this be done for other distros?
Also are the fonts installed correctly in %post and %postun?
What other flaws can you find?
-------------cut here with a chain saw----------------------------
# This spec file was generated by KDevelop
# Please report any problem to KDevelop Team
On Oct 9 2007 03:22, Paul Elliott wrote:
What other flaws can you find?
Run rpmlint.
%define name skylendar %define version 1.7.0
Don't do this. It's horribly redundant.
Name: %{name} Version: %{version}
Just put it in here, and %name/%version is implicitly defined. Pcakman pkgs also suffers from this macrohyperdefinition disease.
Release: 3%{?dist} Vendor: C. Gros
Wrong place to put vendor in. Should be in the per-user config file.
License: GPL Summary: Astrology software for KDE Group: Sciences/Astronomy Packager: Paul Elliott
Wrong place to put Packager in.
BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: skylendar-%{version}.tar.bz2
{} for % are not needed (much like {} with $ in shell), though people seem to be fond of them. %_tmppath/%name-%version-build suffices.
Patch: pe.diff Autoreqprov: on
Redundant line, autoreqprov is on by default.
Requires: kdelibs3
Don't do this. Autoreqprov will add libkde.so and the like automatically. Only add Requires for when you depend on some non-.so files, e.g. perl modules, etc.
Requires: postgresql
Same.
BuildRequires:autoconf automake libtool gcc-c++
The first three are installed by default, so can be removed.
%if 0%{?mandriva_version} BuildRequires: mandrakelinux-create-kde-mdk-menu %endif
Obviously, suse ain't mandrive.
%if 0%{?suse_version} #suse here
Requires: postgresql-pl Requires: qt3-postgresql
See above.
%else %if 0%{?fedora_version} #fedora here Requires: postgresql-pl Requires: qt-postgreSQL
Same.
%else %if 0%{?mandriva_version} #mandriva here
Requires: postgresql-plpgsql Requires: libqt3-psql
Same.
%else #unknown here. Requires: postgresql-plpgsql Requires: libqt3-psql
Same.
%endif %endif %endif
Could unstack these %ifs into %if 0%mandrive do this %endif %if 0%suse do that %endif %if !0%mandrive%suse do else %endif
Autoreqprov: on
Duplicate.
%build export CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
CFLAGS/CXXFLAGS is implicitly set to RPM_OPT_FLAGS already if you don't set it.
./configure --prefix=%{_prefix} \ %if %{_lib} == lib64 --enable-libsuffix=64 \ %endif
Just use %configure. The libsuffix stuff sounds unneeded too.
make
Want to use make %{?jobs:-j%jobs}
%clean %__rm -rf %{buildroot}
I never got the point of %__rm when you could just use rm.
%post /sbin/ldconfig;\ %{_bindir}/installskydb;\ [ -x /usr/sbin/chkfontpath ] && /usr/sbin/chkfontpath -q -a %{datadir}/fonts/default/Type1;\ [ -x /usr/sbin/chkfontpath ] && /usr/sbin/chkfontpath -q -a %{datadir}/fonts/default/Type1/adobestd35;\ [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache %postun /sbin/ldconfig;\ if [ "$1" = "0" ]; then\ [ -x /usr/sbin/chkfontpath ] && /usr/sbin/chkfontpath -q -r %{datadir}/fonts/default/Type1;\ [ -x /usr/sbin/chkfontpath ] && /usr/sbin/chkfontpath -q -r %{datadir}/fonts/default/Type1/adobestd35;\ [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache\ fi
Away with the backslashes. --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (2)
-
Jan Engelhardt
-
Paul Elliott