# file: scite.spec # %global Name SciTE %global major 3 %global minor 7 %global patch 5 %global gtk 3 %global release 6 %global name %{lua: print( string.lower( rpm.expand( "%{Name}" ) ) ) } Name: %{name} Version: %{major}.%{minor}.%{patch} Release: %{release}.vdb%{?dist} Summary: SCIntilla based Text Editor Group: Applications/Editors License: MIT # SciTE license is HPND, but prescribes # using "MIT" license identifier. URL: http://www.scintilla.org Source0: http://www.scintilla.org/%{name}%{major}%{minor}%{patch}.tgz Source999: vdb.lua Patch1001: scite-3.7.5-ldlibs.vdb.patch # Display current column correctly if virtual space is enabled: Patch1002: scite-3.7.5-current-column.patch Patch1003: scite-3.7.5-strip-trailing-space-but-do-not-move-caret.patch Requires: filesystem # ${_datadir}/doc BuildRequires: coreutils BuildRequires: desktop-file-utils BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: pkgconfig BuildRequires: pkgconfig(gtk+-%{gtk}.0) BuildRequires: pkgconfig(lua) BuildRequires: pkgconfig(scintilla-gtk%{gtk}) # Magic is behind the scene: %include %{S:999} %description Originally built to demonstrate Scintilla, SciTE has grown to be a generally useful editor with facilities for building and running programs. It is best used for jobs with simple configurations. This SciTE is built with GTK%{gtk} and tuned to use *shared* Scintilla and Lua libraries. %prep %setup -q -n %{name} %patch1001 %patch1002 %patch1003 # Scite source tarball includes Scintilla sources. Delete bundled Scintilla. # Scintilla source directory is side-by-side with scite source. To delete Scintilla sources # I would have to run # rm -rf ../scintilla # However, I do not like to delete directory with `..`. Let us use absolute path instead. %{__rm} -rf %{_builddir}/scintilla # Scite source tarball includes Lua sources. Delete bundled Lua: %{__rm} -rf lua %{__rm} -f gtk/deps.mak # We will move doc files into another directory, so we also have to fix path to doc files: %{__sed} -i \ -e 's|\(file://\)\$(SciteDefaultHome)/\(SciTEDoc\.html\)|\1%{_pkgdocdir}/\2|' \ src/*.properties %build scintilla_cflags=$( pkg-config --cflags scintilla-gtk%{gtk} ) scintilla_libs=$( pkg-config --libs scintilla-gtk%{gtk} ) lua_cflags=$( pkg-config --cflags lua ) lua_libs=$( pkg-config --libs lua ) %{make_build} \ -C gtk \ GTK%{gtk}=1 \ COMPLIB= \ LUA_CORE_OBJS= LUA_LIB_OBJS= \ CFLAGS="%{optflags} $scintilla_cflags $lua_cflags" \ CXXFLAGS="%{optflags} $scintilla_cflags $lua_cflags" \ LDLIBS="$scintilla_libs $lua_libs" %{__gzip} -k doc/%{name}.1 %install %{make_install} -C gtk GTK%{gtk}=1 %{__mv} "%{buildroot}%{_bindir}/%{Name}" "%{buildroot}%{_bindir}/%{name}" %{__install} -Dp -t %{buildroot}%{_mandir}/man1/ doc/%{name}.1.gz %{__ln_s} %{name} %{buildroot}%{_bindir}/%{Name} # SciTE.desktop installed by makefile is executable and causes few desktop-file-validate warnings. # Let's fix it: desktop-file-install \ --remove-key=Encoding \ --remove-category=Application \ --add-category=Utility \ gtk/%{Name}.desktop # SciTE makefile installs html doc files into /usr/share/scite/ directory. Let's move them to # doc directory: %{__mkdir_p} %{buildroot}%{_pkgdocdir} %{__mv} %{buildroot}%{_datadir}/%{name}/*.html %{buildroot}%{_pkgdocdir} %check desktop-file-validate %{buildroot}%{_datadir}/applications/%{Name}.desktop %clean %files %defattr( 644, root, root, 755 ) %attr( 755, -, - ) %{_bindir}/%{name} %{_bindir}/%{Name} %{_datadir}/applications/%{Name}.desktop %{_datadir}/pixmaps/*.png %dir %{_datadir}/%{name} %{_datadir}/%{name}/* %doc %dir %{_pkgdocdir} %doc %{_pkgdocdir}/* %doc %{_mandir}/man1/%{name}.1.gz %license License.txt %post %postun %changelog * Mon Dec 3 2018 Van de Bugger - 3.7.5-6.vdb - Rebuild for F29. * Tue Jan 30 2018 Van de Bugger - 3.7.5-5.vdb - Applied patch "Strip trailing space but do not move caret". * Mon Jan 29 2018 Van de Bugger - 3.7.5-4.vdb - Applied patch "Display current column correctly if virtual space is enabled". * Sat Jan 27 2018 Van de Bugger - 3.7.5-3.vdb - Documentation files moved to documentation directory and properly marked. - Build requirements specified in recommended form (pkgconfig(foo) instead of foo-devel). * Fri Jan 26 2018 Van de Bugger - 3.7.5-2.vdb - Desktop file handled properly. * Fri Jan 26 2018 Van de Bugger - 3.7.5-1.vdb - Updated to v3.7.5. - Lua debundled. * Wed Sep 28 2016 Van de Bugger - 3.6.7-1.vdb - Updated to v3.6.7. - SciTE binary is stripped now. - scite-deps.patch dropped because it is included upstream. * Thu Sep 15 2016 Van de Bugger - 3.6.6-1.vdb - Initial release.