File wcalc.spec of Package wcalc

#
# spec file for package wcalc
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           wcalc
%define libname lib%{name}
Version:        1.1
%define somajor 1
Release:        0
License:        GPL-2.0
Summary:        Analyses and synthesis of transmission lines
Group:          Productivity/Scientific/Electronics
Url:            http://sourceforge.net/projects/wcalc/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1:        %{name}.desktop
BuildRequires:  fdupes
BuildRequires:  gtk2-devel
BuildRequires:  ImageMagick
BuildRequires:  update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Wcalc is a tool for the analysis and synthesis of transmission line
structures and related components. Wcalc provides the ability to
analyze the electrical parameters of a particular structure based on
the physical dimensions and material parameters. The synthesis portion
calculates the required physical parameters to meet desired electrical
specifications. Wcalc includes several models and places an emphasis
on accuracy. Several frontends provide the user with several options
for its use.

%package -n     %{libname}%{somajor}
Summary:        Analyses and synthesis of transmission lines
Group:          System/Libraries

%description -n %{libname}%{somajor}
Wcalc library , allows developers ability to analyze the electrical parameters
of a particular structure based on the physical dimensions and material
parameters into other programs.

%package devel
Summary:        Analyses and synthesis of transmission lines
Group:          Development/Libraries/C and C++
Requires:       %{libname}%{somajor} = %{version}

%description devel
This package contains development files for developing applications
that use wcalc library.

%prep
%setup -q
cp %{SOURCE1} .

%build
%configure  \
            --disable-static \
            --disable-rpath \
            --disable-gtk1 \
            --enable-gtk2
make %{?_smp_mflags}

%install
%makeinstall

find %{buildroot}%{_libdir} -name '*.la' -type f -delete -print
%fdupes -s %{buildroot}%{_datadir}/wcalc-%{version}/

# create and install icon for desktop file
convert -strip win32/wcalc_icon_med.xpm wcalc.png
install -Dm 644 %{name}.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
install -Dm 644 %{name}.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
# remove mann for octave module
rm -rf %{buildroot}%{_mandir}/mann/

%suse_update_desktop_file %{name}

%clean
rm -rf %{buildroot}

%post -n %{libname}%{somajor} -p /sbin/ldconfig

%postun -n %{libname}%{somajor} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc README ChangeLog AUTHORS TODO
%{_bindir}/*
%{_mandir}/man1/*
%{_datadir}/wcalc-%{version}/
%{_libexecdir}/cgi-bin/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.png

%files -n %{libname}%{somajor}
%defattr(-,root,root)
%{_libdir}/%{libname}.so.%{somajor}*

%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/%{libname}.so
%{_libdir}/pkgconfig/*.pc

%changelog