Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > a35590b8f1abc44246de614da3d2a97d > files > 3

ngspice-21-3.cvs20100719.fc13.src.rpm

#
## To download development trunk
#
# cvs -d:pserver:anonymous@ngspice.cvs.sourceforge.net:/cvsroot/ngspice login
# cvs -z3 -d:pserver:anonymous@ngspice.cvs.sourceforge.net:/cvsroot/ngspice co -P ngspice
# tar cjf ~/rpmbuild/SOURCES/ngspice-rework-20.cvs`date '+%Y%m%d'`.tar.bz2 ngspice

Name:              ngspice
Version:           21
Release:           3.cvs20100719%{?dist}
Summary:           A mixed level/signal circuit simulator

License:           BSD
Group:             Applications/Engineering
URL:               http://ngspice.sourceforge.net

#Source0:           http://downloads.sourceforge.net/sourceforge/%{name}/ngspice%{version}_100620.zip
Source0:           ngspice-rework-20.cvs20100719.tar.bz2
Source1:           ngspice-21.pdf

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

# Ensured interoperability with xcircuit via Tcl

BuildRequires:     readline-devel, libXext-devel, libpng-devel, libICE-devel
BuildRequires:     libXaw-devel, mesa-libGL-devel, libXt-devel, automake, libtool
BuildRequires:     lyx
BuildRequires:     bison
BuildRequires:     byacc
BuildRequires:     flex ImageMagick

Obsoletes:         ngspice-doc < 20-4.cvs20100619
Provides:          ngspice-doc = %{version}-%{release}

%description
Ngspice is a general-purpose circuit simulator program.
It implements three classes of analysis:
- Nonlinear DC analyses
- Nonlinear Transient analyses
- Linear AC analyses

Ngspice implements the usual circuits elements, like resistors, capacitors,
inductors (single or mutual), transmission lines and a growing number of
semiconductor devices like diodes, bipolar transistors, mosfets (both bulk
and SOI), mesfets, jfet and HFET. Ngspice implements the EKV model but it
cannot be distributed with the package since its license does not allow to
redistribute EKV source code.

Ngspice integrates Xspice, a mixed-mode simulator built upon spice3c1 (and
then some tweak is necessary merge it with spice3f5). Xspice provides a
codemodel interface and an event-driven simulation algorithm. Users can
develop their own models for devices using the codemodel interface.

It could be used for VLSI simulations as well.


%package -n        tclspice
Summary:           Tcl/Tk interface for ngspice
Group:             Applications/Engineering
BuildRequires:     tk-devel
BuildRequires:     blt-devel

%description -n    tclspice
TclSpice is an improved version of Berkeley Spice designed to be used with
the  Tcl/Tk scripting language. The project is based upon the NG-Spice source
code base with many improvements.

%prep
%setup -q -n ngspice
cd ng-spice-rework

# make sure the examples are UTF-8...
for nonUTF8 in examples/tclspice/tcl-testbench4/selectfromlist.tcl \
               examples/tclspice/tcl-testbench1/testCapa.cir \
               examples/tclspice/tcl-testbench1/capa.cir ; do
  %{_bindir}/iconv -f ISO-8859-1 -t utf-8 $nonUTF8 > $nonUTF8.conv
  %{__mv} -f $nonUTF8.conv $nonUTF8
done

# rpmlint warnings
find examples/ -type f -name ".cvsignore" -exec rm -rf {} ';'
find src/ -type f -name "*.c" -exec chmod -x  {} ';'
find src/ -type f -name "*.h" -exec chmod -x  {} ';'

sed -i '15,/ /i\#include <ftedev.h>;' src/include/tclspice.h

%ifarch x86_64 sparc64 ppc64 amd64
sed -i "s|@XSPICEINIT@ codemodel @prefix@/lib|@XSPICEINIT@ codemodel %{_libdir}|" \
src/spinit.in
%endif

# Fix Tclspice's examples
sed -i \
"s|load \"../../../src/.libs/libspice.so\"|lappend auto_path \"%{_libdir}/tclspice\"\npackage require spice|" \
examples/tclspice/*/*.tcl
sed -i \
"s|load ../../../src/.libs/libspice.so|lappend auto_path \"%{_libdir}/tclspice\"\npackage require spice|" \
examples/tclspice/*/*.tcl
sed -i \
"s|spice::codemodel ../../src/xspice/icm/spice2poly|spice::codemodel %{_libdir}/tclspice/spice|" \
examples/tclspice/tcl-testbench4/tcl-testbench4.tcl

#{__libtoolize} --force --copy
#{__aclocal}
#{__automake} --add-missing
#{__autoconf}
./autogen.sh

%build
# ---- Manual ----------------------------------------------------------------
#cd ng-spice-manuals
#autoreconf  -Wno-portability --install
#./configure ; make
#cd ..

cd ng-spice-rework
cp -p %{SOURCE1} .

# ---- Tclspice ----------------------------------------------------------------
# Adding BLT support
export CFLAGS="%{optflags} -I%{_includedir}/blt"

# Make builddir for tclspice
%{__mkdir} -p tclspice
%{__cp} -Rl `ls . | grep -v tclspice` tclspice

# Configure tclspice
cd tclspice
sed -i "s|\#define NGSPICEDATADIR \"\`echo \$dprefix/share/ngspice\`\"|\#define NGSPICEDATADIR \"\`echo %{_libdir}/tclspice\`\"|" configure*
# fix ng-spice-manuals directory location
#sed -i  's|../ng-spice-manuals|../../ng-spice-manuals|g' manual/Makefile.am

%configure \
    --disable-xgraph \
    --enable-xspice \
    --enable-maintainer-mode \
    --enable-dependency-tracking \
    --enable-capzerobypass \
    --enable-cider \
    --enable-newpred \
    --enable-expdevices \
    --enable-intnoise \
    --enable-predictor \
    --enable-numparam \
    --enable-dot-global \
    --enable-shared \
    --enable-ndev \
%if 0%{?fedora}
    --with-tcl=%{_libdir}/tcl8.5/ \
   %else
    --with-tcl=%{_libdir}/ \
%endif
    --libdir=%{_libdir}/tclspice

%{__make}
cd ..
# ------------------------------------------------------------------------------

%configure \
    --disable-xgraph \
    --enable-xspice \
    --enable-maintainer-mode \
    --enable-dependency-tracking \
    --enable-capzerobypass \
    --enable-cider \
    --enable-newpred \
    --enable-expdevices \
    --enable-intnoise \
    --enable-predictor \
    --enable-numparam \
    --enable-dot-global \
    --enable-shared \
    --enable-ndev \
    --libdir=%{_libdir}

%{__make}
# %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}
cd ng-spice-rework

%{__make} INSTALL="install -p" install DESTDIR=%{buildroot}


# ---- Tclspice ----------------------------------------------------------------
# Tclspice : Make install
cd tclspice
%{__make} INSTALL="install -p" install DESTDIR=%{buildroot}
cd ..

%{__rm} -rf %{buildroot}%{_libdir}/tclspice/libspice.la
# ------------------------------------------------------------------------------


# Ensuring that all docs are under %%{_docdir}/%%{name}-%%{version}/
rm -rf   %{buildroot}%{_docdir}/%{name}-%{version}/
mkdir -p %{buildroot}%{_docdir}/%{name}-%{version}/
cp -pr examples/ %{buildroot}%{_docdir}/%{name}-%{version}/
cp -p ngspice-21.pdf %{buildroot}%{_docdir}/%{name}-%{version}/%{name}-%{version}.pdf
rm -rf %{buildroot}%{_docdir}/%{name}
cp -pr Stuarts_Poly_Notes FAQ DEVICES ANALYSES %{buildroot}%{_docdir}/%{name}-%{version}/
cp -pr AUTHORS COPYING README BUGS ChangeLog NEWS %{buildroot}%{_docdir}/%{name}-%{version}/


# pull as debuginfo
chmod +x %{buildroot}%{_libdir}/spice/*.cm
chmod +x %{buildroot}%{_libdir}/tclspice/spice/*.cm

%{__rm} -rf %{buildroot}%{_datadir}/info/dir

%check
cd ng-spice-rework/tests
#make check


%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/*
%{_datadir}/%{name}/
%{_libdir}/spice/
%{_mandir}/man1/*
%exclude %doc %{_docdir}/%{name}-%{version}/examples/tclspice
%doc %{_docdir}/%{name}-%{version}/

%files -n tclspice
%defattr(-,root,root,-)
%doc %{_docdir}/%{name}-%{version}/examples/tclspice
%{_libdir}/tclspice/


%changelog
* Sun Jul 11 2010  Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 21-2.cvs20100620
- added bison and byacc as BR

* Thu Jul 01 2010  Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 21-1.cvs20100620
- release -21 with BSIMSOI support for < 130nm designs

* Sat Jun 19 2010  Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 20-4.cvs20100619
- prerelease -21 with BSIMSOI support for < 130nm designs

* Tue Dec 8 2009  Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 20-3
- Fixed build on CentOS-5

* Tue Dec 8 2009  Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 20-2
- Improved interoperobability with xcircuit

* Mon Nov 16 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 20-1
- new upstream release

* Sun Aug 02 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 19-1
- new upstream release
- RHBZ #514484 A Long Warning Message (patched)
- RHBZ #511695 FTBFS ngspice-18-2.fc11

* Sat Feb 21 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 18-2
- x11 windows (help and plot) fixes #RHBZ 481525

* Sat Jan 10 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 18-1
- new upstream release

* Sun Jun 15 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-16
- Bugfix: #449409: FTBFS ngspice-17-14.fc9

* Fri Apr 18 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-15
- rebuild

* Fri Aug 24 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-13
- mass rebuild for fedora 8 - BuildID

* Sat Jul 08 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-12
- fixed ScriptletSnippets for Texinfo #246780
- moved documentations to -doc package

* Sat Mar 17 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-11
- droped patch: ngspice-bjt.patch, upstream will provide a better patch soon

* Sat Mar 17 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-10
- fixed bug #227519 in spec file - Ville Skyttä
- patch: ngspice-bjt.patch fixes the problem with bjt devices that have less than five nodes

* Tue Jan 09 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-9
- dropped --enable-cider since it requires non-opensource software
- dropped --enable-predictor from %%configure

* Tue Dec 19 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-8
- patch0 for xcircuit pipemode
- XCircuit can work as an ng-spice front-end
- fixed infodir to mean FE guidelines

* Sun Oct 15 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-7
- Fixed src/spinit.in for 64 bit

* Thu Oct 12 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-6
- Testing on 64 bit arch

* Mon Sep 04 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-5
- Added libXt-devel to include X headers

* Wed Aug 30 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> 17-4
- Fix to pass compiler flags in xgraph.

* Tue Aug 29 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-3
- Fixed BR and script-without-shellbang for debug file

* Mon Aug 28 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-2
- Fixed BRs and excluded libbsim4.a
- Removed duplicates and useless ldconfig from %%post

* Sun Aug 27 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> 17-1
- Initial Package for Fedora Extras