swt2c / rpms / gspiceui

Forked from rpms/gspiceui 5 years ago
Clone
Blob Blame History Raw
Name:          gspiceui
Version:       0.9.98
Release:       6%{?dist}
Summary:       A frontend to Spice circuit similators

Group:         Applications/Engineering
License:       GPLv2+
URL:           http://sourceforge.net/projects/gspiceui
Source0:       http://downloads.sourceforge.net/%{name}/%{name}-v%{version}.tar.gz
Source1:       %{name}.desktop
Source2:       %{name}-32x32.xpm

BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires: wxGTK-devel desktop-file-utils
Requires:      ngspice geda-gnetlist geda-gschem
Requires:      electronics-menu
#Requires:      gwave

ExcludeArch:   ppc64

%description
GspiceUI is listed among the Fedora Electronic Lab (FEL) packages.

GNU Spice GUI is intended to provide a GUI to freely available
Spice electronic cicuit simulators eg.GnuCAP, Ng-Spice.
It uses gNetList to convert schematic files to net list files
and gWave to display simulation results.
gSchem is used as the schematic generation/viewing tool.

%prep
%setup -q -n %{name}-v%{version}

#wrong-file-end-of-line-encoding
sed -i 's/\r//' lib/*/*.mod

#spurious-executable-perm
chmod 0644 lib/*/*.mod
chmod 0644 sch/*/*.sch

sed -i "s|/share/gspiceui/html/gSpiceUI.html|/share/doc/%{name}-%{version}/gSpiceUI.html|g" src/main/HelpTasks.cpp

sed -i "s|/usr/X11R6/include|/usr/include/X11/|" src/Makefile

%build
%{__make} %{?_smp_mflags} CC="%{__cxx} $RPM_OPT_FLAGS" GSPICEUI_DBG=0 GSPICEUI_WXLIB=2.8


%install
rm -rf %{buildroot}

install -d %{buildroot}%{_bindir}
install -pm 755 bin/%{name} %{buildroot}%{_bindir}/%{name}

install -d %{buildroot}%{_mandir}/man1/
install -pm 644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1

# Add/Manage desktop file
install -d %{buildroot}%{_datadir}/icons/hicolor/32x32/apps
install -d %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
install -pm 0644 %{SOURCE2} \
    %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.xpm
install -pm 0644 src/icons/%{name}-48x48.xpm \
    %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/%{name}.xpm

desktop-file-install --vendor "" \
    --dir %{buildroot}%{_datadir}/applications \
    %{SOURCE1}


#
# Adding gspiceui in the geda symbols directory structure
#

install -d %{buildroot}%{_datadir}/gEDA/sym/%{name}
cp -p lib/sym/* %{buildroot}%{_datadir}/gEDA/sym/%{name}

#
# Creating a gafrc file which can automatically load those sym from the
# above directory structure
#
mkdir -p examples
cat > examples/gafrc << EOF
; gspiceui documentation symbols
(component-library "%{_datadir}/gEDA/sym/%{name}")
EOF


#
# Preparing examples
#
cp -pr lib/ examples
cp -pr sch/ examples

#
# Cleaning %%doc files
#
rm -f examples/*/Makefile
rm -rf examples/lib/sym


%clean
rm -rf %{buildroot}


%post
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :

%postun
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :



%files
%defattr(-,root,root,-)
%doc Authors License ReadMe ChangeLog ToDo
%doc examples html/gSpiceUI.html
%{_bindir}/%{name}
%{_datadir}/icons/hicolor/??x??/apps/*.xpm
%{_datadir}/applications/%{name}.desktop
%{_mandir}/man1/%{name}.1.gz
%{_datadir}/gEDA/sym/%{name}


%changelog
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.98-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Oct 25 2011 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT com> - 0.9.98-5
- Commented Requires gwave

* Tue Oct 18 2011 Shakthi Kannan <shakthimaan@fedoraproject.org> - 0.9.98-4
- Added Requires gwave

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.98-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jul 14 2010 Dan HorĂ¡k <dan@danny.cz> - 0.9.98-2
- rebuilt against wxGTK-2.8.11-2

* Sun Oct 25 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT com> - 0.9.98-1
- Upstream Sources now includes missing opamp-3.sym
- upstream release 0.9.98

* Mon Sep 14 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT com> - 0.9.97-1
- New upstream release
- Added missing opamp-3.sym and corrected menu icon

* Thu Sep 03 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT com> - 0.9.65-6
- Fixes RHBZ #512076 - Build with wxGTK-devel not compat-wxGTK26-devel
- Added documentations: schematics and spice models

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.65-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.65-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Jul 31 2008 Xavier Lamien <lxtnow[at]gmail.com> - 0.9.65-3
- Excluded ppc64 (gwave is not available on ppc64).

* Sat Jul 26 2008 Xavier Lamien <lxtnow[at]gmail.com> - 0.9.65-2
- Fix typo on desktop-file-install.

* Mon Jul 14 2008 Xavier Lamien <lxtnow[at]gmail.com> - 0.9.65-1
- Update release.

* Mon Dec 31 2007 Xavier Lamien < lxtnow[at]gmail.com > - 0.9.55-2
- Fixed typo in Requires.
- Improved %%description and desktop file.
- Fixed WxGTK config use.

* Sun Dec 30 2007 Xavier Lamien < lxtnow[at]gmail.com > - 0.9.55-1
- Updated Release.
- Built against WxGTK-2.6 libs.

* Tue Jul 04 2007 Xavier Lamien < lxtnow[at]gmail.com > - 0.8.90-2
- Enabled the fix that make it honor RPM_OPT_FLAGS.

* Wed Jul 04 2007 Xavier Lamien < lnxtnow[at]gmail.com > - 0.8.90-1
- Initial RPM Release.