## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

%global  commit       31b93cef8241bbba8cb232edcc5fd96b24584942
%global  shortcommit  %(c=%{commit}; echo ${c:0:8})
%global  commitdate   20250115
Name:           cambalache
Version:        0.94.1^%{commitdate}.%{shortcommit}
Release:        %autorelease
Summary:        User interface maker

License:        LGPL-2.1-only AND GPL-2.0-only
URL:            https://gitlab.gnome.org/jpu/cambalache
Source:         %{url}/-/archive/%{commit}/cambalache-%{shortcommit}.tar.gz

BuildRequires:  gcc
BuildRequires:  meson
BuildRequires:  ninja-build

BuildRequires:  pkgconfig(casilda-0.1)
BuildRequires:  pkgconfig(gtk+-3.0)
BuildRequires:  pkgconfig(gtk4)
#BuildRequires:  gtk4-devel-tools
BuildRequires:  pkgconfig(libadwaita-1)
BuildRequires:  pkgconfig(libhandy-1)
BuildRequires:  pkgconfig(pygobject-3.0)

BuildRequires:  gtksourceview5-devel
BuildRequires:  python3-devel
BuildRequires:  python3-lxml
BuildRequires:  python3-gobject-devel
#BuildRequires:  python3-pytest
BuildRequires:  webkitgtk6.0-devel
BuildRequires:  webkit2gtk4.1-devel

BuildRequires:  desktop-file-utils
BuildRequires:  libappstream-glib
Requires:  hicolor-icon-theme
# Needed for ownsership of %{_datadir}/gir-1.0
Requires:  gobject-introspection-devel%{?_isa}

%description
Cambalache is a RAD tool for Gtk 4 and 3 with a clear MVC design and data model
first philosophy. This translates to a wide feature coverage with minimal/none
developer intervention for basic support.

%prep
%autosetup -n cambalache-%{commit}


%build
%meson
%meson_build


%install
%meson_install
%find_lang %{name}

%check
#pytest

desktop-file-validate %{buildroot}/%{_datadir}/applications/ar.xjuan.Cambalache.desktop
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/ar.xjuan.Cambalache.metainfo.xml

%files -f %{name}.lang
%license COPYING
%license COPYING.GPL
%doc README.md
%doc CHANGELOG.md
%doc SUPPORTERS.md
%{_bindir}/cambalache
%{_bindir}/cmb-catalog-gen
%dir %{_datadir}/cambalache
%{_datadir}/cambalache/*.gresource
%dir %{_datadir}/cambalache/catalogs
%{_datadir}/cambalache/catalogs/*.xml
%{_datadir}/applications/ar.xjuan.Cambalache.desktop
%{_datadir}/gir-1.0/CambalachePrivate-3.0.gir
%{_datadir}/gir-1.0/CambalachePrivate-4.0.gir
%{_datadir}/gir-1.0/CmbCatalogUtils-3.0.gir
%{_datadir}/gir-1.0/CmbCatalogUtils-4.0.gir
%{_datadir}/glib-2.0/schemas/ar.xjuan.Cambalache.gschema.xml
%{_datadir}/icons/hicolor/scalable/apps/ar.xjuan.Cambalache.svg
%{_datadir}/icons/hicolor/scalable/mimetypes/ar.xjuan.Cambalache.mime.svg
%{_datadir}/icons/hicolor/symbolic/apps/ar.xjuan.Cambalache-symbolic.svg
%{_metainfodir}/ar.xjuan.Cambalache.metainfo.xml
# These should likely be added to filesystem package
%dir %{_datadir}/mime
%dir %{_datadir}/mime/packages
%{_datadir}/mime/packages/ar.xjuan.Cambalache.mime.xml
%{python3_sitelib}/cambalache/
%{python3_sitelib}/cmb_catalog_gen/
%{_libdir}/girepository-1.0/CambalachePrivate-3.0.typelib
%{_libdir}/girepository-1.0/CambalachePrivate-4.0.typelib
%{_libdir}/girepository-1.0/CmbCatalogUtils-3.0.typelib
%{_libdir}/girepository-1.0/CmbCatalogUtils-4.0.typelib
%dir %{_libdir}/cambalache
%{_libdir}/cambalache/libcambalacheprivate-3.so
%{_libdir}/cambalache/libcambalacheprivate-4.so
%dir %{_libdir}/cmb_catalog_gen
%{_libdir}/cmb_catalog_gen/libcmbcatalogutils-3.so
%{_libdir}/cmb_catalog_gen/libcmbcatalogutils-4.so
   
%changelog
## START: Generated by rpmautospec
* Wed Jan 15 2025 John Doe <packager@example.com> - 0.94.1^20250115.31b93cef-1
- Uncommitted changes
## END: Generated by rpmautospec