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