File scratch.spec of Package scratch
Name: scratch
%define real_version 1.4.0.7.src
Summary: A new programming language
Url: http://scratch.mit.edu/
Group: Development/Tools/IDE
License: GPL v2
Version: 1.4.0
Release: 0
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
BuildRequires: gcc
BuildRequires: pkg-config
BuildRequires: cairo-devel >= 1.8.6
BuildRequires: pango-devel >= 1.20.5
BuildRequires: glib2-devel >= 2.20.1
Requires: squeak-vm
Source: %{name}-%{real_version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Scratch is a new programming language that makes it easy to create your own
interactive stories, animations, games, music, and art -- and share your
creations on the web.
Scratch is designed to help young people (ages 8 and up) develop 21st century
learning skills. As they create Scratch projects, young people learn important
mathematical and computational ideas, while also gaining a deeper understanding
of the process of design.
%prep
%setup -n %{name}-%{real_version}
%build
%{__make}
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_prefix}/lib/scratch
mkdir -p %{buildroot}%{_datadir}/scratch
install -Dm644 src/scratch.desktop %{buildroot}%{_datadir}/applications/%name.desktop
install -Dm644 src/icons/32x32/scratch.png %{buildroot}%{_datadir}/pixmaps/%name.png
%if 0%{?suse_version} > 1200
install -Dm644 src/man/scratch.1.gz %{buildroot}%{_mandir}/man1/%name.1.gz
install -Dm644 src/scratch.xml %{buildroot}%{_datadir}/mime/application/%name.xml
%endif
sed "s,/usr/lib/squeak,%{_libdir}/squeak,g" src/scratch > %{buildroot}%{_bindir}/%{name}
cp -a Scratch.image Plugins %{buildroot}%{_prefix}/lib/scratch
cp -a Help locale Media Projects %{buildroot}%{_datadir}/scratch
%if 0%{?suse_version}
%suse_update_desktop_file %{name} Development IDE
%endif
%clean
rm -rf %{buildroot}
%files
%defattr(-, root, root)
%doc ACKNOWLEDGEMENTS KNOWN-BUGS LICENSE NOTICE README TRADEMARK_POLICY gpl-2.0.txt
%attr(755,root,root) %_bindir/%name
%{_prefix}/lib/scratch
%{_datadir}/scratch
%{_datadir}/applications/%name.desktop
%{_datadir}/pixmaps/%name.png
%if 0%{?suse_version} > 1200
%{_mandir}/man1/%name.1.gz
%dir %{_datadir}/mime/application
%{_datadir}/mime/application/%name.xml
%endif
%changelog