Blob Blame History Raw
%global __provides_exclude_from ^%{_libdir}/scratch/.*\\.so$
%undefine _strict_symbol_defs_build

%global srcname scratch
%global appname io.elementary.code
%global oldname org.pantheon.scratch

Name:           scratch-text-editor
Summary:        The text editor that works
Version:        2.4.1
Release:        10%{?dist}
License:        GPLv3

URL:            https://github.com/elementary/%{srcname}
Source0:        https://launchpad.net/scratch/2.x/%{version}/+download/%{name}-%{version}.tar.xz

# Patch to fix compilation on vala 0.35+
Patch0:         00-fix-vala-036-compilation.patch

# Upstream patches to fix compilation against granite 0.5+
# https://github.com/elementary/scratch/commit/44f44db769569d164c7abaa911a75f7e5a0a728b
# https://github.com/elementary/scratch/commit/abf5583c2a6f2406ca26dc64ca5cb3d1cd8d03d8
Patch1:         01-granite-0.5-fix.patch

# https://github.com/elementary/scratch/commit/1a9d5b045e2ff5fe8824ea738ed2ac2e991eb36a
Patch2:         02-another-granite-0.5-fix.patch

BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  gettext
BuildRequires:  intltool
BuildRequires:  libappstream-glib
BuildRequires:  vala

BuildRequires:  pkgconfig(gee-0.8)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(granite) >= 0.3.0
BuildRequires:  pkgconfig(gtksourceview-3.0) >= 3.10
BuildRequires:  pkgconfig(gtkspell3-3.0)
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.10
BuildRequires:  pkgconfig(libpeas-1.0)
BuildRequires:  pkgconfig(libpeas-gtk-1.0)
BuildRequires:  pkgconfig(libvala-0.40)
BuildRequires:  pkgconfig(libsoup-2.4)
BuildRequires:  pkgconfig(vte-2.91)
BuildRequires:  pkgconfig(webkit2gtk-4.0)
BuildRequires:  pkgconfig(zeitgeist-2.0)

Requires:       hicolor-icon-theme


%description
Scratch is the text editor that works for you. It auto-saves your files,
meaning they're always up-to-date. Plus it remembers your tabs so you
never lose your spot, even in between sessions.

Make it yours. Scratch is written from the ground up to be extensible.
Keep things super lightweight and simple, or install extensions to turn
Scratch into a full-blown IDE; it's your choice. And with a handful of
useful preferences, you can tweak the behavior and interface to your
liking.

It's elementary. Scratch is made to be the perfect text editor for
elementary, meaning it closely follows the high standards of design,
speed, and consistency. It's sexy, but not distracting.

Works with your language. Whether you're crafting code in Vala,
scripting with PHP, or marking things up in HTML, Scratch has you
covered. Experience full syntax highlighting with nearly all
programming, scripting, and markup languages.

Other syntax-highlighted languages: Bash, C, C#, C++. Cmake, CSS,
.Desktop, Diff, Fortran, Gettext, ini, Java, JavaScript, LaTex, Lua,
Makefile, Objective C, Pascal, Perl, Python, Ruby, XML.

Additional features include:

 * syntax highlighting with gtksourceview-3
 * a find bar to search the words in the files
 * strong integration with Granite framework by elementary-team
 * tab and split documents system
 * lots of others

Scratch needs to be translated. Go to Translations to help us providing
this software in your language!


%package        devel
Summary:        The text editor that works
Requires:       %{name}%{?_isa} = %{version}-%{release}
%description    devel
Scratch is the text editor that works for you. It auto-saves your files,
meaning they're always up-to-date. Plus it remembers your tabs so you
never lose your spot, even in between sessions.

This package contains the development headers.


%prep
%autosetup -p1


%build
mkdir build && pushd build
%cmake ..
%make_build
popd


%install
pushd build
%make_install
popd

%find_lang %{name}


%check
desktop-file-validate \
    %{buildroot}/%{_datadir}/applications/%{oldname}.desktop

appstream-util validate-relax --nonet \
    %{buildroot}/%{_datadir}/appdata/%{oldname}.appdata.xml


%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig


%files -f %{name}.lang
%doc README
%license COPYING

%{_bindir}/%{name}

%{_libdir}/scratch/
%{_libdir}/libscratchcore.so.0
%{_libdir}/libscratchcore.so.0.0

%{_datadir}/appdata/%{oldname}.appdata.xml
%{_datadir}/applications/%{oldname}.desktop
%{_datadir}/glib-2.0/schemas/%{oldname}*.gschema.xml
%{_datadir}/scratch/

%files devel
%{_includedir}/scratch/

%{_libdir}/libscratchcore.so
%{_libdir}/pkgconfig/scratchcore.pc

%{_datadir}/vala/vapi/scratchcore.deps
%{_datadir}/vala/vapi/scratchcore.vapi


%changelog
* Wed Jun 13 2018 Fabio Valentini <decathorpe@gmail.com> - 2.4.1-10
- Rebuild for granite5 soname bump.

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Jan 24 2018 Fabio Valentini <decathorpe@gmail.com> - 2.4.1-8
- Be lazy about undefined symbols in plugins.
- Clean up .spec file.

* Wed Dec 20 2017 Kalev Lember <klember@redhat.com> - 2.4.1-7
- Rebuilt for vala 0.40

* Sat Nov 04 2017 Fabio Valentini <decathorpe@gmail.com> - 2.4.1-6
- Rebuild for granite soname bump.
- Add upstream patches to fix building against granite 0.5+.

* Mon Aug 21 2017 Kalev Lember <klember@redhat.com> - 2.4.1-5
- Rebuilt for vala 0.38

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Thu May 18 2017 Fabio Valentini <decathorpe@gmail.com> - 2.4.1-2
- Add upstream patch to fix compilation with vala 0.35+.

* Mon Feb 20 2017 Fabio Valentini <decathorpe@gmail.com> - 2.4.1-1
- Update to version 2.4.1.

* Mon Feb 13 2017 Kalev Lember <klember@redhat.com> - 2.4-2
- Rebuilt for vala 0.36

* Fri Feb 10 2017 Fabio Valentini <decathorpe@gmail.com> - 2.4-1
- Update to version 2.4.

* Sun Jan 29 2017 Fabio Valentini <decathorpe@gmail.com> - 2.3-9
- Rename icon to match .desktop file.

* Wed Jan 25 2017 Fabio Valentini <decathorpe@gmail.com> - 2.3-8
- Include icon to fix appstream metadata generation.
- Filter provides to not pick up internal plugins.
- Remove explicit BR: pkgconfig.

* Tue Jan 03 2017 Fabio Valentini <decathorpe@gmail.com> - 2.3-7
- Clean up spec file.

* Thu Oct 06 2016 Fabio Valentini <decathorpe@gmail.com> - 2.3-6
- "Fix" ldconfig path in scriptlets.

* Thu Sep 29 2016 Fabio Valentini <decathorpe@gmail.com> - 2.3-5
- Clean up spec.

* Thu Sep 29 2016 Fabio Valentini <decathorpe@gmail.com> - 2.3-4
- Mass rebuild.

* Wed Sep 28 2016 Fabio Valentini <decathorpe@gmail.com> - 2.3-3
- Spec file cleanups.

* Mon Sep 19 2016 Fabio Valentini <decathorpe@gmail.com> - 2.3-2
- Spec file cosmetics.

* Thu Aug 11 2016 Fabio Valentini <decathorpe@gmail.com> - 2.3-1
- Update to version 2.3.