Blob Blame History Raw
%define         pcbver 20081128

Name:           pcb
Version:        0.%{pcbver}
Release:        1%{?dist}

Summary:        An interactive printed circuit board editor
License:        GPLv2
Group:          Applications/Engineering
URL:            http://pcb.sourceforge.net

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  tcl, bison, flex, gawk, ImageMagick, gtk2-devel, gd-devel, fontconfig-devel
BuildRequires:  cups, tetex-latex, libICE-devel, desktop-file-utils, intltool, gettext-devel

Requires:       m4
Requires:       electronics-menu

Source0:        http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{pcbver}.tar.gz

Requires(post): /sbin/install-info
Requires(preun):/sbin/install-info


%description
PCB is an interactive printed circuit board editor for the X window system.
PCB includes a rats nest feature, design rule checking, and can provide
industry standard RS-274-X (Gerber), NC drill, and centroid data (X-Y data)
output for use in the board fabrication and assembly process. PCB offers
high end features such as an autorouter and trace optimizer which can
tremendously reduce layout time.


%prep
%setup -q -n %{name}-%{pcbver}

%{__sed} -i \
    's|examplesdir = $(pkgdatadir)/examples|examplesdir = example/|' \
   example/Makefile.in

install -d example/thermal
install -d example/pad
install -d example/puller
install -d example/LED_Interface
%{__cp} tutorial/tut1.pcb example/LED_Interface

# rpmlint W: spurious-executable-perm
chmod 0644 example/LED.NET
chmod 0644 example/LED

%build
export WISH=%{_bindir}/wish

%configure --disable-update-mime-database

%{__make} %{?_smp_mflags}


%install
%{__rm} -rf %{buildroot}
%{__make} DESTDIR=%{buildroot} INSTALL="%{_bindir}/install -p" install

# in /usr/share/pcb/newlib/ folder, sockets is an empty folder

desktop-file-install --vendor fedora           \
    --dir %{buildroot}%{_datadir}/applications \
    --delete-original                          \
    %{buildroot}%{_datadir}/applications/%{name}.desktop


# restructuring for docdir and tutorial
# renaming to .pcb extension
%{__mv} example/LED  example/LED.pcb
%{__mv} example/LED2 example/LED2.pcb

%{__rm} -f example/Makefile*
%{__rm} -f example/*/Makefile*

%{__mv} example/LED*.* example/LED_Interface

install -p -m 0644 doc/thermal.{pcb,pdf,gif,png} example/thermal/
install -p -m 0644 doc/pad.{pcb,pdf,gif,png}     example/pad/
install -p -m 0644 doc/puller.{pcb,pdf,gif,png}  example/puller/

%{__rm} -rf %{buildroot}%{_datadir}/%{name}/tutorial/
%{__rm} -rf %{buildroot}%{_datadir}/%{name}/example/
%{__rm} -rf %{buildroot}%{_docdir}/%{name}

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

# Removes duplicates
%{__rm} -f %{buildroot}%{_datadir}/%{name}/tools/apctools.zip
%{__rm} -f %{buildroot}%{_datadir}/%{name}/tools/{MergePCBPS,Merge_dimPCBPS}

## ---

# Old versions of PCB don't support autoroute, pcb2ncap convert
# pcb format to ncap format used for mucspcb to autoroute the circuit.
# In newer versions of PCB, autoroute is included and pcb2ncap and mucspcb
# are no more needed.
%{__rm} -f %{buildroot}%{_datadir}/%{name}/tools/pcb2ncap.tgz

chmod 755 %{buildroot}%{_datadir}/%{name}/tools/{PCB2HPGL,tgo2pcb.tcl}


%{__rm} -rf %{buildroot}%{_datadir}/info/dir

# Bug 472618
%{__rm} -f %{buildroot}%{_datadir}/applications/mimeinfo.cache

# locale's
%find_lang %{name}

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


%post
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%postun
touch --no-create %{_datadir}/icons/hicolor || :
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :


%preun
/sbin/install-info --delete %{_infodir}/%{name}.info*.gz %{_infodir}/dir || :

# Ignored warning W: pcb devel-file-in-non-devel-package /usr/share/pcb/tools/gerbertotk.c

%files -f %{name}.lang
%defattr(-, root, root, -)
%doc AUTHORS COPYING README NEWS ChangeLog
%doc README_FILES/CHANGES README_FILES/Whats_new_in_2.0
%doc example/ doc/refcard.pdf doc/pcb.pdf

%{_datadir}/applications/fedora-%{name}.desktop
%{_bindir}/%{name}
%{_bindir}/MergePCBPS
%{_bindir}/Merge_dimPCBPS
%{_datadir}/%{name}/
%{_infodir}/%{name}*
%{_mandir}/man1/%{name}*
%{_datadir}/icons/hicolor/*/mimetypes/application-x-*
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{_datadir}/mime/packages/pcb.xml
%{_datadir}/mimelnk/application/x-excellon.desktop
%{_datadir}/mimelnk/application/x-gerber.desktop
%{_datadir}/mimelnk/application/x-pcb-*.desktop


%Changelog
* Sat Nov 29 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20081128-1
- new upstream release
- restructuring docs, tutorials and examples
- Fixed Bug 472618 -  Must not include /usr/share/applications/mimeinfo.cache

* Sat Feb 09 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20080202-2
- added gettext-devel as BR
- treat locales properly

* Sat Feb 02 2008 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20080202-1
- fixed docdir
- new upstream release
- treat locales properly

* Thu Jun 21 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20070208-2
- fixed docdir

* Fri Feb 09 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20070208-1
- New upstream release - 20070208

* Sun Feb 04 2007 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060822-9
- fixed presence in gnome menu

* Sun Dec 24 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060822-8
- Removed duplicates

* Fri Dec 22 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060822-7
- Fixed info files and added to the pcb package #219406
- Fixed man pages (with patch0 to suit fedora packaging of pcb
- Added refcard.pdf in pcb binary package
- Removed duplicated MergePCBPS and Merge_dimPCBPS from pcb binary package
- pcb supports for acpcircuits included

* Fri Sep 15 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060822-6
- Fixed ownership of %%{_datadir}/%%{name}/ #206405

* Fri Sep 01 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060822-5
- release for devel

* Fri Sep 01 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060822-4
- Added m4 as requires: to fix the error msg:
-       can't find default font-symbol-file 'default_font'

* Fri Aug 25 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060822-3
- release for devel

* Fri Aug 25 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060822-2
- release for FC5 and minor fixes

* Fri Aug 25 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060822-1
- updated to 20060822's snapshot

* Wed Jul 11 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060422-4
- pcbver corrected in pcb.desktop

* Sun Jul 09 2006 Chitlesh Goorah <chitlesh@fedoraproject.org> - 0.20060422-3
- fixed the icon of pcb

* Sun Jul 09 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060422-2
- fixed E: pcb info-dir-file /usr/share/info/dir
- added /sbin/install-info as requires for %%post and %%preun
- added icon and treated GTK+ icon cache as required

* Thu Jul 06 2006 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20060422-1
- New upstream release 20060422
- Minor fixes to work under mock

* Wed Apr 19 2006 <pjones@redhat.com> - 0.20060414-1
- Let there be pcb packaging.