Blob Blame History Raw
Name:             gerbv
Version:          2.1.0
Release:          2%{?dist}
Summary:          Gerber file viewer from the gEDA toolkit

Group:            Applications/Engineering
License:          GPLv2
URL:              http://gerbv.sourceforge.net/

Source:           http://downloads.sourceforge.net/gerbv/%{name}-%{version}.tar.gz

BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:    gtk2-devel, libpng-devel, desktop-file-utils, automake, ImageMagick-devel

Requires(postun): /sbin/ldconfig
Requires(post):   /sbin/ldconfig


%description
Gerber Viewer (gerbv) is a viewer for Gerber files. Gerber files
are generated from PCB CAD system and sent to PCB manufacturers
as basis for the manufacturing process. The standard supported
by gerbv is RS-274X.

gerbv also supports drill files. The format supported are known
under names as NC-drill or Excellon. The format is a bit undefined
and different EDA-vendors implement it different.

gerbv is listed among Fedora Electronic Lab (FEL) packages.

%package devel
Summary:          Header files, libraries and development documentation for %{name}
Group:            Development/Libraries
Requires:         %{name} = %{version}-%{release}
Requires:         gtk2-devel, libpng-devel

%description devel
This package contains the header files, libraries and development
documentation for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-devel.


%prep
%setup -q

%build

# default measurement units set to millimeters
%configure             \
   --enable-exportpng  \
   --enable-unit-mm    \
   --disable-update-desktop-database \
   --disable-static    \
   --enable-gtk2

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

%{__make} %{?_smp_mflags}


%install
%{__rm} -rf %{buildroot}
%{__make} install DESTDIR=%{buildroot}


desktop-file-install --vendor fedora           \
    --remove-category Education                \
    --dir %{buildroot}%{_datadir}/applications \
    desktop/%{name}.desktop


%{__rm} -f %{buildroot}%{_libdir}/libgerbv.la

%{__rm} -f %{buildroot}%{_datadir}/applications/%{name}.desktop
%{__rm} -f  {doc,example}/Makefile*

pushd example/
for dir in * ; do
  [ -d $dir ] && %{__rm} -f $dir/Makefile*
done
popd


pushd doc/
for dir in * ; do
  [ -d $dir ] && %{__rm} -f $dir/Makefile*
done
popd

#Fixing the end-of-line encodings
set +x
for f in `find example/ -name \*.* | sort` doc/eagle/eagle2exc.txt ; do
   echo -n -e "... Fixing the end-of-line encodings of $f  \t"
   sed -i.bak -e 's|\r||g' $f
   touch -r $f.bak $f
   %{__rm} -f $f.bak
   echo "done"
done
set -x


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


%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 || :



%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING NEWS README TODO
%doc example/
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_mandir}/man1/gerbv.*
%{_datadir}/icons/hicolor/??x??/apps/%{name}.png
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/applications/fedora-%{name}.desktop
%{_libdir}/lib%{name}.so.*


%files devel
%defattr(-,root,root,-)
%doc doc/*
%{_includedir}/%{name}-%{version}/%{name}.h
%{_libdir}/lib%{name}.so
%{_libdir}/pkgconfig/libgerbv.pc


%Changelog
* Thu Nov 13 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 2.1.0-2
- BR ImageMagick-devel added

* Thu Nov 13 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 2.1.0-1
- New upstream release and split into -devel package

* Tue Feb 01 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 2.0.0-1
- New upstream release

* Tue Dec 04 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 1.0.3-1
- new upstream release

* Thu Aug 23 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 1.0.2-3
- mass rebuild for fedora 8 - ppc

* Thu Jun 28 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 1.0.2-2
- remove gdk-pixbuf-devel as BR

* Thu Sep 14 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 1.0.2-1
- Initial package for Fedora Core