Bug 1074318 - SPEC file mangles sources duing build; resulting in bad SRC RPM when doing "rpmbuild -bs"
Summary: SPEC file mangles sources duing build; resulting in bad SRC RPM when doing "r...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: zabbix20
Version: el6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Volker Fröhlich
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-09 18:10 UTC by Rolf Fokkens
Modified: 2014-05-01 22:20 UTC (History)
2 users (show)

Fixed In Version: zabbix-2.0.11-3.fc20
Clone Of:
Environment:
Last Closed: 2014-05-01 22:20:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Fixes the issue (1.18 KB, patch)
2014-03-09 18:10 UTC, Rolf Fokkens
no flags Details | Diff

Description Rolf Fokkens 2014-03-09 18:10:01 UTC
Created attachment 872452 [details]
Fixes the issue

Description of problem:
After building the SRC.RPM on EL6 an copying it to Fedora it results in a bad package when building on Fedora. Solution in Additional info

Version-Release number of selected component (if applicable):
zabbix20-2.0.11-1.el6.src.rpm

How reproducible:
100%

Steps to Reproduce:
1. Do rpm -bb on EL6
2. Do rpm -bs on EL6
3. Copy SRC.RPM to Fedora
4. Do rpm -i of SRC.RPM on Fedora
5. Do rpm -bb on Fedora
6. Install new RPM on Fedora
7. Enjoy an email Anacron job 'cron.daily' on <host>. Details below

Actual results:
Anacron email:

/etc/cron.daily/logrotate:

error: skipping "/var/log/zabbix/zabbix_agentd.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

Expected results:
Happy logrotate on Fedora

Additional info:
The issue is caused by the fact that the SPEC file is altering SOURCE5 during build. This can easily be prevented, see attached patch.

Comment 1 Volker Fröhlich 2014-04-22 19:51:32 UTC
I spent a lot of time and neither can I see what's causing the error message nor how your patch would change the resulting logrotate configuration file. Please test the new Fedora version and if the problem still exists, please paste your /etc/logrotate.d/zabbix-* files.

However, Fedora's 2.0.11-2 removed the su statement inadvertently.

Comment 2 Fedora Update System 2014-04-22 19:54:19 UTC
zabbix-2.0.11-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/zabbix-2.0.11-3.fc20

Comment 3 Fedora Update System 2014-04-22 19:54:47 UTC
zabbix-2.0.11-3.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/zabbix-2.0.11-3.fc19

Comment 4 Fedora Update System 2014-04-24 07:41:01 UTC
Package zabbix-2.0.11-3.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing zabbix-2.0.11-3.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-5540/zabbix-2.0.11-3.fc20
then log in and leave karma (feedback).

Comment 5 Rolf Fokkens 2014-04-24 07:58:59 UTC
Regarding the "su" directive:

* Fedora (>= 19) needs it
* CentOS doesn't understand it.

So entirely removing doesn't seem right. Hence my suggestion to use a spec file that takes Fedora/CentOS differences into account, but without changing any source files.

I haven't tested it yet, will do so later.

Some more info:

https://bugzilla.redhat.com/show_bug.cgi?id=753983
http://www.novell.com/support/kb/doc.php?id=7005219
http://rickfoosusa.blogspot.nl/2011/12/howto-fix-logrotate-complains-about.html

Comment 6 Volker Fröhlich 2014-04-24 09:36:06 UTC
Keep in mind that zabbix20 is not intended to be rebuilt on Fedora. I'm not sure what you mean by "changing source files". It's a Fedora/EPEL-specific source anyway and it doesn't really matter whether I change it in-place or not, if the result is the same.

Maintaining Zabbix accross EPEL 5, 6 and various Fedora versions in different versions is a real challenge (zabbix, zabbix20, zabbix22 and the fact that the name won't change in Fedora but the major version will). I tried a unified approach, but it tends to be almost as troublesome to maintain.

Comment 7 Rolf Fokkens 2014-04-24 12:03:21 UTC
The text in the spec file (from zabbix20-2.0.11-1.el6.src.rpm):

  # Logrotate's su option is currently only available in Fedora
  %if 0%{?rhel}
  sed -i '/su zabbix zabbix/d' %{SOURCE5}
  %endif

This suggested to me that Fedora is actually was considered a build Target. 

By changing the source I mean specifically this line:

  sed -i '/su zabbix zabbix/d' %{SOURCE5}

This changes the file rpmbuild/SOURCES/zabbix-logrotate.in. That's what 'sed -i' does. The source file is changed, and after you do 'rpm -bs' you have a different src.rpm.

Comment 8 Volker Fröhlich 2014-04-26 17:15:57 UTC
Now I finally see what you mean, thanks for noticing.

Comment 9 Fedora Update System 2014-05-01 22:20:19 UTC
zabbix-2.0.11-3.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2014-05-01 22:20:51 UTC
zabbix-2.0.11-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


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