%global forgeurl https://github.com/d2lang/d2-vim %global commit a950f1a276506ac4bbc274dd65ba98b15a1d490d %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commitdate 20260801 Name: vim-d2 Version: 0^%{commitdate}git%{shortcommit} Release: %autorelease Summary: Vim syntax and file type plugin for D2 diagram language License: BSD-2-Clause URL: %{forgeurl} Source0: %{forgeurl}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz BuildArch: noarch Requires: vim-filesystem Requires: d2 Recommends: vim-enhanced Provides: d2-vim = %{version}-%{release} %description Vim plugin for D2 diagram scripting language. Provides syntax highlighting, file type detection, indentation, compiler integration (:make to render diagrams), and formatting commands. %prep %autosetup -n d2-vim-%{commit} -p1 %build # Pure Vim script, no compilation needed %install mkdir -p %{buildroot}%{_datadir}/vim/vimfiles/{autoload,compiler,doc,ftdetect,ftplugin,indent,plugin,syntax} cp -a autoload/* %{buildroot}%{_datadir}/vim/vimfiles/autoload/ cp -a compiler/* %{buildroot}%{_datadir}/vim/vimfiles/compiler/ cp -a doc/* %{buildroot}%{_datadir}/vim/vimfiles/doc/ cp -a ftdetect/* %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/ cp -a ftplugin/* %{buildroot}%{_datadir}/vim/vimfiles/ftplugin/ cp -a indent/* %{buildroot}%{_datadir}/vim/vimfiles/indent/ cp -a plugin/* %{buildroot}%{_datadir}/vim/vimfiles/plugin/ cp -a syntax/* %{buildroot}%{_datadir}/vim/vimfiles/syntax/ %check # Verify vim script files are readable test -s %{buildroot}%{_datadir}/vim/vimfiles/syntax/d2.vim test -s %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/d2.vim %files %license LICENSE.txt %doc README.md %{_datadir}/vim/vimfiles/autoload/d2* %{_datadir}/vim/vimfiles/compiler/d2.vim %{_datadir}/vim/vimfiles/doc/d2.txt %{_datadir}/vim/vimfiles/ftdetect/d2.vim %{_datadir}/vim/vimfiles/ftplugin/d2.vim %{_datadir}/vim/vimfiles/indent/d2.vim %{_datadir}/vim/vimfiles/plugin/d2.vim %{_datadir}/vim/vimfiles/syntax/d2.vim %changelog %autochangelog