Reduce macro indirection in the spec file

epel8
Benjamin A. Beasley 3 years ago
parent 67c353ac34
commit 638f494530

@ -39,8 +39,8 @@ Summary: Meta-build system that generates build files for Ninja
# verify this with: # verify this with:
# gdb -ex 'set pagination off' -ex 'info sources' gn | grep -F gn_test.cc # gdb -ex 'set pagination off' -ex 'info sources' gn | grep -F gn_test.cc
License: BSD and Unicode and MIT License: BSD and Unicode and MIT
URL: https://%{name}.googlesource.com/%{name} URL: https://gn.googlesource.com/gn
Source0: %{url}/+archive/%{commit}.tar.gz#/%{name}-%{shortcommit}.tar.gz Source0: %{url}/+archive/%{commit}.tar.gz#/gn-%{shortcommit}.tar.gz
# Generated using script update-version: # Generated using script update-version:
Source1: last_commit_position.h Source1: last_commit_position.h
Source2: update-version Source2: update-version
@ -51,9 +51,9 @@ Source2: update-version
# https://src.fedoraproject.org/rpms/chromium/raw/ # https://src.fedoraproject.org/rpms/chromium/raw/
# ce30313f5e4af121140c037bf026453355534f24/f/ # ce30313f5e4af121140c037bf026453355534f24/f/
# chromium-84.0.4147.105-gn-gcc-cleanup.patch # chromium-84.0.4147.105-gn-gcc-cleanup.patch
Patch0: %{name}-39a87c0b-gcc-cleanup.patch Patch0: gn-39a87c0b-gcc-cleanup.patch
# Stop overriding optimization flags # Stop overriding optimization flags
Patch1: %{name}-0153d369-no-O3.patch Patch1: gn-0153d369-no-O3.patch
BuildRequires: python3 BuildRequires: python3
BuildRequires: python3-devel BuildRequires: python3-devel
@ -68,11 +68,11 @@ BuildRequires: help2man
Requires: vim-filesystem Requires: vim-filesystem
Requires: python3 Requires: python3
Provides: vim-%{name} = %{version}-%{release} Provides: vim-gn = %{version}-%{release}
BuildRequires: emacs BuildRequires: emacs
Requires: emacs-filesystem >= %{_emacs_version} Requires: emacs-filesystem >= %{_emacs_version}
Provides: emacs-%{name} = %{version}-%{release} Provides: emacs-gn = %{version}-%{release}
%description %description
@ -84,11 +84,11 @@ Summary: Documentation for GN
BuildArch: noarch BuildArch: noarch
%description doc %description doc
The %{name}-doc package contains detailed documentation for GN. The gn-doc package contains detailed documentation for GN.
%prep %prep
%autosetup -c -n %{name}-%{commit} -p1 %autosetup -c -n gn-%{commit} -p1
# Use pre-generated last_commit_position.h. # Use pre-generated last_commit_position.h.
mkdir -p ./out mkdir -p ./out
@ -125,29 +125,29 @@ find . -type f -name '*.md' | parallel -v pandoc -o '{.}.html' '{}'
help2man \ help2man \
--name='%{summary}' \ --name='%{summary}' \
--version-string="%{name} $(./out/%{name} --version)" \ --version-string="gn $(./out/gn --version)" \
--no-info \ --no-info \
./out/%{name} | ./out/gn |
# Clean up a couple of stray binary bytes in the help output # Clean up a couple of stray binary bytes in the help output
tr -d '\302\240' | tr -d '\302\240' |
# Format the entries within the sections as tagged paragraphs, and italicise # Format the entries within the sections as tagged paragraphs, and italicise
# [placeholders in square brackets]. # [placeholders in square brackets].
sed -r -e 's/(^[[:alnum:]_]+:)/.TP\n.B \1\n/' \ sed -r -e 's/(^[[:alnum:]_]+:)/.TP\n.B \1\n/' \
-e 's/\[([^]]+)\]/\\fI[\1]\\fR/g' > out/%{name}.1 -e 's/\[([^]]+)\]/\\fI[\1]\\fR/g' > out/gn.1
%install %install
install -t '%{buildroot}%{_bindir}' -D -p out/%{name} install -t '%{buildroot}%{_bindir}' -D -p out/gn
install -d '%{buildroot}%{_datadir}/vim/vimfiles' install -d '%{buildroot}%{_datadir}/vim/vimfiles'
cp -vrp misc/vim/* '%{buildroot}%{_datadir}/vim/vimfiles' cp -vrp misc/vim/* '%{buildroot}%{_datadir}/vim/vimfiles'
find '%{buildroot}%{_datadir}/vim/vimfiles' \ find '%{buildroot}%{_datadir}/vim/vimfiles' \
-type f -name 'README.*' -print -delete -type f -name 'README.*' -print -delete
%py_byte_compile %{__python3} '%{buildroot}%{_datadir}/vim/vimfiles/%{name}-format.py' %py_byte_compile %{__python3} '%{buildroot}%{_datadir}/vim/vimfiles/gn-format.py'
install -t '%{buildroot}%{_emacs_sitestartdir}' -D -p -m 0644 misc/emacs/*.el install -t '%{buildroot}%{_emacs_sitestartdir}' -D -p -m 0644 misc/emacs/*.el
install -t '%{buildroot}%{_mandir}/man1' -D -m 0644 -p out/%{name}.1 install -t '%{buildroot}%{_mandir}/man1' -D -m 0644 -p out/gn.1
%check %check
@ -164,17 +164,17 @@ grep -E '^#define[[:blank:]]+LAST_COMMIT_POSITION[[:blank:]]+'\
%files %files
%license LICENSE %license LICENSE
%{_bindir}/%{name} %{_bindir}/gn
%{_mandir}/man1/%{name}.1* %{_mandir}/man1/gn.1*
%{_datadir}/vim/vimfiles/%{name}-format.py %{_datadir}/vim/vimfiles/gn-format.py
%{_datadir}/vim/vimfiles/autoload/%{name}.vim %{_datadir}/vim/vimfiles/autoload/gn.vim
%{_datadir}/vim/vimfiles/ftdetect/%{name}filetype.vim %{_datadir}/vim/vimfiles/ftdetect/gnfiletype.vim
%{_datadir}/vim/vimfiles/ftplugin/%{name}.vim %{_datadir}/vim/vimfiles/ftplugin/gn.vim
%{_datadir}/vim/vimfiles/syntax/%{name}.vim %{_datadir}/vim/vimfiles/syntax/gn.vim
%{_emacs_sitestartdir}/%{name}-mode.el %{_emacs_sitestartdir}/gn-mode.el
%files doc %files doc

Loading…
Cancel
Save