Bug 1095408 - A comment in spec file is ignored
Summary: A comment in spec file is ignored
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-07 15:51 UTC by Lukas Slebodnik
Modified: 2019-11-21 09:47 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-05-08 08:20:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
The problematic spec file with commented out lines (23.15 KB, text/x-rpm-spec)
2014-05-07 15:51 UTC, Lukas Slebodnik
no flags Details
output from build (1.41 MB, text/x-log)
2014-05-07 15:55 UTC, Lukas Slebodnik
no flags Details

Description Lukas Slebodnik 2014-05-07 15:51:59 UTC
Created attachment 893350 [details]
The problematic spec file with commented out lines

Description of problem:
I tried to disable support for journald in sssd. I decided to comment out appropriate lines in sssd.spec file.

diff --git a/contrib/sssd.spec b/contrib/sssd.spec
index d4ee916..b3739c8 100644
--- a/contrib/sssd.spec
+++ b/contrib/sssd.spec
@@ -24,7 +24,7 @@
 
 %if (0%{?use_systemd} == 1)
     %global with_initscript --with-initscript=systemd --with-systemdunitdir=%{_unitdir}
-    %global with_syslog --with-syslog=journald
+#    %global with_syslog --with-syslog=journald
 %else
     %global with_initscript --with-initscript=sysv
 %endif
@@ -597,7 +597,7 @@ rm -rf $RPM_BUILD_ROOT
 %ghost %attr(0600,root,root) %config(noreplace) %{_sysconfdir}/sssd/sssd.conf
 %if (0%{?use_systemd} == 1)
 %attr(755,root,root) %dir %{_sysconfdir}/systemd/system/sssd.service.d
-%config(noreplace) %{_sysconfdir}/systemd/system/sssd.service.d/journal.conf
+#%config(noreplace) %{_sysconfdir}/systemd/system/sssd.service.d/journal.conf
 %endif
 %config(noreplace) %{_sysconfdir}/logrotate.d/sssd
 %config(noreplace) %{_sysconfdir}/rwtab.d/sssd

The first commented out line should cause that configure script should not be executed with argument '--with-syslog=journald'. The second commented line just removes
config file from package.

The problem is that global variable(macro?) was not ignored and configure script was executed with argument '--with-syslog=journald'. I would expect different behaviour.

The second change works, because there is packaging error after build.
RPM build errors:
error: Installed (but unpackaged) file(s) found:
   /etc/systemd/system/sssd.service.d/journal.conf

Version-Release number of selected component (if applicable):
rpm-4.11.2-2.fc20.x86_64
perl-srpm-macros-1-10.fc20.noarch
rpm-libs-4.11.2-2.fc20.x86_64
redhat-rpm-config-9.1.0-54.fc20.noarc
rpm-build-libs-4.11.2-2.fc20.x86_64
rpm-build-4.11.2-2.fc20.x86_64

How reproducible:
deterministic

Steps to Reproduce:
1. Download source rpm
wget http://lslebodn.fedorapeople.org/rpmbuild/sssd-1.11.90-0.fc20.src.rpm
2. try to build rpm (I use mock for rebuilding src.rpms)
mock --root fedora-20-x86_64 --resultdir . --rebuild sssd-1.11.90-0.fc20.src.rpm  

Actual results:
./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-test-dir=/dev/shm --with-db-path=/var/lib/sss/db --with-mcache-path=/var/lib/sss/mc --with-pipe-path=/var/lib/sss/pipes --with-pubconf-path=/var/lib/sss/pubconf --with-init-dir=/etc/rc.d/init.d --with-krb5-rcache-dir=/var/cache/krb5rcache --enable-nsslibdir=/lib64 --enable-pammoddir=/lib64/security --disable-static --disable-rpath --with-initscript=systemd --with-systemdunitdir=/usr/lib/systemd/system --with-syslog=journald --enable-all-experimental-features


Expected results:
# configure is excuted without argument --with-syslog=journald

./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-test-dir=/dev/shm --with-db-path=/var/lib/sss/db --with-mcache-path=/var/lib/sss/mc --with-pipe-path=/var/lib/sss/pipes --with-pubconf-path=/var/lib/sss/pubconf --with-init-dir=/etc/rc.d/init.d --with-krb5-rcache-dir=/var/cache/krb5rcache --enable-nsslibdir=/lib64 --enable-pammoddir=/lib64/security --disable-static --disable-rpath --with-initscript=systemd --with-systemdunitdir=/usr/lib/systemd/system --enable-all-experimental-features

Additional info:
If I remove problematic lines it works as expected.
I am attaching only sssd.spec. If it is problem I can attach sssd-1.11.90-0.fc20.src.rpm, but it is quite big 2.2MiB

Comment 1 Lukas Slebodnik 2014-05-07 15:55:23 UTC
Created attachment 893359 [details]
output from build

It is possible to see from build.log that configure script was executed with argument "--with-syslog=journald".

The end of build.log contains error with unpackaged file.

Comment 2 Panu Matilainen 2014-05-08 08:20:09 UTC
Macros are expanded everywhere, including in what looks like a comment (but is not in all contexts). This is expected behavior and not a bug.

Expansion can be escaped with a double %%, or within specs another common "workaround" to just replace the % with # for temporary commenting purposes.

Comment 3 Lukas Slebodnik 2014-05-08 08:34:19 UTC
Is this behaviour documented anywhere?
I could not find anything in manual pages.

Comment 4 Lukas Slebodnik 2015-01-19 09:33:41 UTC
I'm sorry you didn't reply to question from Comment 3

Setting needinfo flag.

Comment 5 Panu Matilainen 2015-01-19 09:46:10 UTC
Oops, intention was to just move the needinfo elsewhere, I no longer work on rpm.

Comment 6 Lukas Slebodnik 2015-01-19 12:23:30 UTC
(In reply to Panu Matilainen from comment #2)
> Macros are expanded everywhere, including in what looks like a comment (but
> is not in all contexts). This is expected behavior and not a bug.
> 
> Expansion can be escaped with a double %%, or within specs another common
> "workaround" to just replace the % with # for temporary commenting purposes.
Is this behaviour documented anywhere?
I could not find anything in manual pages.

Comment 7 Florian Festi 2019-11-21 09:47:57 UTC
Clear needinfo


Note You need to log in before you can comment on or make changes to this bug.