File pcb-rnd.spec of Package pcb-rnd
%define realname pcb-rnd
%define realver 2.3.1
%define srcext tar.bz2
%bcond_without gtk3
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
# Common info
Name: %{realname}
Version: %{realver}
Release: wiz%{?extraver:0.}1%{?dist}
License: GPL-2.0
Group: Productivity/Scientific/Electronics
URL: http://repo.hu/projects/pcb-rnd/
Summary: Highly modular, interactive Printed Circuit Board editor
# Install-time parameters
PreReq: desktop-file-utils
PreReq: shared-mime-info
# Build-time parameters
BuildRequires: pkg-config
BuildRequires: gettext
# See src_3rd/librnd-local/scconfig/src/
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gdlib)
BuildRequires: pkgconfig(libxml-2.0)
%if %{with gtk3}
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(cairo)
%else
BuildRequires: pkgconfig(gtk+-2.0)
BuildRequires: pkgconfig(gtkglext-x11-1.0)
%endif
%if 0%{?suse_version}
BuildRequires: libstroke-devel
BuildRequires: update-desktop-files
%endif
BuildRoot: %{_tmppath}/%{name}-root
Source: http://repo.hu/projects/pcb-rnd/releases/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
The main purpose of pcb-rnd is to edit the geometry of the board. This includes
board shape, copper shape, layer stackup, holes drilled, slots routed.
The input of the layout process is usually a netlist derived from schematics,
and occasionally layouts drawn from scratch or created from schematic without
importable netlist. Pcb-rnd can read different netlist formats and it can help
the user to realize the given netlist in copper or to change the netlist and
back annotate the changes. Pcb-rnd, however, does not display or edit
schematics directly.
The output of pcb-rnd is most often a vector format (e.g. gerber RS274D), that
is sent to a pcb fab house for manufacturing or is utilized for auto-fabrication.
Pcb-rnd supports a variety of vector and raster output formats making it easy to
print boards, publish them on web pages, and include them in documentation.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
# Build step (compile/build binaries, documentation, etc)
%build
_CFLAGS='%{optflags} %{?gcc_lto}'
_LDFDLAGS='-Wl,--strip-all -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
TOPDIR=$(pwd -P)
cd scconfig
make %{?_smp_mflags}
./configure \
--prefix=%{_prefix} \
--libarchdir=%{_lib} \
%if %{__isa_bits} == 64
--coord=64 \
%endif
--all=plugin \
%if %{without gtk3}
--plugin-hid_gtk2_gdk \
--plugin-hid_gtk2_gl \
%endif
--CFLAGS="$_CFLAGS" \
--LDFLAGS="$_LDFLAGS"
cd ..
%{__make} %{?_smp_mflags}
# Install built stuff
%install
%{__make} install DESTDIR=%{buildroot}
# Move documentation on (open)SUSE to correct place
if [ '%{_defaultdocdir}' != '%{_datadir}/doc' ]; then
%{__install} -d -m0755 %{buildroot}%{_defaultdocdir}
%{__mv} %{buildroot}%{_datadir}/doc/pcb-rnd %{buildroot}%{_defaultdocdir}/
fi
# Install destop files
%{__sed} -ri 's/^(Categories\s*=\s*)(.+)$/\1Education;Science;\2GTK;/' data/pcb-rnd.desktop
%{__install} -D -m0644 data/pcb-rnd.desktop %{buildroot}%{_datadir}/applications/pcb-rnd.desktop
%if "%{expand:%_vendor}" == "suse"
%suse_update_desktop_file -r pcb-rnd Education Construction Engineering Electronics GTK
%endif
# Cleanuo
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
# Files list
%files
%defattr(-,root,root)
%doc AUTHORS COPYING Changelog README Release_notes
%docdir %{_defaultdocdir}/pcb-rnd/
%doc %{_defaultdocdir}/pcb-rnd/*
%{_bindir}/*
%{_libdir}/*.so.*
%{_libdir}/librnd/
%{_prefix}/lib/pcb-rnd/
%{_datadir}/librnd/
%{_datadir}/pcb-rnd/
%{_datadir}/applications/pcb-rnd.desktop
%doc %{_mandir}/man1/*
%exclude %{_libdir}/*.a
%exclude %{_libdir}/*.so
%exclude %{_libdir}/librnd/scconfig/
%exclude %{_includedir}
%exclude %{_datadir}/librnd/librnd.mak
%post
%{_bindir}/update-desktop-database --quiet "%{_datadir}/applications" || :
%postun
%{_bindir}/update-desktop-database --quiet "%{_datadir}/applications" || :
# Package changelog
%changelog