Blob Blame History Raw
Name:           ktikz
Version:        0.10
Release:        1%{?dist}
Summary:        KDE Editor for the TikZ language

Group:          Applications/Publishing
License:        GPLv2+
URL:            http://www.hackenberger.at/blog/ktikz-editor-for-the-tikz-language
Source0:        http://www.hackenberger.at/%{name}/%{name}_%{version}.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  desktop-file-utils
BuildRequires:  gettext
BuildRequires:  kdelibs-devel
BuildRequires:  poppler-qt4-devel
# Owns /usr/share/icons/hicolor/
Requires:       hicolor-icon-theme
Requires:       kdebase-runtime
# pdftops required by ktikz
Requires:       poppler-utils
Requires:       xdg-utils
Requires:       tex-preview

%description
KTikZ is a small application to assist in the creation of diagrams and drawings
using the TikZ macros from the LaTeX package "pgf". It consists of a text editor
pane in which the TikZ code for the drawing is edited and a preview pane showing
the drawing as rendered by LaTeX. The preview pane can be updated in
real-time. Common drawing tools, options and styles are available from the menus
to assist the coding process.

This package contains the KDE version of the program.


%package -n qtikz
Summary:        Editor for the TikZ language
Group:          Applications/Publishing
# pdftops required by qtikz
Requires:       poppler-utils
Requires:       xdg-utils
Requires:       tex-preview

%description -n qtikz
QTikZ is a small application to assist in the creation of diagrams and drawings
using the TikZ macros from the LaTeX package "pgf". It consists of a text editor
pane in which the TikZ code for the drawing is edited and a preview pane showing
the drawing as rendered by LaTeX. The preview pane can be updated in
real-time. Common drawing tools, options and styles are available from the menus
to assist the coding process.

This package contains the Qt version of the program.


%prep
%setup -q -n %{name}

# Use xdg-open instead of kwrite as defaut editor in qtikz
sed -i "s|TEMPLATE_EDITOR_DEFAULT = kwrite|TEMPLATE_EDITOR_DEFAULT = xdg-open|" defaults.pri


%build
# Build ktikz
mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake_kde4} ..
popd
make %{?_smp_mflags} -C %{_target_platform}

# Build qtikz
%{_qt4_qmake}
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install INSTALL_ROOT=$RPM_BUILD_ROOT
# Install KDE integration
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}

desktop-file-validate $RPM_BUILD_ROOT/%{_kde4_datadir}/applications/kde4/%{name}.desktop
desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/qtikz.desktop

%find_lang %{name}


%clean
rm -rf $RPM_BUILD_ROOT


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


%post -n qtikz
update-desktop-database &> /dev/null || :
update-mime-database %{_datadir}/mime &> /dev/null || :


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


%postun -n qtikz
update-desktop-database &> /dev/null || :
update-mime-database %{_datadir}/mime &> /dev/null || :


%posttrans
gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :


%files -f %{name}.lang
%defattr(-,root,root,-)
%doc Changelog LICENSE.GPL2 README TODO
%{_kde4_bindir}/%{name}
%{_kde4_libdir}/kde4/*.so
%{_kde4_datadir}/applications/kde4/%{name}.desktop
%{_kde4_datadir}/config.kcfg/%{name}.kcfg
%{_kde4_docdir}/HTML/en/%{name}/
%{_kde4_iconsdir}/hicolor/*/apps/%{name}.*
%{_kde4_appsdir}/%{name}/
%{_kde4_appsdir}/%{name}part/
%{_kde4_datadir}/kde4/services/%{name}part.desktop
%{_kde4_datadir}/mime/packages/%{name}.xml
%{_mandir}/man1/%{name}.1.*


%files -n qtikz
%defattr(-,root,root,-)
%doc Changelog LICENSE.GPL2 README TODO
%{_bindir}/qtikz
%{_datadir}/applications/qtikz.desktop
%{_datadir}/mime/packages/qtikz.xml
%{_datadir}/qtikz/
%{_mandir}/man1/qtikz.1.*


%changelog
* Fri Nov 12 2010 Mohamed El Morabity <melmorabity@fedoraproject.org> 0.10-1
- Initial RPM release