Blob Blame History Raw
Name:             magic
Version:          8.0.210
Release:          1%{?dist}
Summary:          A very capable VLSI layout tool

License:          MIT
Group:            Applications/Engineering
URL:              http://opencircuitdesign.com/%{name}/index.html

Source:           http://opencircuitdesign.com/%{name}/archive/%{name}-%{version}.tgz
Source1:          %{name}.desktop
Source2:          %{name}.png
Patch0:           %{name}-verbose.patch
Patch1:           %{name}-7.4.35-64bit.patch
Patch2:           %{name}-8.0.174-format-string.patch

BuildRequires:    libXi-devel libXmu-devel libXext-devel mesa-libGLU-devel blt tcsh
BuildRequires:    desktop-file-utils tk-devel mesa-libGLw-devel mesa-libGL-devel m4

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

%description
Magic is a venerable VLSI layout tool. Magic VLSI remains
popular with universities and small companies.

Magic is widely cited as being the easiest tool to use for
circuit layout, even for people who ultimately rely on commercial
tools for their product design flow.

%package doc
Summary:          Documentation for magic, A very capable VLSI layout tool
Group:            Documentation
Requires:         %{name} = %{version}-%{release}


%description doc
This package contains the documentation of magic in the postscript
and some tutorials.


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

rm -rf readline

sed -i.cflags -e 's|CFLAGS=.*CFLAGS|:|' configure

sed -i "s|/usr/local/bin/tclsh|%{_bindir}/tclsh|" tcltk/strip_reflibs.tcl
sed -i "s|package require -exact|package require|" tcltk/tkcon.tcl

%patch0 -p0 -b .verbose
%patch2 -p1 -b .format

%if x%{?__isa_bits} == x64
%patch1 -p0 -b .64bit
%endif

%build

export WISH=%{_bindir}/wish

cd %{name}-%{version}

%configure --with-gnu-ld\
   --with-tcl=%{_libdir}     \
   --with-tk=%{_libdir}      \
   --with-tcllibs=%{_libdir} \
   --with-tklibs=%{_libdir} \
	%{nil}

#%make %%{?_smp_mflags}
# Parallel make _silently_ fails
make -j1

%install
cd %{name}-%{version}
make install                \
    DESTDIR=%{buildroot}         \
    INSTALL="%{__install} -c -p" \
    CP="%{__cp} -p"

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

# applying timestamps
cp -pr README* TODO VERSION scmos/ ..

cp -pr %{buildroot}%{_libdir}/%{name}/{doc/,tutorial} ..
rm -rf %{buildroot}%{_libdir}/%{name}/{doc/,tutorial}

rm -f doc/html/Makefile

chmod -x %{buildroot}%{_libdir}/%{name}/tcl/console.tcl

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


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

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


%files
%doc README* TODO VERSION
%{_bindir}/%{name}
%{_bindir}/ext2sim
%{_bindir}/ext2spice
%{_libdir}/%{name}/
%{_mandir}/man?/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png

%files doc
%doc doc/ tutorial/ scmos/


%changelog
* Wed Oct 14 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 8.0.210-1
- 8.0.210
- Remove unneeded lines from patches
- Correct license

* Fri Oct  9 2015 Mamoru TASAKA <mtasaka@fedoraproject.org> - 8.0.174-4
- Fix isa_bits conditional
- Patch for -Werror=format-security
- Build with -j1, parallel build currently fails

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.0.174-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.0.174-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Tue Jul  8 2014 Peter Robinson <pbrobinson@fedoraproject.org> 8.0.174-1
- 8.0.174 
- Generic 64bit platform detection

* Wed Jun 18 2014 Yaakov Selkowitz <yselkowi@redhat.com> - 8.0.60-9
- Fix FTBFS with -Werror=format-security (#1037190, #1106151)
- Apply 64bit patch on aarch64
- Cleanup spec

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8.0.60-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 21 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 8.0.60-7
- Rebuilt for https://fedoraproject.org/wiki/Changes/f21tcl86

* Wed Jul 31 2013 Ville Skyttä <ville.skytta@iki.fi> - 8.0.60-6
- Drop unneeded %%install doc dir creation.

* Tue Mar 16 2010 Thibault North <tnorth [AT] fedoraproject DOT org> - 8.0.60-1
- new upstream release with minor fixes

* Fri Aug 28 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 8.0.54-1
- new upstream release

* Wed Jan 07 2009 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 7.5.169-1
- new upstream release