From dadccb1dfbf504818347fe4ac98e275f14536c60 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Wed, 29 Jun 2016 09:19:00 +0900 Subject: [PATCH] Don't get ngspice files overwritten by files from tclspice side (bug 1311869) - rearrange files entries between ngspice / tclspice - move tclspinit into tclspice - rename tclspice side cmpp - also don't overwrite ngspice header files by tclspice side --- ngspice.spec | 282 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 173 insertions(+), 109 deletions(-) diff --git a/ngspice.spec b/ngspice.spec index 89b8405..db02911 100644 --- a/ngspice.spec +++ b/ngspice.spec @@ -1,8 +1,8 @@ # Features in Fedora/Free Electronic Lab -# What else does this build do aside compiling ngspice ? -# - Ensures interoperability with xcircuit via Tcl -# - Ensures interoperability with mot-adms -# - Provides tclspice capabilities +# What else does this build do aside compiling ngspice ? +# - Ensures interoperability with xcircuit via Tcl +# - Ensures interoperability with mot-adms +# - Provides tclspice capabilities # Chitlesh Goorah # @@ -15,39 +15,46 @@ # Toggle the following declaration when using version controlled snapshots %global devel 0 -Name: ngspice -Version: 26 +Name: ngspice +Version: 26 %if %{?devel} -%global snap .20111129cvs +%global snap .20111129cvs %endif -Release: 3%{?snap}%{?dist} -Summary: A mixed level/signal circuit simulator +Release: 3.900%{?snap}%{?dist} +Summary: A mixed level/signal circuit simulator -License: BSD -Group: Applications/Engineering -URL: http://ngspice.sourceforge.net +License: BSD +Group: Applications/Engineering +URL: http://ngspice.sourceforge.net %if %{?devel} -Source0: ngspice-rework-%{version}%{snap}.tar.bz2 +Source0: ngspice-rework-%{version}%{snap}.tar.bz2 %else -Source0: https://downloads.sourceforge.net/project/ngspice/ng-spice-rework/%{version}/ngspice-%{version}.tar.gz -Source1: https://downloads.sourceforge.net/project/ngspice/ng-spice-rework/%{version}/ngspice-%{version}-manual.pdf +Source0: https://downloads.sourceforge.net/project/ngspice/ng-spice-rework/%{version}/ngspice-%{version}.tar.gz +Source1: https://downloads.sourceforge.net/project/ngspice/ng-spice-rework/%{version}/ngspice-%{version}-manual.pdf %endif -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: readline-devel +BuildRequires: libXext-devel +BuildRequires: libpng-devel +BuildRequires: libICE-devel +BuildRequires: libXaw-devel +BuildRequires: libGL-devel +BuildRequires: libXt-devel -BuildRequires: readline-devel, libXext-devel, libpng-devel, libICE-devel -BuildRequires: libXaw-devel, mesa-libGL-devel, libXt-devel, automake, libtool +BuildRequires: automake +BuildRequires: libtool %if %{?devel} -BuildRequires: lyx +BuildRequires: lyx %endif -BuildRequires: bison -BuildRequires: byacc -BuildRequires: flex ImageMagick -BuildRequires: mot-adms +BuildRequires: bison +BuildRequires: byacc +BuildRequires: flex +BuildRequires: ImageMagick +BuildRequires: mot-adms -Obsoletes: ngspice-doc < 20-4.cvs20100619 -Provides: ngspice-doc = %{version}-%{release} +Obsoletes: ngspice-doc < 20-4.cvs20100619 +Provides: ngspice-doc = %{version}-%{release} %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -73,15 +80,15 @@ develop their own models for devices using the codemodel interface. It can 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 +%package -n tclspice +Summary: Tcl/Tk interface for ngspice +Group: Applications/Engineering +BuildRequires: tk-devel +BuildRequires: blt-devel -%description -n tclspice +%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 +the Tcl/Tk scripting language. The project is based upon the NG-Spice source code base with many improvements. %prep @@ -93,40 +100,46 @@ cd ng-spice-rework %endif # 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 ChangeLog; do - %{_bindir}/iconv -f ISO-8859-1 -t utf-8 $nonUTF8 > $nonUTF8.conv - %{__mv} -f $nonUTF8.conv $nonUTF8 +for nonUTF8 in \ + examples/tclspice/tcl-testbench4/selectfromlist.tcl \ + examples/tclspice/tcl-testbench1/testCapa.cir \ + examples/tclspice/tcl-testbench1/capa.cir \ + ChangeLog \ + %{nil} +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 {} ';' -find src/ -type f -name "*.l" -exec chmod -x {} ';' -find src/ -type f -name "*.y" -exec chmod -x {} ';' - +find src/ -type f -name "*.c" -exec chmod -x {} ';' +find src/ -type f -name "*.h" -exec chmod -x {} ';' +find src/ -type f -name "*.l" -exec chmod -x {} ';' +find src/ -type f -name "*.y" -exec chmod -x {} ';' %ifarch x86_64 sparc64 ppc64 amd64 sed -i "s|@XSPICEINIT@ codemodel @prefix@/@libname@|@XSPICEINIT@ codemodel %{_libdir}|" \ -src/spinit.in + 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 + '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 + '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 + 's|spice::codemodel ../../src/xspice/icm/spice2poly|spice::codemodel %{_libdir}/tclspice/spice|' \ + examples/tclspice/tcl-testbench4/tcl-testbench4.tcl # Fixed minor CVS build -sed -i "s|AM_CPPFLAGS =|AM_CPPFLAGS = -I\$(top_srcdir)/src/maths/ni |" src/spicelib/analysis/Makefile.am +sed -i \ + "s|AM_CPPFLAGS =|AM_CPPFLAGS = -I\$(top_srcdir)/src/maths/ni |" \ + src/spicelib/analysis/Makefile.am +export ACLOCAL_FLAGS=-Im4 ./autogen.sh --adms chmod +x configure @@ -135,7 +148,7 @@ chmod +x configure %if %{?devel} # ---- Manual ---------------------------------------------------------------- cd ng-spice-manuals -autoreconf -Wno-portability --install +autoreconf -Wno-portability --install %configure ; make cd .. @@ -152,10 +165,14 @@ export CFLAGS="%{optflags} -I%{_includedir}/blt" # Configure tclspice cd tclspice -sed -i "s|\#define NGSPICEDATADIR \"\`echo \$dprefix/share/ngspice\`\"|\#define NGSPICEDATADIR \"\`echo %{_libdir}/tclspice\`\"|" configure* +sed -i \ + 's|\#define NGSPICEDATADIR "\`echo \$dprefix/share/ngspice\`"|\#define NGSPICEDATADIR "\`echo %{_libdir}/tclspice\`"|' \ + configure* # fix ng-spice-manuals directory location %if %{?devel} -sed -i 's|../ng-spice-manuals|../../ng-spice-manuals|g' manual/Makefile.am +sed -i \ + 's|../ng-spice-manuals|../../ng-spice-manuals|g' \ + manual/Makefile.am %endif # direct access to Tcl_Interp->result deprecated in tcl8.6, @@ -163,73 +180,99 @@ sed -i 's|../ng-spice-manuals|../../ng-spice-manuals|g' manual/Makefile.am export CPPFLAGS=-DUSE_INTERP_RESULT %configure \ - --disable-xgraph \ - --enable-adms \ - --enable-xspice \ - --enable-maintainer-mode \ - --enable-dependency-tracking \ - --enable-capzerobypass \ - --enable-cider \ - --enable-newpred \ - --enable-expdevices \ - --enable-intnoise \ - --enable-openmp \ - --enable-predictor \ - --enable-numparam \ - --enable-dot-global \ - --enable-shared \ - --enable-ndev \ - --with-readline=yes \ - --with-tcl=%{_libdir}/ \ - --libdir=%{_libdir}/tclspice + --disable-silent-rules \ + --disable-xgraph \ + --enable-adms \ + --enable-xspice \ + --enable-maintainer-mode \ + --enable-dependency-tracking \ + --enable-capzerobypass \ + --enable-cider \ + --enable-newpred \ + --enable-expdevices \ + --enable-intnoise \ + --enable-openmp \ + --enable-predictor \ + --enable-numparam \ + --enable-dot-global \ + --enable-shared \ + --enable-ndev \ + --with-readline=yes \ + --with-tcl=%{_libdir}/ \ + --libdir=%{_libdir}/tclspice \ + %{nil} %{__make} cd .. # ------------------------------------------------------------------------------ %configure \ - --disable-xgraph \ - --enable-adms \ - --enable-xspice \ - --enable-maintainer-mode \ - --enable-dependency-tracking \ - --enable-capzerobypass \ - --enable-cider \ - --enable-newpred \ - --enable-expdevices \ - --enable-intnoise \ - --enable-openmp \ - --enable-predictor \ - --enable-numparam \ - --enable-dot-global \ - --enable-shared \ - --enable-ndev \ - --with-readline=yes \ - --libdir=%{_libdir} + --disable-silent-rules \ + --disable-xgraph \ + --enable-adms \ + --enable-xspice \ + --enable-maintainer-mode \ + --enable-dependency-tracking \ + --enable-capzerobypass \ + --enable-cider \ + --enable-newpred \ + --enable-expdevices \ + --enable-intnoise \ + --enable-openmp \ + --enable-predictor \ + --enable-numparam \ + --enable-dot-global \ + --enable-shared \ + --enable-ndev \ + --with-readline=yes \ + --libdir=%{_libdir} \ + %{nil} %{__make} # %{?_smp_mflags} %install -%{__rm} -rf %{buildroot} %if %{?devel} cd ng-spice-rework %endif -%{__make} INSTALL="install -p" install DESTDIR=%{buildroot} +# Once install to the temp dir +rm -rf $(pwd)/INST-NGSPICE +%{__make} INSTALL="install -p" install DESTDIR=$(pwd)/INST-NGSPICE + # ---- Tclspice ---------------------------------------------------------------- # Tclspice : Make install cd tclspice -%{__make} INSTALL="install -p" install DESTDIR=%{buildroot} +# Once install to the temp dir +rm -rf $(pwd)/INST-TCLSPICE +%{__make} INSTALL="install -p" install DESTDIR=$(pwd)/../INST-TCLSPICE cd .. -%{__rm} -rf %{buildroot}%{_libdir}/tclspice/libspice.la +# Clean up unneeded / duplicate files also installed from ngspice +pushd INST-TCLSPICE +rm -rf ./%{_datadir}/ngspice/include/ +# see bug 1311869 +rm -f ./%{_datadir}/ngspice/scripts/spinit +# binary differ +mv .%{_bindir}/cmpp{,-tclspice} +popd + +# Install +cp -a INST-NGSPICE/* %{buildroot} +cp -a INST-TCLSPICE/* %{buildroot} + +%{__rm} -rf \ + %{buildroot}%{_libdir}/tclspice/libspice.la # ------------------------------------------------------------------------------ # ADMS support +# It seems that the below is not needed, compiled into binary already +# (mtasaka, 20160628) +%if 0 cp -pr ./src/spicelib/devices/adms/ %{buildroot}%{_datadir}/%{name} +%endif # Ensuring that all docs are under %%{_pkgdocdir} mkdir -p %{buildroot}%{_pkgdocdir} @@ -240,16 +283,24 @@ cp -p ../ng-spice-manuals/manual.pdf %{buildroot}%{_pkgdocdir}/%{name}-%{version cp -p %{SOURCE1} %{buildroot}%{_pkgdocdir}/%{name}-%{version}.pdf %endif -cp -pr Stuarts_Poly_Notes FAQ DEVICES ANALYSES %{buildroot}%{_pkgdocdir} -cp -pr AUTHORS README* BUGS ChangeLog NEWS %{buildroot}%{_pkgdocdir} - +cp -a \ + Stuarts_Poly_Notes \ + FAQ \ + DEVICES \ + ANALYSES \ + %{buildroot}%{_pkgdocdir} +cp -a \ + AUTHORS \ + README* \ + BUGS \ + ChangeLog \ + NEWS \ + %{buildroot}%{_pkgdocdir} # pull as debuginfo chmod +x %{buildroot}%{_libdir}/ngspice/*.cm chmod +x %{buildroot}%{_libdir}/tclspice/ngspice/*.cm -%{__rm} -rf %{buildroot}%{_datadir}/info/dir - %check %if %{?devel} cd ng-spice-rework/tests @@ -258,27 +309,40 @@ cd tests %endif #make check - -%clean -%{__rm} -rf %{buildroot} - %files -%defattr(-,root,root,-) %{_bindir}/* +%exclude %{_bindir}/cmpp-tclspice %{_datadir}/%{name}/ +%exclude %{_datadir}/%{name}/scripts/tclspinit %{_libdir}/ngspice/ + %{_mandir}/man1/* %exclude %{_pkgdocdir}/examples/tclspice -%doc %{_pkgdocdir} +%doc %{_pkgdocdir} %license COPYING -%files -n tclspice -%defattr(-,root,root,-) -%doc %{_pkgdocdir}/examples/tclspice +%files -n tclspice +%{_bindir}/cmpp-tclspice +%doc %{_pkgdocdir}/examples/tclspice %{_libdir}/tclspice/ - +%dir %{_datadir}/ngspice +%dir %{_datadir}/%{name}/scripts/ +%{_datadir}/%{name}/scripts/tclspinit %changelog +* Tue Jun 28 2016 Mamoru TASAKA - 26-4 +- Don't get ngspice files overwritten by files from tclspice side + (bug 1311869) +- rearrange files entries between ngspice / tclspice + - move tclspinit into tclspice + - rename tclspice side cmpp + - also don't overwrite ngspice header files by tclspice side + +* Mon Jun 27 2016 Mamoru TASAKA +- spec file clean up +- Don't install adms source and compiled .o objects, they are + already linked into ngspice and tclspice shared library + * Thu Feb 04 2016 Fedora Release Engineering - 26-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild