geany/geany.spec
2019-03-18 17:51:48 +03:00

164 lines
5.6 KiB
RPMSpec

%define major 0
%define libname %mklibname %{name} %{major}
%define devname %mklibname %{name} -d
#for educational needs
%bcond_without edm
Summary: Small C editor using GTK3
Name: geany
Version: 1.34.1
Release: 2
License: GPLv2+
Group: Development/Tools
URL: https://www.geany.org
Source0: http://download.geany.org/%{name}-%{version}.tar.bz2
# The following tags files were retrieved 6th Jan 2011
Source1: http://wiki.geany.org/_media/tags/dbus-glib-0.76.c.tags
Source2: http://wiki.geany.org/_media/tags/drupal.php.tags
Source3: http://wiki.geany.org/_media/tags/ethos-1.0.c.tags
Source4: http://wiki.geany.org/_media/tags/geany-api-0.21.c.tags
Source5: http://wiki.geany.org/_media/tags/gladeui-1.0.c.tags
Source6: http://wiki.geany.org/_media/tags/gnt.c.tags
Source7: http://wiki.geany.org/_media/tags/gtk_-2.24.c.tags
Source8: http://download.geany.org/contrib/tags/gtkscintilla-2.0.c.tags
Source9: http://wiki.geany.org/_media/tags/gtksourceview-3.0.c.tags
Source10: http://wiki.geany.org/_media/tags/libdevhelp-2.0.c.tags
Source11: http://wiki.geany.org/_media/tags/libgdl-3.0.c.tags
Source12: http://wiki.geany.org/_media/tags/libxml-2.0.c.tags
Source13: http://wiki.geany.org/_media/tags/sqlite3.c.tags
Source14: http://wiki.geany.org/_media/tags/standard.css.tags
Source15: http://wiki.geany.org/_media/tags/std.glsl.tags
Source16: http://wiki.geany.org/_media/tags/std.latex.tags
Source17: http://download.geany.org/contrib/tags/std.vala.tags
Source18: http://wiki.geany.org/_media/tags/v4l2.c.tags
Source19: http://wiki.geany.org/_media/tags/webkit-1.0.c.tags
Source20: http://wiki.geany.org/_media/tags/wordpress.php.tags
Source21: http://wiki.geany.org/_media/tags/xfce48.c.tags
Source22: http://advamacs.com/pub/tcl.tcl.tags
# https://github.com/geany/geany/pull/1900 Add basic Dockerfile syntax highlighting
Source23: filetypes.Dockerfile.conf
Source24: filetypes.spec.conf
# Russian help source. You may create another similar file for you language
Source50: index.html
Source51: images.tar.bz2
Source100: %{name}.rpmlintrc
# Russian doc patch
Patch0: ru_doc.patch
Patch1: geany-1.25-rosaconf.patch
Patch2: %{name}_filetype_extensions.patch
Patch3: %{name}_data_makefile.patch
Patch4: %{name}_filetypes.patch
Patch5: %{name}_makefile_spec.patch
Patch6: %{name}_filetypes.h_spec.patch
Patch7: %{name}_filetype_spec.patch
BuildRequires: desktop-file-utils
BuildRequires: imagemagick
BuildRequires: intltool
BuildRequires: perl-XML-Parser
BuildRequires: pkgconfig(gtk+-3.0)
Suggests: geany-plugins
Suggests: geany-themes
%description
Geany is a small C editor using GTK2 with basic features of an
integrated development environment. It features syntax highlighting,
code completion, call tips, many supported filetypes (including C,
Java, PHP, HTML, DocBook, Perl, LateX, and Bash), and symbol lists.
%files -f %{name}.lang
%{_bindir}/%{name}
%{_libdir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}
%{_defaultdocdir}/%{name}
%{_iconsdir}/hicolor/*/apps/*
%{_iconsdir}/hicolor/*/actions/*
%{_iconsdir}/Tango/*/actions/*
%{_mandir}/man1/%{name}.*
#----------------------------------------------------------------------------
%package -n %{libname}
Summary: Geany runtime library
Group: System/Libraries
%description -n %{libname}
Geany runtime library.
%files -n %{libname}
%{_libdir}/libgeany.so.%{major}*
#----------------------------------------------------------------------------
%package -n %{devname}
Summary: Header files for building Geany plug-ins
Group: Development/Other
Requires: %{libname} = %{EVRD}
Provides: %{name}-devel = %{EVRD}
Conflicts: %{name}-devel < 1.25-3
Obsoletes: %{name}-devel < 1.25-3
%description -n %{devname}
This package contains the header files and pkg-config file needed for
building Geany plug-ins. You do not need to install this package
%files -n %{devname}
%{_includedir}/%{name}
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/libgeany.so
#----------------------------------------------------------------------------
%prep
%setup -q
#patch0 -p1
#patch1 -p1
#patch2 -p0
#patch3 -p0
#patch4 -p0
#patch5 -p0
#patch6 -p0
#patch7 -p0
#install -Dm0644 %{SOURCE23} $RPM_BUILD_DIR/%{name}-%{version}/data/filedefs
#install -Dm0644 %{SOURCE24} $RPM_BUILD_DIR/%{name}-%{version}/data/filedefs
%build
./autogen.sh --enable-gtk3 --prefix=/usr
CC=c89 CFLAGS=-O2 LIBS='-lgmodule-2.0 -lposix' %configure2_5x --enable-gtk3
%make LIBS='-lgmodule-2.0'
%install
%makeinstall
#Fix for Russian
sed 's/Name\[ru\]=Geany/Name\[ru\]=Среда разработки Geany/g' -i %{buildroot}%{_datadir}/applications/geany.desktop
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}/html/ru/
install -Dpm 0644 %{SOURCE50} %{buildroot}%{_defaultdocdir}/%{name}/html/ru/
tar -xjvf %{SOURCE51}
mv images %{buildroot}%{_defaultdocdir}/%{name}/html/ru/
# research locale file
%find_lang %{name}
# prepare menu
# we remove the key "Version" and "Encoding" because it's invalid
desktop-file-install --vendor="" \
--remove-category="Application" \
--add-category="GNOME" \
--remove-key="Version" \
--remove-key="Encoding" \
--dir %{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/*
# Install tags files
install -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} \
%{SOURCE7} %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE11} %{SOURCE12}\
%{SOURCE13} %{SOURCE14} %{SOURCE15} %{SOURCE16} %{SOURCE17} %{SOURCE18}\
%{SOURCE19} %{SOURCE20} %{SOURCE21} %{SOURCE22}\
%{buildroot}%{_datadir}/%{name}
# remove useless file
rm -f %{buildroot}%{_datadir}/icons/hicolor/icon-theme.cache
rm -f %{buildroot}%{_datadir}/icons/Tango/icon-theme.cache