Mailinglist Archive: opensuse-packaging (109 mails)

< Previous Next >
[opensuse-packaging] please find flaws in my spec file, menu questions?
  • From: Paul Elliott <pelliott@xxxxxx>
  • Date: Tue, 9 Oct 2007 03:22:18 -0500
  • Message-id: <20071009082217.GA1981@xxxxxx>
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 <kdevelop-devel@xxxxxxxxxxxx> 
# Thanks to Matthias Saou for his explanations on http://freshrpms.net/docs/fight.html

#Changed by Paul elliott so will work with opensuse buildservice

#norootforbuild

%if 0%{?suse_version}
%if 0%{?suse_version} < 1030
%define _prefix   /opt/kde3
%endif
%endif

%define name skylendar
%define version 1.7.0

Name: %{name}
Version: %{version}
Release: 3%{?dist}
Vendor: C. Gros
License: GPL
Summary: Astrology software for KDE
Group: Sciences/Astronomy
Packager: Paul Elliott
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source: skylendar-%{version}.tar.bz2
Patch:  pe.diff
Autoreqprov:    on
Requires: kdelibs3
Requires: postgresql
Requires: perl
Requires: perl-XML-DOM
BuildRequires:autoconf automake libtool gcc-c++
BuildRequires: kdelibs3-devel
%if 0%{?suse_version}
%if 0%{?suse_version} == 1000
#intltool requires perl(XML::Parser) but opensuse 10.0 does not
#know this
BuildRequires: p_xmlpar
%endif
%endif

%if 0%{?mandriva_version}
BuildRequires: mandrakelinux-create-kde-mdk-menu
%endif


%if 0%{?suse_version}
#suse here

Requires: postgresql-pl
Requires: qt3-postgresql

%else
%if 0%{?fedora_version}
#fedora here
Requires: postgresql-pl
Requires: qt-postgreSQL

%else
%if 0%{?mandriva_version}
#mandriva here

Requires: postgresql-plpgsql
Requires: libqt3-psql

%else
#unknown here.
Requires: postgresql-plpgsql
Requires: libqt3-psql

%endif
%endif
%endif



Autoreqprov:    on

%description
Skylendar is an astrology program for KDE3, with SQL database management.

%if 0%{?suse_version}
%debug_package
%endif

%prep

%setup
%patch -p1

#remove next 2 lines when it is verified that it works wo them.
#I do not have 64 bit system for testing.
%if 0%{?suse_version}
#suse here
%{?suse_update_libdir:%{suse_update_libdir}}
%{?suse_update_config:%{suse_update_config -f}}
%endif

%build
export CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
./configure --prefix=%{_prefix}   \
%if %{_lib} == lib64
   --enable-libsuffix=64 \
%endif

make

%install

make DESTDIR=$RPM_BUILD_ROOT install

mkdir -p $RPM_BUILD_ROOT%{_menudir}
%if 0%{?mandriva_version}
kdedesktop2mdkmenu.pl %{name} Sciences/Astronomy  $RPM_BUILD_ROOT/%{_datadir}/applications/kde/%{name}.desktop $RPM_BUILD_ROOT/%{_menudir}/%{name} kde
%else
cp src/%{name}.desktop $RPM_BUILD_ROOT/%{_datadir}/applications/kde/%{name}.desktop
%endif
mkdir -p $RPM_BUILD_ROOT%{perl_vendorlib}
cp src/skif.pm $RPM_BUILD_ROOT%{perl_vendorlib}

%clean
%__rm -rf %{buildroot}

%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

%update_menus

%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

%clean_menus

%files
%defattr(-, root, root)
%doc AUTHORS COPYING ChangeLog README TODO
%{_bindir}/*
#%{_libdir}/menu/*
%{_libdir}/menu/
%{_datadir}/apps/%{name}
%{_datadir}/applications/kde/%{name}.desktop
%{_datadir}/doc/*
%{_datadir}/icons/*
%{_datadir}/locale/*
%{_datadir}/mimelnk/*
%{perl_vendorlib}/skif.pm

%changelog
* Tue Oct 09 2007 Paul Elliott <pelliott@xxxxxx> - 1.7.9-3
- norootforbuild indicates can be build wo root privs.
* Fri Oct 05 2007 Paul Elliott <pelliott@xxxxxx> - 1.7.0-2
- Change BuildRequires for SuSE
- 64 bit conditional 
-    --enable-libsuffix=64 if 64 bit
- prefix for opensuse.
- get rid of hardcoded /usr
- makeinstall macro not good for fedora
- %{_libdir}/menu/ is a empty directory.
- patch pe.diff fixxes hardcode /usr/share/icons/hicolor/32x32/mimetypes/skif.png
- which ignores prefix

------------cut here with a chain saw------------------------

-- 
Paul Elliott                       1(512)837-1096
pelliott@xxxxxx                    PMB 181, 11900 Metric Blvd Suite J
http://www.io.com/~pelliott/pme/   Austin TX 78758-3117
< Previous Next >
Follow Ups