4bc2683
# If the emacs-el package has installed a pkgconfig file, use that to determine
4bc2683
# install locations and Emacs version at build time, otherwise set defaults.
4bc2683
%if %($(pkg-config emacs) ; echo $?)
4bc2683
%define emacs_version 22.1
4bc2683
%define emacs_lispdir  %{_datadir}/emacs/site-lisp
4bc2683
%define emacs_startdir %{_datadir}/emacs/site-lisp/site-start.d
4bc2683
%else
4bc2683
%define emacs_version  %{expand:%(pkg-config emacs --modversion)}
4bc2683
%define emacs_lispdir  %{expand:%(pkg-config emacs --variable sitepkglispdir)}
4bc2683
%define emacs_startdir %{expand:%(pkg-config emacs --variable sitestartdir)}
4bc2683
%endif
4bc2683
4bc2683
Name:           perl-SystemC-Vregs
7775bf8
Version:        1.463
4bc2683
Release:        1%{?dist}
4bc2683
Summary:        Utility routines used by vregs
4bc2683
7775bf8
License:        LGPLv3+ or Artistic 2.0
4bc2683
Group:          Development/Libraries
4bc2683
URL:            http://search.cpan.org/dist/SystemC-Vregs/
4bc2683
Source0:        http://www.cpan.org/authors/id/W/WS/WSNYDER/SystemC-Vregs-%{version}.tar.gz
4bc2683
4bc2683
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
4bc2683
BuildArch:      noarch
4bc2683
4bc2683
BuildRequires:  perl(Bit::Vector)
4bc2683
BuildRequires:  perl(ExtUtils::MakeMaker)
4bc2683
BuildRequires:  perl(HTML::Parser)
4bc2683
BuildRequires:  perl(HTML::TableExtract)
4bc2683
BuildRequires:  perl(Verilog::Language) >= 2.1
4bc2683
BuildRequires:  readline-devel
4bc2683
4bc2683
Requires:       perl(Bit::Vector)
4bc2683
Requires:       perl(HTML::Parser)
4bc2683
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
4bc2683
4bc2683
%description
4bc2683
A Vregs object contains a documentation "package" containing enumerations,
4bc2683
definitions, classes, and registers.
4bc2683
4bc2683
4bc2683
%package -n     emacs-vregs-mode
4bc2683
Summary:        Elisp source files for systemc-vregs under GNU Emacs
4bc2683
Group:          Development/Libraries
4bc2683
BuildRequires:  emacs-el
4bc2683
BuildRequires:  emacs
4bc2683
Requires:       emacs(bin) >= %{emacs_version}
4bc2683
4bc2683
%description -n emacs-vregs-mode
4bc2683
This package provides emacs support for systemc-vregs
4bc2683
4bc2683
%prep
4bc2683
%setup -q -n SystemC-Vregs-%{version}
4bc2683
4bc2683
# fixing error: ‘strchr’ was not declared in this scope
4bc2683
%{__sed} -i "s|#include <stdlib.h>|#include <stdlib.h>\n#include <string.h>|" \
4bc2683
  include/VregsRegInfo.cpp
4bc2683
4bc2683
4bc2683
%build
4bc2683
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
4bc2683
make %{?_smp_mflags}
4bc2683
4bc2683
%install
4bc2683
rm -rf $RPM_BUILD_ROOT
4bc2683
4bc2683
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
4bc2683
4bc2683
find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
4bc2683
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
4bc2683
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;
4bc2683
4bc2683
emacs -batch -f batch-byte-compile vregs-mode.el
4bc2683
%{__install} -d %{buildroot}%{emacs_lispdir}
4bc2683
%{__install} -pm 0644 vregs-mode.el vregs-mode.elc %{buildroot}%{emacs_lispdir}/
4bc2683
4bc2683
%{_fixperms} $RPM_BUILD_ROOT/*
4bc2683
4bc2683
%check
4bc2683
make test
4bc2683
4bc2683
%clean
4bc2683
rm -rf $RPM_BUILD_ROOT
4bc2683
4bc2683
%files
4bc2683
%defattr(-,root,root,-)
4bc2683
%doc Changes COPYING README vregs_spec.doc vregs_spec.htm
4bc2683
%{_bindir}/vreg*
4bc2683
4bc2683
%dir %{perl_vendorlib}/SystemC
4bc2683
%{perl_vendorlib}/SystemC/Vregs.pm
4bc2683
%{perl_vendorlib}/SystemC/vregs_spec__rules.pl
4bc2683
4bc2683
%dir %{perl_vendorlib}/SystemC/Vregs
4bc2683
%{perl_vendorlib}/SystemC/Vregs/*
4bc2683
%{_mandir}/man?/*
4bc2683
4bc2683
4bc2683
%files -n emacs-vregs-mode
4bc2683
%defattr(-,root,root,-)
4bc2683
%{emacs_lispdir}/vregs-mode.el*
4bc2683
4bc2683
4bc2683
%changelog
7775bf8
* Thu May 21 2009 Chitlesh GOORAH <chitlesh [AT] fedoraproject DOT org> 1.463-1
1a1cb88
- new upstream release
1a1cb88
4bc2683
* Fri Jan 09 2009 Chitlesh GOORAH <chitlesh [AT] fedoraproject DOT org> 1.461-1
4bc2683
- new upstream release
4bc2683
4bc2683
* Sun Dec 28 2008 Chitlesh GOORAH <chitlesh [AT] fedoraproject DOT org> 1.460-2
4bc2683
- spec file revisited upon request : #476449c1
4bc2683
4bc2683
* Sun Dec 14 2008 Chitlesh GOORAH <chitlesh [AT] fedoraproject DOT org> 1.460-1
4bc2683
- Specfile autogenerated by cpanspec 1.77.