Blob Blame History Raw
%define        prefix    %{_libdir}/%{name}
%define        snapshot  20070718

Name:          alliance
Version:       5.0
Release:       7.%{snapshot}snap%{?dist}
Summary:       Alliance VLSI CAD Sytem

License:       GPL
Group:         Applications/Engineering

Source:        http://www-asim.lip6.fr/pub/alliance/distribution/5.0/%{name}-%{version}-%{snapshot}.tar.gz
URL:           http://www-asim.lip6.fr/recherche/alliance/

Patch1:        alliance-examples.patch
Patch2:        alliance-run.patch
Patch3:        alliance-perms.patch
Patch4:        alliance-tutorials.patch
Patch5:        alliance-log3.patch

Source1:       xsch.desktop
Source2:       dreal.desktop
Source3:       xpat.desktop
Source4:       xfsm.desktop
Source5:       xvpn.desktop
Source6:       graal.desktop

Source7:       alliance.fedora

# Chitlesh's donated pictures to alliance
Source8:       graal.png
Source9:       dreal.png
Source10:      xvpn.png
Source11:      xfsm.png
Source12:      xpat.png
Source13:      xsch.png

BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: lesstif-devel libXt-devel byacc desktop-file-utils bison
BuildRequires: libXp-devel libXpm-devel libstdc++-devel flex m4
BuildRequires: transfig ghostscript tetex-latex


%description
Alliance is a complete set of free CAD tools and portable libraries for
VLSI design. It includes a VHDL compiler and simulator, logic synthesis
tools, and automatic place and route tools.

A complete set of portable CMOS libraries is provided, including a RAM
generator, a ROM generator and a data-path compiler.

Alliance is the result of more than ten years effort spent at ASIM department
of LIP6 laboratory of the Pierre et Marie Curie University (Paris VI, France).

Alliance has been used for research projects such as the 875 000 transistors
StaCS superscalar microprocessor and 400 000 transistors IEEE Gigabit HSL
Router.

You are kindly requested to mention
" Designed with alliance (c) LIP6, Université Pierre et Marie Curie"
so as to spread the word about "alliance CAD system" and its development team.

Alliance provides CAD tools covering most of all the digital design flow:

 * VHDL Compilation and Simulation
 * Model checking and formal proof
 * RTL and Logic synthesis
 * Data-Path compilation
 * Macro-cells generation
 * Place and route
 * Layout edition
 * Netlist extraction and verification
 * Design rules checking


%package doc
Summary:      Alliance VLSI CAD Sytem - Documentations
Group:        Applications/Engineering
Requires:     %{name} = %{version}-%{release}
Requires:     gnuplot


%description doc
Documentation and tutorials for the Alliance VLSI CAD Sytem.


%prep
%setup -q

%{__cp} -p %{SOURCE7} .

# using the formal %%{_sysconfdir} in favor of $${ALLIANCE_TOP}/etc
sed -i "s|sysconfdir='\${prefix}/etc'|sysconfdir=%{_sysconfdir}/%{name}|" configure

sed -i "s|\${ALLIANCE_TOP}/etc|%{_sysconfdir}/%{name}|" {xfsm,xvpn,xpat,xsch}/src/Makefile*

sed -i "s|etcdir=\$(prefix)/etc|etcdir=%{_sysconfdir}/%{name}|"                          \
    {attila,dreal,elp,graal,mbkspice,rds,scapin,sea,xfsm,xvpn,xpat,xsch}/etc/Makefile.am

sed -i "s|etcdir = \$(prefix)/etc|etcdir = %{_sysconfdir}/%{name}|" \
    {attila,dreal,elp,graal,mbkspice,rds,scapin,sea,xfsm,xvpn,xpat,xsch}/etc/Makefile.in

sed -i "s|etcdir=\$(prefix)/etc|etcdir=%{_sysconfdir}/profile.d|" distrib/etc/Makefile.am
sed -i "s|etcdir = \$(prefix)/etc|etcdir = %{_sysconfdir}/profile.d|" distrib/etc/Makefile.in


%patch1 -p0 -b .examples
%patch2 -p0 -b .run
# fixing permissions
%patch3 -p0 -b .perms


##  Updating old tutorials
%patch4 -p0 -b .tutorials

pushd documentation/tutorials
    for folder in place_and_route/tex simulation/tex start synthesis/tex; do
        pushd $folder
        %{__make}
        popd
    done
popd

#conflicts with man-pages and is a duplicate of log.1.gz
%patch5 -p0 -b .duplicate


# removing useless copyrighted (by Cadence) lines from the examples
# and even in alliance-run
# https://www-asim.lip6.fr/wws/arc/alliance-users/2007-07/msg00006.html
pushd documentation/alliance-examples
    for cadence in adder4/adder4.ioc divcas4/divcas4.ioc mipsR3000/sce/mips_core.ioc \
                   amd2901/amd2901_core.ioc amd2901-vasy/amd2901.ioc ; do
        sed -i "s|#      Copyright (c) 1997 by Cadence. All rights reserved.|#|"  $cadence
    done
popd

# make sure the man pages are UTF-8...
for nonUTF8 in distrib/doc/alc_origin.1 alcban/man1/alcbanner.1 \
               loon/doc/loon.1 m2e/doc/man1/m2e.1 boog/doc/boog.1 ; do
    %{_bindir}/iconv -f ISO-8859-1 -t utf-8 $nonUTF8 > $nonUTF8.conv
    %{__mv} -f $nonUTF8.conv $nonUTF8
done

#wrong-file-end-of-line-encoding
sed -i 's/\r//' documentation/alliance-examples/mipsR3000/asm/*


%build

export ALLIANCE_TOP=%{prefix}

%configure --prefix=%{prefix}             \
           --enable-alc-shared            \
           --disable-static               \
           --includedir=%{prefix}/include \
           --libdir=%{prefix}/lib         \
           --bindir=%{prefix}/bin

# disabling rpath
sed -i 's|^hardcode_libdir_flag_spec="\\${wl}--rpath \\${wl}\\$libdir"|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

# clean unused-direct-shlib-dependencies
sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool

# Is not parallel-build-safe
%{__make}


%install

%{__rm} -rf %{buildroot}

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


# Set execution rights on the alc_env.* batchs and adjust ALLIANCE_TOP.
pushd %{buildroot}%{_sysconfdir}/profile.d
    chmod 0644 alc_env.*
    sed -i "s|@DATE@|`date`|" alc_env*
    # fixing *** ERROR *** : Variable MBK_SPI_MODEL not found.
    echo "MBK_SPI_MODEL=\$ALLIANCE_TOP/etc/spimodel.cfg;   export MBK_SPI_MODEL" >> alc_env.sh
    echo "setenv MBK_SPI_MODEL      \"\${ALLIANCE_TOP}/etc/spimodel.cfg\"" >> alc_env.csh
    #don't override $MANPATH
    sed -i "s|\$ALLIANCE_TOP/man|\$MANPATH|" alc_env*
    sed "s|ALLIANCE_TOP *= *\([^;]*\)|ALLIANCE_TOP=%{prefix}|" alc_env.sh
    sed "s|setenv *ALLIANCE_TOP *\([^;]*\)|setenv ALLIANCE_TOP %{prefix}|" alc_env.csh
popd


# documentation
%{__cp} -pr %{buildroot}%{prefix}/doc/ .
%{__cp} -pr %{buildroot}%{prefix}/tutorials/ .
%{__cp} -pr %{buildroot}%{prefix}/examples/alliance-examples/ .

%{__rm} -rf %{buildroot}%{prefix}/doc/
%{__rm} -rf %{buildroot}%{prefix}/tutorials/
%{__rm} -rf %{buildroot}%{prefix}/examples/

# correcting minor documentation details
sed -i "s|/bin/zsh|/bin/sh|" doc/alliance-run/bench.zsh


find %{buildroot} -name '*.la' -exec rm -f {} ';'


# Adding icons for the menus
%{__mkdir} -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/
%{__cp} -p %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \
    %{buildroot}%{_datadir}/icons/hicolor/48x48/apps/

# desktop files
for desktopfile in %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do
desktop-file-install --vendor fedora            \
    --add-category Engineering                  \
    --dir %{buildroot}%{_datadir}/applications/ \
    $desktopfile
done


##  Makefiles and tex folder cleanups
pushd tutorials
    for folder in place_and_route/tex simulation/tex start synthesis/tex; do
        %{__rm} -rf $folder
    done
popd


# Architecture independent files
%{__mkdir} -p %{buildroot}%{_datadir}/%{name}/
%{__mv} %{buildroot}%{prefix}/cells %{buildroot}%{_datadir}/%{name}/


# protecting hardcoded links
ln -sf ../../..%{_sysconfdir}/%{name} %{buildroot}%{prefix}/etc
ln -sf ../../..%{_datadir}/%{name}/cells %{buildroot}%{prefix}/cells


%{__mkdir} -p %{buildroot}%{_sysconfdir}/ld.so.conf.d/
cat > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf << EOF
# Alliance VLSI design system
%{prefix}/lib
EOF


# removing tools for compiling and installing Alliance tools
# These are for the packager (i.e me) and not for user
%{__rm} -f %{buildroot}%{_sysconfdir}/%{name}/attila.conf
%{__rm} -f %{buildroot}%{prefix}/bin/attila
%{__rm} -f %{buildroot}%{_datadir}/man/man1/attila*
%{__rm} -f doc/html/alliance/*attila.html
%{__rm} -f doc/pdf/attila.pdf




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


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



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

#These headers are useful for the _usage_ of the binaries
#without these headers some of the binaries will be broken by default


%files
%doc CHANGES LICENCE COPYING* FAQ alliance.fedora
%defattr(-,root,root,-)
%{prefix}/
%{_datadir}/%{name}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/prol.elp
%config(noreplace) %{_sysconfdir}/%{name}/se_defaults.mac
%config(noreplace) %{_sysconfdir}/%{name}/spimodel.cfg
%config(noreplace) %{_sysconfdir}/%{name}/sxlib.scapin
%config %{_sysconfdir}/%{name}/cmos.*
%config %{_sysconfdir}/%{name}/*.par
%config %{_sysconfdir}/ld.so.conf.d/*
%{_datadir}/icons/hicolor/48x48/apps/*
%{_mandir}/man?/*
%{_datadir}/applications/fedora-*.desktop
%{_sysconfdir}/profile.d/alc_env.*



%files doc
%doc doc/html/
%doc doc/design-flow
%doc doc/pdf/*.pdf
%doc doc/overview/*.ps
%doc doc/overview/*.pdf
%doc tutorials/
#Makefiles are present in alliance-examples/*. It is normal because
# * it gives the VLSI designer a template on how to create his own
#   Makefile for alliance (VLSI designers normally don't know how to do so)
# * it is not part of the build, but part of the working environment of the user
%doc alliance-examples/
%doc doc/alliance-run/



%changelog
* Sun Aug 12 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-7.20070718snap
- moved Architecture independent files to %%{_datadir}/%%{name}
- Uses verbs in the comments line for desktop files

* Thu Aug 02 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-6.20070718snap
- chose libdir/alliance as prefix
- added new icons to the menus
- removed useless attila
- fixed MANPATH override

* Sat Jul 28 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-5.20070718snap
- fixed unused-direct-shlib-dependency and undefined-non-weak-symbol warnings

* Tue Jul 24 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-4.20070718snap
- removed X-Desktop-File-Install-Version=0.10 from desktop files
- moved the alc_env to /etc/profile.d
- updated to meet reviewer's statements - #248649

* Thu Jul 19 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-3.20070718snap
- New upstream release which includes bug fixes

* Wed Jul 18 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-2.20060509snap
- minor fixes to the tutorials + added transfig ghostscript tetex-latex as BR
- corrected some hardcoded links in the scripts
- removed %%preun and updated alliance.fedora
- spec file updated to satisfy the review

* Tue Jul 17 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-1
- prepared spec file for review and spec clean ups
- removed rm and ln from %%post and %%preun
- removed log.3.gz from mandir since it's a duplicate and conflicts with man-pages

* Sat Jul 14 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-0.7
- since it is not parallel-build-safe, smp mflags are removed : (by wwoods)
- added missing BR : flex : (by wwoods)
- added missing BR : bison: (by rdieter)

* Fri Jul 13 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-0.6
- removing useless copyrighted lines from .ioc files
- added alliance.fedora among the %%doc

* Thu Jul 12 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-0.5
- removing copyrighted materials
- patching the remaining examples so that they will still be valid under another folder

* Wed Jul 04 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-0.4
- removing unwanted debug duplicates

* Wed May 02 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-0.3
- added desktop files

* Wed Feb 14 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-0.2
- fixing documentations

* Wed Dec 13 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 5.0-0.1
- Initial package

* Thu Feb 17 2005 Jean-Paul.Chaput <Jean-Paul.Chaput@lip6.fr>
- Synch with current version: bug & compliance with gcc 3.4.x.

* Fri Jul 16 2004 Jean-Paul.Chaput <Jean-Paul.Chaput@lip6.fr>
- Added Tutorial sub-package (now managed by autoconf/automake).
- Removed release tag, must be given at compile time using the
  --define command line argument of rpmbuild (see mkdistrib).

* Sat Nov 15 2003 Jean-Paul.Chaput <Jean-Paul.Chaput@lip6.fr>
- assert is now in assert.h, patch mut.h to include it if
  GCC_VERSION >= 3003 (gcc >= 3.3.x).

* Sat Oct 18 2003 Jean-Paul.Chaput <Jean-Paul.Chaput@lip6.fr>
- Synched with 2003/10/18 version.
- Missing depcomp : added "--add-missing --copy" to the individual
  packages in autostuff, so the first who needs depcomp will add
  it at top level.

* Sun Oct 13 2002 Jean-Paul.Chaput <Jean-Paul.Chaput@lip6.fr>
- autoconf m4 macros moved back in the Alliance source tree to avoid
  re-declaration on our development computers (on which the macros
  are in teh source tree).
- Adopt the versioning scheme from czo.
- Try to switch to dynamic libraries.

* Wed Jul 17 2002  Jean-Paul.Chaput <Jean-Paul.Chaput@lip6.fr>
- Moved autoconf m4 macros to /usr/share/aclocal.
- Synched with the current CVS version of Alliance.

* Fri May 31 2002  Jean-Paul.Chaput <Jean-Paul.Chaput@lip6.fr>
- GenPat added.
- GenLib docs added.
- seplace/seroute/sea bug fixes.

* Thu May 16 2002  Jean-Paul.Chaput <Jean-Paul.Chaput@lip6.fr>
- Corrected buggy substitution of ALLIANCE_TOP in alc_env.csh.
- Remove the alc_env.* scripts in "/etc/profile.d" only if this
  is the last package to be removed.

* Mon May  6 2002  Jean-Paul.Chaput <Jean-Paul.Chaput@lip6.fr>
- Initial packaging for release 5.0 (alpha stage).