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

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

# 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

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

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

%setup -q
%patch0 -p1

# 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 \

make %{?_smp_mflags}


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

# acpcircuits support
unzip tools/
install -p -m 755 apc*.pl  %{buildroot}%{_datadir}/%{name}/tools
rm -f %{buildroot}%{_datadir}/%{name}/tools/

# 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 \

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

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

/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

rm -rf %{buildroot}

%files -f %{name}.lang
%doc %{_docdir}/%{name}/COPYING
%doc %{_docdir}/%{name}/NEWS
%doc %{_docdir}/%{name}/README
%dir %{_datadir}/mimelnk/
%dir %{_datadir}/mimelnk/application
%dir %{_datadir}/appdata

%files doc
%dir %{_docdir}/%{name}
%doc %{_docdir}/%{name}/examples/
%doc %{_docdir}/%{name}/tutorial/
%doc %{_docdir}/%{name}/*.html
%doc %{_docdir}/%{name}/*.pdf
%doc %{_docdir}/%{name}/*.png

openSUSE Build Service is sponsored by