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

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

Source:           http://opencircuitdesign.com/%{name}/archive/%{name}-%{version}.tgz
Source1:          %{name}.desktop
Patch0:           %{name}-verbose.patch

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

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

# due to no upstream icon for magic
Requires:         redhat-artwork tcsh

%description
Magic is a venerable VLSI layout tool, written in the 1980's at
Berkeley by John Ousterhout, now famous primarily for writing
the scripting interpreter language Tcl. Due largely in part to
its liberal Berkeley open-source license, magic has remained
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}
%{__sed} -i.cflags -e 's|CFLAGS=.*CFLAGS|:|' configure

%patch0 -p0 -b .verbose

%build

if [ -d %{_prefix}/lib64 ] ; then
   SUF=64
else
   SUF=
fi

WISH=%{_bindir}/wish
export WISH

cd %{name}-%{version}

%configure \
   --with-tcl=%{_prefix}/lib$SUF     \
   --with-tk=%{_prefix}/lib$SUF      \
   --with-tcllibs=%{_prefix}/lib$SUF \
   --with-tklibs=%{_prefix}/lib$SUF

scripts/makedbh database/database.h.in database/database.h

%{__make} %{?_smp_mflags}

%install
%{__rm} -rf %{buildroot}

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

desktop-file-install --vendor fedora            \
    --add-category X-Fedora                     \
    --add-category "Engineering"                \
    --dir %{buildroot}%{_datadir}/applications/ \
    %{SOURCE1}

# applying timestamps
%{__cp} -p README* TODO VERSION ..

%{__mkdir} -p %{buildroot}%{_docdir}/%{name}-%{version}

%{__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

%post
%{_bindir}/update-desktop-database %{_datadir}/applications || :

%postun
%{_bindir}/update-desktop-database %{_datadir}/applications || :

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


%files
%defattr(-,root,root,-)
%doc README* TODO VERSION
%{_bindir}/%{name}
%{_bindir}/spice2sim
%{_libdir}/%{name}/
%{_mandir}/man?/*
%{_datadir}/applications/fedora-%{name}.desktop

%files doc
%doc doc/ tutorial/
%defattr(-, root, root, -)


%Changelog
* Thu Jun 21 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 7.4.35-2
- fix desktop file #241443

* Wed Feb 22 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 7.4.35-1
- New upstream release
- added mimetype

* Wed Feb 22 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 7.4.33-6
- Fixed shebang

* Mon Feb 05 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 7.4.33-5
- fixed documentation locations

* Sat Feb 03 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 7.4.33-4
- CFLAGS fix improved
- tarball includes unneeded symlink, firstly create a directory and expand tarball there.
- added timestamps support

* Thu Feb 01 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 7.4.33-3
- fix for CFLAGS

* Sat Jan 20 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 7.4.33-2
- Fix presence of magic in gnome menu

* Fri Jan 19 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 7.4.33-1
- Initial package for Fedora Extras.