bernd / fpm-cookery

A tool for building software packages with fpm.
Other
460 stars 88 forks source link

rpm-auto-add-directories breaks additions to shared system directories #77

Closed ryansch closed 10 years ago

ryansch commented 10 years ago

67 broke the haproxy package and I'm assuming any other package that installs things to system directories. The resulting package won't install with a conflict on /etc/init.d and /etc/logrotate.d as those are being marked as belonging to the rpm.

ryansch commented 10 years ago

I've tested this by editing the gem in place. If I set @fpm.attributes[:rpm_auto_add_directories?] = false I get a working rpm.

I would just like more control over this feature.

bernd commented 10 years ago

Thanks for the report! I reverted the commit from #67 for now and will think about a solution to provide more control over those kinds of flags. (see #75)

haf commented 10 years ago

This breaks all and any rpm generation if you have something that auto-starts... You ought to make a release with the reverted commit...

bernd commented 10 years ago

@haf I just released 0.21.0 to rubygems.

unakatsuo commented 10 years ago

I think that the haproxy recipe is missing some dependencies for those directories under /etc.

filesystem.rpm provides just following dirs in /etc.

/etc
/etc/X11
/etc/X11/applnk
/etc/X11/fontpath.d
/etc/opt
/etc/pki
/etc/pm
/etc/pm/config.d
/etc/pm/power.d
/etc/pm/sleep.d
/etc/skel
/etc/sysconfig
/etc/xdg
/etc/xdg/autostart
/etc/xinetd.d

/etc/init.d and /etc/logrotate.d are provided by separate packages and they should be defined in the depends section.

% rpm -qf /etc/logrotate.d
logrotate-3.7.8-16.el6.x86_64
% rpm -qf /etc/init.d
chkconfig-1.3.49.3-2.el6_4.1.x86_64
ryansch commented 10 years ago

I don't have a hard dependency on those directories, in fact I have a dependency on haproxy related deps in those directories. I created the fpm recipe to have the exact same output as the official redhat/centos/amazon rpm.

Edit: I think I understand what you mean. I need to add dependencies on logrotate and chkconfig.

unakatsuo commented 10 years ago

right. the official haproxy package has extra dependencies for post-inst and pre-inst scripts.

.spec from haproxy-1.4.24-2.el6.src.rpm contains the Require section as per:

Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: pcre-devel
Requires: pcre
Requires: setup >= 2.8.14-14

yum deplist haproxy shows more readable format with package names.

So that the proper dependency list for haproxy recipe will be:

  depends 'openssl', 'pcre', 'zlib', 'logrotate', 'chkconfig', 'initscripts', 'shadow-utils', 'setup'
  build_depends 'openssl-devel', 'pcre-devel', 'zlib-devel'
haf commented 10 years ago

Idea for feature: on a centos system (or other distro), point fpm-cookery to a package, use a forward-only generator to quickly get an equivalent recipe. Then fill out the blanks yourself, such as download uri, version and any changes new versions introduced.

ryansch commented 10 years ago

@haf That sounds great. I've got a working ImageMagick spec file I haven't had the stomach to convert to fpm yet.

https://gist.github.com/ryansch/11007517

Sounds like a great use case!

ryansch commented 10 years ago

This was closed by 684ee62c62577d7ac665df382f677b6bf989c7cb