From 42424954aae9ec26109ff629f77d829569a09f8a Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Apr 14 2020 17:36:32 +0000 Subject: Remove slashes after %{buildroot} %{_bindir} etc. already starts with a slash. There is no need to put a slash after %{buildroot}. (Except when pointing to the literal root of the buildroot and using just "%{buildroot}/".) --- diff --git a/modules/ROOT/pages/_partials/proc_rpm_creating_an_rpm.adoc b/modules/ROOT/pages/_partials/proc_rpm_creating_an_rpm.adoc index 77d37c1..3438238 100644 --- a/modules/ROOT/pages/_partials/proc_rpm_creating_an_rpm.adoc +++ b/modules/ROOT/pages/_partials/proc_rpm_creating_an_rpm.adoc @@ -61,8 +61,8 @@ A simple program to greet the user, Texas style. + [source] ---- -mkdir -p %{buildroot}/%{_bindir} -install -p -m 755 %{SOURCE0} %{buildroot}/%{_bindir} +mkdir -p %{buildroot}%{_bindir} +install -p -m 755 %{SOURCE0} %{buildroot}%{_bindir} ---- + NOTE: In this example, we use the following three macros: `%\{buildroot}`, `%\{_bindir}`, and `%\{SOURCE0}`. This method ignores the origin of the files and directories and focuses on the destination of the files. Without `%\{buildroot}` the files might install directly onto your development machine. This is not recommended, especially if you run as root. For more information on macros and `.spec` file entries, see xref:con_rpm_spec_file_overview[]. diff --git a/modules/ROOT/pages/create-hello-world-rpm.adoc b/modules/ROOT/pages/create-hello-world-rpm.adoc index 077cd9e..9964072 100644 --- a/modules/ROOT/pages/create-hello-world-rpm.adoc +++ b/modules/ROOT/pages/create-hello-world-rpm.adoc @@ -147,7 +147,7 @@ If the program uses GNU `info` files, you need to make sure the installation and * delete the `dir` file in `%install`: ---- -$ rm -f %{buildroot}/%{_infodir}/dir +$ rm -f %{buildroot}%{_infodir}/dir ---- * `Requires(post): info` and `Requires(preun): info` @@ -202,7 +202,7 @@ make %{?_smp_mflags} %install %make_install %find_lang %{name} -rm -f %{buildroot}/%{_infodir}/dir +rm -f %{buildroot}%{_infodir}/dir %post /sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :