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