Blob Blame History Raw
%global short_version 3.7

Name:             xcircuit
Version:          %{short_version}.44
Release:          8%{?dist}
Summary:          Electronic circuit schematic drawing program

License:          GPLv2
Group:            Applications/Engineering
URL:              http://opencircuitdesign.com/xcircuit

Source:           http://opencircuitdesign.com/xcircuit/archive/%{name}-%{version}.tgz
Source1:          %{name}.desktop
# http://opencircuitdesign.com/xcircuit/archive/xcircuit.xpm as 64x64
Source2:          %{name}.png

# Remove obsolete macro that breaks build with automake >= 1.12
Patch0:           remove-AM_C_PROTOTYPES.patch

BuildRequires:    tk-devel, desktop-file-utils, libtool, libXt-devel, m4
BuildRequires:    ghostscript-devel, ngspice, libXpm-devel, zlib-devel
BuildRequires:    chrpath

Requires:         tk coreutils gtk2

# Special FEL Gnome/KDE menu structure
Requires:         electronics-menu

%description
Xcircuit is a general-purpose drawing program and also a specific-purpose
CAD program for circuit schematic drawing and schematic capture.

%prep
# tarball includes unneeded symlink, so we firstly
# create a directory and expand tarball there.
%setup -q -T -c %{name}-%{version} -a 0

%patch0 -p0 -b .orig

#439604: TCL 8.5.1
sed -i "s|package require -exact|package require|" %{name}-%{version}/lib/tcl/tkcon.tcl

%build
cd %{name}-%{version}
libtoolize --force --copy
aclocal
automake --add-missing
autoconf


export WISH=/usr/bin/wish
export CFLAGS="$CFLAGS -g"

#01/08/09 Without --enable-asg \ because it's broken
%configure \
   --with-tcl=%{_libdir}      \
   --with-tk=%{_libdir}       \
   --with-tcllibs=%{_libdir}  \
   --with-tklibs=%{_libdir}   \
   --with-tclincls=%{_includedir} \
   --with-tkincls=%{_includedir}
make %{?_smp_mflags}


%install
cd %{name}-%{version}
make INSTALL="install -p" DESTDIR=%{buildroot} install
make install-man mandir="%{buildroot}%{_mandir}"

rm -rf examples/win32
chmod -x examples/*

# They stay
#W: xcircuit hidden-file-or-dir examples/python/.xcircuitrc
#W: xcircuit hidden-file-or-dir examples/.xcircuitrc

chmod -x %{buildroot}%{_prefix}/lib*/%{name}-%{short_version}/console.tcl

mkdir -p %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/
cp -p %{SOURCE2} %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/%{name}.png

sed -i "s|# xcircuit::library| xcircuit::library|" %{buildroot}%{_prefix}/lib*/%{name}-%{short_version}/xcstartup.tcl
sed -i '7 a\export TCLLIBPATH=%{_libdir}' %{buildroot}%{_bindir}/xcircuit


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

# removing rpath
chrpath --delete %{buildroot}%{_libdir}/%{name}-%{short_version}/xcircexec


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

%postun
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
%{_bindir}/update-desktop-database %{_datadir}/applications


%files
%doc %{name}-%{version}/{CHANGES,COPYRIGHT,README*,TODO}
%doc %{name}-%{version}/examples/
%{_bindir}/%{name}
%{_prefix}/lib*/%{name}-%{short_version}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/32x32/apps/%{name}.png
%{_mandir}/man1/%{name}.1.gz


%changelog
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.44-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Feb 27 2013 Mat Booth <fedora@matbooth.co.uk> - 3.7.44-7
- Fix invalid auto-generated dependency.

* Mon Feb 25 2013 Mat Booth <fedora@matbooth.co.uk> - 3.7.44-6
- Remove obsoleted macro for automake >= 1.12
- Fix FTBFS rhbz #914582

* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.7.44-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Oct 20 2012 Peter Robinson <pbrobinson@fedoraproject.org> 3.7.44-1
- Update to new 3.7.44 stable release
- Cleanup spec

* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.6.164-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.6.164-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.6.164-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

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

* Sun Nov 15 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.6.163-1
- new upstream stable release 3.6.163

* Sat Aug 01 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.6.161-1
- new upstream release 3.6.161

* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.30-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4.30-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Aug 15 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.4.30-1
- new upstream release

* Sun Apr 06 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.4.28-1
- closed #440387
- new upstream release
- opting the FEL related menu structure
- fixed and closed #439604: TCL 8.5.1

* Fri Apr 04 2008 Trond Danielsen <trondd@fedoraproject.org> - 3.4.27-2
- Added fix for bug #440387.

* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 3.4.27-3
- Autorebuild for GCC 4.3

* Sat Jan  5 2008 Alex Lancaster <alexlan[AT]fedoraproject org> - 3.4.27-2
- Rebuild for new Tcl 8.5

* Sun Oct 21 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.4.27-1
- new upstream release
- added coreutils and gtk as requires: #339771

* Fri Aug 24 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.4.26-23
- mass rebuild for fedora 8 - ppc

* Sun Aug 12 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.4.26-22
- fix for x86_64

* Sun Aug 12 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.4.26-21
- dump release

* Wed Aug 08 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.4.26-20
- patch %%{name}-3.4-memset.patch: Found memset with swapped arguments

* Mon Feb 26 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.4.26-19
- Rebuilt for rawhide

* Wed Jan 31 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 3.4.26-18
- Fixed presence in Gnome menu

* Wed Aug 30 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-17
- Rebuilt for FC6 devel

* Sun Aug 26 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 3.4.26-16
- Again.

* Sun Aug 26 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 3.4.26-15
- Fix tk and tcl libdir.

* Sat Aug 26 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-13
- Minor fixes to build properly under x86_64

* Sat Aug 26 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-12
- Minor fixes to build properly under x86_64

* Sat Aug 26 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-11
- Minor fixes to build properly under x86_64

* Sat Aug 26 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-10
- Opted %%{_prefix}/lib* prior to %%{_libdir}

* Sat Aug 26 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-9
- Added --libdir=%%{_libdir} to solve build error on x86_64

* Sat Aug 26 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-8
- Use of %%{__cp} -p to keep timestamp

* Sat Aug 26 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-7
- Fixed mandir

* Sat Aug 26 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-6
- Dropped patch xcircuit-3.4.26-xpm-gif.patch
- Removed useless Windows related files

* Fri Aug 25 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-5
- Added libXpm-devel as BR to prevent "image type "xpm" doesn't exist" error

* Fri Aug 25 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-4
- Added libXt-devel and zlib-devel as BR

* Fri Aug 25 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-3
- Fixed xcircuit.desktop and removed unneccessary installation for manual
- Used update-desktop-database in %%post and %%postun
- patch for "image type "xpm" doesn't exist"

* Thu Aug 24 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-2
- Fixed xcircuit.desktop, xcircuit.png
- Minor fixes

* Wed Aug 23 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 3.4.26-1
- Initial Package