https://bugzilla.redhat.com/show_bug.cgi?id=1235305
--- Comment #15 from Ingvar Hagelund ingvar@linpro.no --- Updated .src.rpm at http://users.linpro.no/ingvar/varnish/hitch/hitch-1.0.0-0.3.4.beta3.fc22.src... Updated .spec at http://users.linpro.no/ingvar/varnish/hitch/hitch.spec
(In reply to Christopher Meng from comment #14)
I have some advices for the spec:
- %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units BuildRequires: systemd-units %else
You should use 'systemd' instead of 'systemd-units' for these 4 entries.
Fixed
- BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
This line is not needed if you don't plan to push it to el5(I think so).
I considered building for epel5, but there were too many obstacles. Removed.
- LDFLAGS="%{optflags} -pie"
There must be something wrong within your project, I don't think cflags should be inserted here, should be %{__global_ldflags} instead.
Right. Removed %optflags. -pie is for hardening, and it is only added on el6. (el6 does not have any of the macros %__global_ldflags or %_hardened_ldflags.)
- rm -rf %{buildroot}
Drop it unless for el5.
As above. Dropped.
- # check (...)
Maybe 'cd -' is redundant?
Right. Dropped.
- Drop %clean section unless for el5.
As above. Dropped.
- Drop %defattr(-,root,root,-)
Ah, I still do copy-and-paste from spec files I built for el3 and el4. Fixed.
- Consider %ghost %verify(not md5 size mtime) /run/hitch/hitch.pid at
%files.
Ah, nice. I didn't know about %ghost.
- hitch is a network proxy (...)
A missing dot at the end of the final line.
Fixed
- %{_mandir}/man8/hitch.8.gz -> %{_mandir}/man8/hitch.8*
This will help once they are not compressed(RPM will compress these pages).
Fixed
Thanks, Christopher :-)
Ingvar