File autodesk_eagle.spec of Package autodesk_eagle

%define debug_build 0

%global __provides_exclude_from ^/opt/.*$

Name:           autodesk_eagle
Version:        kk
Release:        0
Summary:        PCB Design Software
License:        GPL-3.0
Group:          Productivity/Scientific/Electronics
Source0:        eagle_%{version}.tar.gz
Source1:        %{name}.xml
BuildArch:      x86_64

BuildRequires:  update-desktop-files
BuildRequires:  chrpath

%description
Powerful, easy-to-use tools for electronic engineers. PCB layout and schematic editing tools, library content, and community-driven features.

%prep
%setup -qc
tar -zxf %{SOURCE0}
rm -rf eagle-%{version}/lib/libEGL.so.1
mv eagle-%{version}/resources/icudtl.dat eagle-%{version}/libexec/

%build

%install
install -dm755 %{buildroot}/{opt,usr/bin}
cp -r eagle-%{version} %{buildroot}/opt/%{name}-%{version}
ln -sf "/opt/%{name}-%{version}/eagle" %{buildroot}%{_bindir}/eagle
install -pDm 644 %{buildroot}/opt/%{name}-%{version}/bin/icons/Epf.svg     %{buildroot}%{_datadir}/pixmaps/eagle-logo.svg
install -pDm 644 %{buildroot}/opt/%{name}-%{version}/bin/icons/Sch.svg     %{buildroot}%{_datadir}/pixmaps/eagle-sch.svg
install -pDm 644 %{buildroot}/opt/%{name}-%{version}/bin/icons/Brd.svg     %{buildroot}%{_datadir}/pixmaps/eagle-brd.svg
install -pDm 644 %{buildroot}/opt/%{name}-%{version}/bin/icons/Lbr.svg     %{buildroot}%{_datadir}/pixmaps/eagle-lbr.svg
install -pDm 644 %{SOURCE1}                                                %{buildroot}%{_datadir}/mime/packages/%{name}.xml
find %{buildroot}/opt/ -perm 750 -exec chmod 755 {} \;
find %{buildroot}/opt/ -perm 700 -exec chmod 755 {} \;
find %{buildroot}/opt/ -perm 640 -exec chmod 644 {} \;
find %{buildroot}/opt/ -perm 600 -exec chmod 644 {} \;

%suse_update_desktop_file -c %{name} EAGLE "PCB design" "eagle %U" "eagle-logo" "Education Engineering"
echo "MimeType=application/x-eagle-project;application/x-eagle-schematic;application/x-eagle-board;application/x-eagle-library" >> %{buildroot}%{_datadir}/applications/%{name}.desktop
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop

#chrpath --delete %{buildroot}/opt/%{name}-%{version}/eagle
#chrpath --delete %{buildroot}/opt/%{name}-%{version}/lib/*
#chrpath --delete %{buildroot}/opt/%{name}-%{version}/libexec/Qt*
#chrpath --delete %{buildroot}/opt/%{name}-%{version}/plugins/*/*.so

%files
%dir /opt/%{name}-%{version}
/opt/%{name}-%{version}/*
%{_bindir}/eagle
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/eagle-*.svg
%{_datadir}/mime/packages/%{name}.xml

%changelog
* Mon Sep 21 2015 Axiotis Michail
- 
openSUSE Build Service is sponsored by