%{!?python3_sitearch: %define python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}

Summary:  Develop software for GNOME
Summary(ja):  GNOME 用統合開発環境
Name:    gnome-builder
Version: 3.20.4
Release: 2%{?_dist_release}
License: GPLv3
Group:   Applications/Development
URL:     https://wiki.gnome.org/Apps/Builder

Source: http://ftp.gnome.org/pub/GNOME/sources/%{name}/3.20/%{name}-%{version}.tar.xz

BuildRoot: %{_tmppath}/%{name}-%{version}-root

BuildRequires: glib2-devel
BuildRequires: llvm-devel
BuildRequires: clang-devel
BuildRequires: gtk3-devel
BuildRequires: gtksourceview3-devel
BuildRequires: devhelp-devel
BuildRequires: libgit2-glib-devel
BuildRequires: gjs-devel
BuildRequires: python3-devel
BuildRequires: pygobject3-devel
BuildRequires: python3-pygobject
BuildRequires: pcre-devel
BuildRequires: libpeas-devel
BuildRequires: yelp-tools
BuildRequires: desktop-file-utils

Requires(postun,posttrans): desktop-file-utils
Requires(postun,posttrans): glib2

Vendor:   Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi


%description
Builder is a new IDE for GNOME that is focused on bringing the power
of our platform to more developers than ever before. 

%description -l ja
gnome-builder はより多くの開発者にGNOMEのプラットフォーム力をもたらすことに
焦点を当てた新しい統合開発環境です。


%package        devel
Summary:        Development tools for %{name}
Summary(ja):    %{name} の開発環境
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       pkgconfig

%description devel
Header files and libraries for building a extension library for the %{name}.


%prep
%setup -q

%build
%configure --disable-static

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT

%{__make} install DESTDIR=${RPM_BUILD_ROOT}

find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} \;

rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}

%find_lang %{name} --with-gnome

%clean
rm -rf $RPM_BUILD_ROOT

%post
touch --no-create %{_datadir}/icons/hicolor &> /dev/null || :

%postun
if [ $1 -eq 0 ]; then
  touch --no-create %{_datadir}/icons/hicolor &> /dev/null || :
  gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || :
  update-desktop-database -q &> /dev/null ||:
  glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:
fi

%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &> /dev/null || :
update-desktop-database -q &> /dev/null ||:
glib-compile-schemas %{_datadir}/glib-2.0/schemas ||:


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc COPYING README NEWS
%{_bindir}/%{name}
%{_bindir}/%{name}-worker
%{_bindir}/ide
%{_libdir}/%{name}/libide-1.0.so
%{_libdir}/%{name}/libegg-private.so.*
%{_libdir}/%{name}/libpanel-gtk.so.*
%{_libdir}/%{name}/librg.so.*
%{_libdir}/%{name}/libsearch.so.*
%{_libdir}/%{name}/libtemplate-glib-1.0.so.*
%{_libdir}/%{name}/girepository-1.0/Egg-1.0.typelib
%{_libdir}/%{name}/girepository-1.0/Ide-1.0.typelib
%{_libdir}/%{name}/girepository-1.0/Pnl-1.0.typelib
%{_libdir}/%{name}/girepository-1.0/Template-1.0.typelib
%{_libdir}/%{name}/plugins/*
%{_libexecdir}/%{name}/ide-list-counters
%{python3_sitearch}/gi/overrides/Ide.py
%{python3_sitearch}/gi/overrides/__pycache__/Ide.cpython-*
%{_datadir}/appdata/org.gnome.Builder.appdata.xml
%{_datadir}/applications/org.gnome.Builder.desktop
%{_datadir}/dbus-1/services/org.gnome.Builder.service
%{_datadir}/glib-2.0/schemas/org.gnome.builder.build.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.code-insight.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.editor.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.editor.language.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.extension-type.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.gnome-code-assistance.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.plugin.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.project-tree.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.terminal.gschema.xml
%{_datadir}/glib-2.0/schemas/org.gnome.builder.workbench.gschema.xml
%{_datadir}/%{name}/fonts/BuilderBlocks.ttf
%{_datadir}/%{name}/plugins/*
%{_datadir}/gtksourceview-3.0/styles/*.xml
%{_datadir}/icons/*/*/*/*
%{_datadir}/gtk-doc/html/libide

%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}-%{version}
%{_libdir}/%{name}/libegg-private.so
%{_libdir}/%{name}/libpanel-gtk.so
%{_libdir}/%{name}/librg.so
%{_libdir}/%{name}/libsearch.so
%{_libdir}/%{name}/libtemplate-glib-1.0.so
%{_libdir}/%{name}/pkgconfig/libide-1.0.pc
%{_libdir}/%{name}/pkgconfig/template-glib-1.0.pc
%{_datadir}/%{name}/gir-1.0/Egg-1.0.gir
%{_datadir}/%{name}/gir-1.0/Ide-1.0.gir
%{_datadir}/%{name}/gir-1.0/Pnl-1.0.gir
%{_datadir}/%{name}/gir-1.0/Template-1.0.gir


%changelog
* Tue Aug 21 2018 Toshiaki Ara <ara_t@384.jp> 3.20.4-2
- rebuild with liggit2-0.27.4

* Mon Jul 18 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.20.4-1
- new upstream release
- add BuildRequires: desktop-file-utils

* Sun Nov 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.18.1-1
- new upstream release
- add BuildRequires: libpeas-devel

* Sat May 23 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.3-1
- new upstream release

* Sun Apr 19 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.2-1
- new upstream release

* Wed Apr 01 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.16.0-1
- initial build

