Blob Blame History Raw
# Upstream doesn't make releases.  We have to check the code out of Mercurial.
%global owner   alanmi
%global commit  2860545fb810
%global hgdate  20180228

# WARNING: When updating to a newer snapshot, because upstream doesn't do
# shared library versioning, run abipkgdiff (from libabigail) against the
# old and new binary and debuginfo packages to detect abi changes that would
# require bumping the shared library version, e.g.,
#   abipkgdiff --d1 abc-debuginfo-<old>.rpm --d2 abc-debuginfo-<new>.rpm \
#               abc-<old>.rpm abc-<new>.rpm
# If the shared library version is bumped, remember to rebuild dependent
# packages, finding them using e.g.
#   repoquery --whatrequires abc-libs
# This should be done for each branch in which abc-libs will be updated.

Name:           abc
Version:        1.01
Release:        16.hg%{hgdate}%{?dist}
Summary:        Sequential logic synthesis and formal verification

License:        MIT
URL:            http://www.eecs.berkeley.edu/~alanmi/abc/abc.htm
Source0:        https://bitbucket.org/%{owner}/%{name}/get/%{commit}.zip
# Man page created by Jerry James using upstream text; hence, it is covered by
# the same copyright and license as the code.
Source1:        %{name}.1
# Fedora-specific patch: do not use the bundled libraries
Patch0:         %{name}-bundlelib.patch
# Fedora-specific patch: build a shared library instead of a static library
Patch1:         %{name}-sharedlib.patch
# Fix a minor header issue
Patch2:         %{name}-header.patch

BuildRequires:  bzip2-devel
BuildRequires:  gcc-c++
BuildRequires:  readline-devel
BuildRequires:  zlib-devel

Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

%description
ABC is a growing software system for synthesis and verification of
binary sequential logic circuits appearing in synchronous hardware
designs.  ABC combines scalable logic optimization based on And-Inverter
Graphs (AIGs), optimal-delay DAG-based technology mapping for look-up
tables and standard cells, and innovative algorithms for sequential
synthesis and verification.

ABC provides an experimental implementation of these algorithms and a
programming environment for building similar applications.  Future
development will focus on improving the algorithms and making most of
the packages stand-alone.  This will allow the user to customize ABC for
their needs as if it were a toolbox rather than a complete tool.

%package libs
Summary:        Library for sequential synthesis and verification

%description libs
This package contains the core functionality of ABC as a shared library.

%package devel
Summary:        Headers and libraries for developing with ABC
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

%description devel
Headers and libraries for developing applications that use ABC.

%prep
%setup -q -n %{owner}-%{name}-%{commit}
%patch0
%patch1
%patch2

# Do not use the bundled libraries
rm -fr lib src/misc/{bzlib,zlib}

# Fix end of line encodings
for fil in readme.md readmeaig; do
  sed -i.orig 's/\r//' ${fil}
  touch -r ${fil}.orig ${fil}
  rm -f ${fil}.orig
done

# Set the version number in the man page
sed 's/@VERSION@/%{version} (%{hgdate})/' %{SOURCE1} > %{name}.1
touch -r %{SOURCE1} %{name}.1

%build
# Build the library and binary
make %{?_smp_mflags} libabc.so OPTFLAGS="%{optflags} -fPIC -DNDEBUG" \
  LD="g++ $RPM_LD_FLAGS" ABC_MAKE_VERBOSE=1
make %{?_smp_mflags} src/base/main/main.o OPTFLAGS="%{optflags} -DNDEBUG" \
  ABC_MAKE_VERBOSE=1
g++ src/base/main/main.o -o %{name} $RPM_LD_FLAGS -L. -labc

%install
# Install the library
mkdir -p %{buildroot}%{_libdir}
install -p -m 0755 lib%{name}.so.0.0.0 %{buildroot}%{_libdir}
ln -s lib%{name}.so.0.0.0 %{buildroot}%{_libdir}/lib%{name}.so.0
ln -s lib%{name}.so.0 %{buildroot}%{_libdir}/lib%{name}.so

# Install the header files
pushd src
mkdir -p %{buildroot}%{_includedir}/%{name}
tar -cBf - $(find -O3 . -name \*.h) | \
  (cd %{buildroot}%{_includedir}/%{name}; tar -xBf -)
popd

# Install the binary
mkdir -p %{buildroot}%{_bindir}
install -p -m 0755 %{name} %{buildroot}%{_bindir}

# Install the man page
mkdir -p %{buildroot}%{_mandir}/man1
install -p -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1

%post libs -p /sbin/ldconfig

%postun libs -p /sbin/ldconfig

%files
%doc readme.md readmeaig
%{_bindir}/%{name}
%{_mandir}/man1/%{name}*

%files libs
%license copyright.txt
%{_libdir}/lib%{name}.so.*

%files devel
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so

%changelog
* Sat Mar  3 2018 Jerry James <loganjerry@gmail.com> - 1.01-16.hg20180228
- Update to latest mercurial snapshot
- BR gcc-c++ instead of gcc

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.01-15.hg20180129
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Feb  2 2018 Jerry James <loganjerry@gmail.com> - 1.01-14.hg20180129
- Update to latest mercurial snapshot

* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.01-13.hg20160905
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.01-12.hg20160905
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.01-11.hg20160905
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Jan 12 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.01-10.hg20160905
- Rebuild for readline 7.x

* Sat Sep 10 2016 Eric Smith <brouhaha@fedoraproject.org> - 1.01-9.hg20160905
- Update to latest mercurial snapshot

* Fri Feb  5 2016 Jerry James <loganjerry@gmail.com> - 1.01-8.hg20160203
- Update to latest mercurial snapshot
- Drop the python2 subpackage; upstream moved support to a separate project

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.01-7.hg20150306
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.01-6.hg20150306
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.01-5.hg20150306
- Rebuilt for GCC 5 C++11 ABI change

* Sat Mar  7 2015 Jerry James <loganjerry@gmail.com> - 1.01-4.hg20150306
- Update to latest mercurial snapshot

* Thu Jan  1 2015 Jerry James <loganjerry@gmail.com> - 1.01-3.hg20150101
- Update to latest mercurial snapshot
- Fix installation of header files

* Wed Dec  3 2014 Jerry James <loganjerry@gmail.com> - 1.01-2.hg20141130
- Drop unnecessary jquery Provides
- Fix file permissions

* Mon Dec  1 2014 Jerry James <loganjerry@gmail.com> - 1.01-1.hg20141130
- Initial RPM