File xcircuit.spec of Package xcircuit

#
# spec file for package xcircuit
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           xcircuit
Version:        @SERVICE@
Release:        0
Summary:        Circuit drawing and schematic capture tool
License:        GPL-2.0-or-later
Group:          Productivity/Scientific/Electronics
URL:            https://github.com/RTimothyEdwards/XCircuit
Source:         %{name}-%{version}.tar.xz
BuildRequires:  -brp-check-suse
BuildRequires:  c_compiler
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(python)
BuildRequires:  pkgconfig(tcl)
BuildRequires:  pkgconfig(tk)
BuildRequires:  pkgconfig(xt)

%description
XCircuit is a UNIX/X11 program for drawing publishable-quality electrical
circuit schematic diagrams and related figures, and produce circuit
netlists through schematic capture. XCircuit regards circuits as inherently
hierarchical, and writes both hierarchical PostScript output and
hierarchical SPICE netlists. Circuit components are saved in and retrieved
from libraries which are fully editable. XCircuit does not separate
artistic expression from circuit drawing; it maintains flexiblity in style
without compromising the power of schematic capture.

%prep
%autosetup -p1
sed -i "/PACKAGE.*VERSION/s|/lib/|/%{_lib}/|" Makefile Makefile.??
chmod -x examples/xc_remote.sh

%build
%configure
%make_build

%install
%make_install
%suse_update_desktop_file -n -c %{name} "XCircuit" "Circuit designer" %{name} %{name}
sed -i '/X-SuSE-translate/d' %{buildroot}%{_datadir}/applications/%{name}.desktop
#%%suse_update_desktop_file -n -r -C "Circuit drawing and schematic capture tool" %%{name} Education Electricity Electronics
%suse_update_desktop_file -n -r -C "Circuit drawing and schematic capture tool" %{name} Graphics 2DGraphics RasterGraphics
install -Dm 0644 lib/pixmaps/%{name}.xpm %{buildroot}%{_datadir}/pixmaps/%{name}.xpm
install -Dm 0644 lib/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
rm -rfv %{buildroot}%{_libdir}/%{name}-*/man/

%files
%doc CHANGES README README.* TODO VERSION examples/
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.xpm
%{_libdir}/%{name}-*/
%{_mandir}/man?/%{name}.?%{?ext_man}
%license COPYRIGHT

%changelog
openSUSE Build Service is sponsored by