File pcb.spec of Package pcb

#
# spec file for package pcb
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           pcb
Version:        4.0.2
Release:        1.2
Summary:        CAD Program for the Design of Printed Circuit Boards
License:        GPL-2.0
Group:          Productivity/Scientific/Electronics

Url:            http://pcb.geda-project.org/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE grenum-no-build-time.patch -- fix "W: file-contains-date-and-time"
Patch0:         pcb-no-build-time.patch

BuildRequires:  ImageMagick
BuildRequires:  Mesa-devel
BuildRequires:  bison
BuildRequires:  dbus-1-devel
BuildRequires:  flex
BuildRequires:  freeglut-devel
BuildRequires:  freetype2-devel
BuildRequires:  gcc-c++
BuildRequires:  gd-devel >= 2.1.0
BuildRequires:  gtk2-devel
BuildRequires:  gtkglext-devel
BuildRequires:  intltool
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  perl-XML-Parser
BuildRequires:  tk
BuildRequires:  unzip
BuildRequires:  update-desktop-files
Requires(post):   shared-mime-info
Requires(postun): shared-mime-info

Requires:       m4
Recommends:     pcb-doc = %{version}

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
pcb is a CAD (computer aided design) program for the physical design
of printed circuit boards.  It has an autorouter, a trace optimizer a
design rule checker and many more features. It can create RS-274-X
(Gerber), Postscript, EPS and PNG output files.

%package doc
Summary:        Documentation for PCB, An interactive printed circuit board editor
Group:          Documentation/Other
Requires(pre):  %install_info_prereq
%if 0%{?suse_version} > 1110
BuildArch:      noarch
%endif

%description doc
This package contains the documentation of PCB, an interactive printed circuit
board editor.

%prep
%setup -q
%patch0 -p1

%build
# pcb does not like the -D_FORTIFY_SOURCE=2 option, remove it.
export CFLAGS=$(echo %{optflags} | sed "s,-D_FORTIFY_SOURCE=2,,g")
%configure  \
            --docdir=%{_docdir}/%{name} \
            --disable-rpath \
            --enable-dbus \
            --disable-update-desktop-database \
            --disable-update-mime-database \
            --enable-gl \
            --enable-toporouter \
            --enable-toporouter-output

make %{?_smp_mflags}

%install
%make_install

%suse_update_desktop_file -r %{name} Education Engineering
%find_lang %{name}

# acpcircuits support
# http://www.apcircuits.com/resources/links/pcb_unix.html
unzip tools/apctools.zip
install -p -m 755 apc*.pl  %{buildroot}%{_datadir}/%{name}/tools
rm -f %{buildroot}%{_datadir}/%{name}/tools/apctools.zip

# pcb2ncap convert isn't neened
rm -f %{buildroot}%{_datadir}/%{name}/tools/pcb2ncap.tgz

# fix W: non-executable-script
chmod 755 %{buildroot}%{_datadir}/%{name}/tools/{Merge*,PCB2HPGL,pcbdiff,tgo2pcb.tcl}

# remove static library, header and source file
rm -f %{buildroot}%{_libdir}/libgts.a \
      %{buildroot}%{_includedir}/gts.h \
      %{buildroot}%{_datadir}/%{name}/tools/gerbertotk.c

install -Dm 644 {COPYING,NEWS,README} %{buildroot}/%{_docdir}/%{name}/

%post
/usr/bin/update-mime-database %{_datadir}/mime > /dev/null 2>&1 || :

%postun
/usr/bin/update-mime-database %{_datadir}/mime > /dev/null 2>&1 || :

%post doc
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%postun doc
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%clean
rm -rf %{buildroot}

%files -f %{name}.lang
%defattr(-,root,root)
%doc %{_docdir}/%{name}/COPYING
%doc %{_docdir}/%{name}/NEWS
%doc %{_docdir}/%{name}/README
%{_bindir}/*
%{_datadir}/%{name}/
%{_datadir}/gEDA/
%{_datadir}/icons/*/*/*/*.*
%{_datadir}/applications/pcb.desktop
%{_datadir}/mime/packages/*
%{_mandir}/man1/%{name}*
%dir %{_datadir}/mimelnk/
%dir %{_datadir}/mimelnk/application
%{_datadir}/mimelnk/application/x-*.desktop
%dir %{_datadir}/appdata
%{_datadir}/appdata/pcb.appdata.xml

%files doc
%defattr(-,root,root)
%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/examples/
%doc %{_docdir}/%{name}/tutorial/
%doc %{_docdir}/%{name}/*.html
%doc %{_docdir}/%{name}/*.pdf
%doc %{_docdir}/%{name}/*.png
%{_infodir}/%{name}.info*

%changelog
* Sun Sep  3 2017 wk@ire.pw.edu.pl
- updated to bugfix release 4.0.2
* Mon May  8 2017 wk@ire.pw.edu.pl
- updated to bugfix release 4.0.1
* Wed Jan 18 2017 wk@ire.pw.edu.pl
- updated to release 4.0.0
- patch pcb-fix-appdata.patch removed (applied upstream)
* Tue Mar  3 2015 dmitry_r@opensuse.org
- Fix desktop menu categories
* Tue Dec 23 2014 zaitor@opensuse.org
- Add pcb-fix-appdata.patch: Fix appdata, and keep pcb from beeing
  pulled in by default on GNOME. Patch from upstream git.
* Sun Nov  9 2014 Led <ledest@gmail.com>
- fix bashis in post/postun scripts
* Tue Mar 18 2014 dmitry_r@opensuse.org
- Update to version 20140316
  Features:
  * GTK gui uses GL now, including a pseudo-3D mode.
  * Brazilian translation added, others updated.
  * Many internationalization tweaks.
  * Mice with right-left scroll wheels now supported.
  * Major upgrades to the GCode exporter.
  * rat-thickness parameter can take a 'px' suffix.
  * metric and imperial grids are now more independent.
  * photo exporter supports multiple color schemes.
  * gerbers can be output in metric.
  * There's now a difference between "found" (what the netlist wants)
    and "connected" (what the copper says).
  * PNG exporter has --fill-holes to omit the "drill helper" completely.
  * gerber drill files now 0.1mil resolution.
  * XY file is now IPC 7531 compliant.
  Bug Fixes:
  * Fix pan locking up pcb if you leave the window.
  * Many bugfixes related to the metric conversion, including the
    two autorouters.
  * ps alignment marks fixed.
  * route styles in *.pcb files may contain units.
  * able to select more parts by their mark when their mark is on-grid.
  * gtk route selector may now have nothing selected, if the board
    has custom route settings.
  * drc no longer hangs when some layers are skipped.
  * ps_bloat works again.
  * EPS header is more standards-compliant.
  * PS outlines are only drawn on copper layers, not mask layers.
  * cursor position and zoom are no longer written to the *.pcb file.
  * lines with different clearances aren't auto-merged.
  * pin names are drawn in the pinout window.
  * gerber aperture numbers won't increase between runs.
  * misc doc tweaks and fixes.
* Thu Jan  3 2013 dmitry_r@opensuse.org
- Clean installed files
- Delete compilation time from binary
  * pcb-no-build-time.patch
* Tue Dec 25 2012 dmitry_r@opensuse.org
- spec file cleanup
* Sat Nov 19 2011 werner.ho@gmx.de
- new version 20110918
* Thu Oct 14 2010 werner.ho@gmx.de
- new version 20100929
* Sat Dec  5 2009 werner.ho@gmx.de
- fix warning no-return-in-nonvoid-function
* Sat Dec  5 2009 werner.ho@gmx.de
- new version 20091103
* Sat Dec 20 2008 werner.ho@gmx.de
- keep the electronics-menu patch for older distributions
* Tue Dec 16 2008 sbrabec@suse.cz
- dependencies fix
- directory ownership fix
- desktop file QA fix
* Tue Dec 16 2008 werner.ho@gmx.de
- new version 20081128
- removed options for older distributions
* Sun Mar 23 2008 werner.ho@gmx.de
- fixed desktop integration, added kde mimelnk files
* Sun Feb  3 2008 werner.ho@gmx.de
- new version 20080202
- added BuildRequires: intltool, perl-XML-Parser, desktop-file-utils,
  update-desktop-files
* Tue Oct 16 2007 werner.ho@gmx.de
- enabled dbus support required by xgsch2pcb
* Sat Sep 15 2007 werner.ho@gmx.de
- new version 20070912
* Sat Sep  8 2007 werner.ho@gmx.de
- build fix: flex for openSUSE 10.3
* Tue Feb 20 2007 werner.ho@gmx.de
- new version 20070208p1
* Tue Sep 26 2006 werner.ho@gmx.de
- added libjpeg-devel and freetype2-devel required to build
* Wed Aug 30 2006 werner.ho@gmx.de
- removed PNG output. pcb crashes on SuSE 10.1 and there are build problems.
* Tue Aug 29 2006 werner.ho@gmx.de
- added missing libpng-devel: its not in gtk2-devel in SuSE 10.0 and 9.3
* Sat Aug 26 2006 werner.ho@gmx.de
- disabled GIF and JPEG-support as gd-devel in SuSE 10.0 doesn't support it
* Sat Aug 26 2006 werner.ho@gmx.de
- first spec file
openSUSE Build Service is sponsored by