Bug 498955

Summary: Unnecessary dependencies installed on RHEL5
Product: [Fedora] Fedora EPEL Reporter: Andrew Colin Kissa <andrew>
Component: ejabberdAssignee: Peter Lemenkov <lemenkov>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: el5CC: gemi, lemenkov, mmahut, silfreed
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-04 18:23:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew Colin Kissa 2009-05-04 15:24:13 UTC
Description of problem:
The "Requires(pre): fedora-usermgmt" dependency is not necessary in EPEL packages as it causes the following unnecessary dependencies (fedora-usermgmt-default-fedora-setup,fedora-usermgmt,fedora-usermgmt-shadow-utils,fedora-usermgmt-core) to be installed and yet they are only used in the %pre part and are not essential for the package to function after installation.

Using /usr/sbin/useradd and /usr/sbin/groupadd for the EPEL spec allows these dependencies to be removed.



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. yum install ejabberd
  
Actual results:
====================================================================================================================================================
 Package                                                Arch                     Version                               Repository              Size
====================================================================================================================================================
Installing:
 ejabberd                                               i386                     2.0.3-1.el5                           epel                   758 k
Installing for dependencies:
 erlang                                                 i386                     R12B-3.3.el5                          epel                    38 M
 fedora-usermgmt                                        noarch                   0.8.91-1.el5                          epel                   6.6 k
 fedora-usermgmt-core                                   noarch                   0.8.91-1.el5                          epel                   7.6 k
 fedora-usermgmt-default-fedora-setup                   noarch                   0.8.91-1.el5                          epel                   6.6 k
 fedora-usermgmt-shadow-utils                           noarch                   0.8.91-1.el5                          epel                   7.4 k
 tk                                                     i386                     8.4.13-5.el5_1.1                      base                   888 k
 unixODBC                                               i386                     2.2.11-7.1                            base                   832 k

Transaction Summary


Expected results:
====================================================================================================================================================
 Package                                                Arch                     Version                               Repository              Size
====================================================================================================================================================
Installing:
 ejabberd                                               i386                     2.0.3-1.el5                           epel                   758 k
Installing for dependencies:
 erlang                                                 i386                     R12B-3.3.el5                          epel                    38 M
 tk                                                     i386                     8.4.13-5.el5_1.1                      base                   888 k
 unixODBC                                               i386                     2.2.11-7.1                            base                   832 k

Transaction Summary


Additional info:

Comment 1 Rex Dieter 2009-05-04 15:32:40 UTC
As I understand it, I doubt this is fixable to your satisfaction, as rpm doesn't really distiguish between deps required for scriptlets vs runtime.  It only affects install ordering.

Comment 2 Andrew Colin Kissa 2009-05-04 15:42:20 UTC
Actually it is fixable, please look at my attached patch to the spec file to achieve it.

49c49,50
< Requires(pre): fedora-usermgmt
---
> Requires(pre): /usr/sbin/useradd
> Requires(pre): /usr/sbin/groupadd
73,74c74,75
< /usr/sbin/fedora-groupadd 27 -r ejabberd &>/dev/null || :
< /usr/sbin/fedora-useradd  27 -r -s /sbin/nologin -d /var/lib/ejabberd -M \
---
> /usr/sbin/groupadd 27 -r ejabberd &>/dev/null || :
> /usr/sbin/useradd  27 -r -s /sbin/nologin -d /var/lib/ejabberd -M \
[andrew@bison ~]$ diff -ruN redhat/SPECS/ejabberd.spec ejabberd.spec
--- redhat/SPECS/ejabberd.spec  2009-01-26 18:53:25.000000000 +0200
+++ ejabberd.spec       2009-05-04 17:35:41.000000000 +0200
@@ -46,7 +46,8 @@
 Requires:       erlang
 Requires:       usermode

-Requires(pre): fedora-usermgmt
+Requires(pre): /usr/sbin/useradd
+Requires(pre): /usr/sbin/groupadd
 Requires(post): /sbin/chkconfig
 Requires(post): /usr/bin/openssl
 Requires(preun): /sbin/chkconfig
@@ -70,8 +71,8 @@
 Documentation for ejabberd.

 %pre
-/usr/sbin/fedora-groupadd 27 -r ejabberd &>/dev/null || :
-/usr/sbin/fedora-useradd  27 -r -s /sbin/nologin -d /var/lib/ejabberd -M \
+/usr/sbin/groupadd 27 -r ejabberd &>/dev/null || :
+/usr/sbin/useradd  27 -r -s /sbin/nologin -d /var/lib/ejabberd -M \
                              -c 'ejabberd' -g ejabberd ejabberd &>/dev/null || :

 %post

Comment 3 Rex Dieter 2009-05-04 15:49:27 UTC
Oh sure, by simply making the pkg not use it, but that's up to the maintainer whether they're willing to do without the extra functionality that fedora-usermgmt provides.

I was going on the assumption that the maintainer made a conscious choice to use fedora-usermgmt.

Comment 4 Rex Dieter 2009-05-04 15:49:52 UTC
re-opening, maintainer's call to make.

Comment 5 Andrew Colin Kissa 2009-05-04 15:56:42 UTC
My point is fedora-usermgmt is only being pulled in to perform 2 functions add a group and a user for ejabberd to run as. As a EPEL user i do not see the pointing having 4 packages on the system that are of no use.

Comment 6 Peter Lemenkov 2009-05-04 16:02:13 UTC
I'll fix it ASAP.

Comment 7 Peter Lemenkov 2009-05-04 18:23:07 UTC
Ok, we discussed this issue. Unfortunately, we decided not to replace fedora-usermgmt utilities with their useradd/groupadd alternatives. 

The rationale behind this decision is that fedora-usermgmt doesn't add large dependency chains (several kilobytes), although it provides some functionality over plain useradd/groupadd (predictable uid/gid):

http://fedoraproject.org/wiki/PackageUserCreation


As a workaround, I advise you to type

$ sudo yum remove fedora-usermgmt*

after installation of ejabberd - they required only for installation.