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
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.
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.
I'm sorry you didn't reply to question from Comment 3 Setting needinfo flag.
Oops, intention was to just move the needinfo elsewhere, I no longer work on rpm.
(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.
Clear needinfo