move generating of /etc/nanorc to %build

This commit is contained in:
Kamil Dudka 2017-07-21 13:02:26 +02:00
parent b8b385e3ea
commit fbf84ec489

View File

@ -31,25 +31,26 @@ cd build
%configure %configure
make %{?_smp_mflags} make %{?_smp_mflags}
%install # generate default /etc/nanorc
cd build
%make_install
rm -f %{buildroot}%{_infodir}/dir
cp %{SOURCE2} ./nanorc
# downstream changes to /etc/nanorc
# - disable line wrapping by default # - disable line wrapping by default
# - set hunspell as the default spell-checker # - set hunspell as the default spell-checker
# - enable syntax highlighting by default (#1270712) # - enable syntax highlighting by default (#1270712)
sed -e 's/# set nowrap/set nowrap/' \ sed -e 's/# set nowrap/set nowrap/' \
-e 's/^#.*set speller.*$/set speller "hunspell"/' \ -e 's/^#.*set speller.*$/set speller "hunspell"/' \
-e 's|^# \(include "/usr/share/nano/\*.nanorc"\)|\1|' \ -e 's|^# \(include "/usr/share/nano/\*.nanorc"\)|\1|' \
doc/sample.nanorc >> ./nanorc %{SOURCE2} doc/sample.nanorc > ./nanorc
mkdir -p %{buildroot}%{_sysconfdir}
install -m 644 ./nanorc %{buildroot}%{_sysconfdir}/nanorc %install
cd build
%make_install
rm -f %{buildroot}%{_infodir}/dir
# remove installed HTML documentation # remove installed HTML documentation
rm -f "%{buildroot}%{_docdir}"/nano/{nano,nano.1,nanorc.5,rnano.1}.html rm -f %{buildroot}%{_docdir}/nano/{nano,nano.1,nanorc.5,rnano.1}.html
# install default /etc/nanorc
mkdir -p %{buildroot}%{_sysconfdir}
install -m 0644 ./nanorc %{buildroot}%{_sysconfdir}/nanorc
%find_lang %{name} %find_lang %{name}