]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph.spec.in: User and group must be created in ceph-common pre-install script
authorBoris Ranto <branto@redhat.com>
Thu, 18 Jun 2015 11:42:04 +0000 (13:42 +0200)
committerSage Weil <sage@redhat.com>
Thu, 27 Aug 2015 00:34:15 +0000 (20:34 -0400)
The package ceph-common uses ceph user and group but they are both created in
ceph package %pre phase. We need to move the script to ceph-common %pre phase.

Signed-off-by: Boris Ranto <branto@redhat.com>
ceph.spec.in

index 937da890c68ee097f07ef887a84ddf3b457f65ec..d00b9104938875265dc01566299267f22bf58cb5 100644 (file)
@@ -649,21 +649,11 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/ceph/bootstrap-mds
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/ceph/bootstrap-rgw
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/radosgw
 
-%pre
-CEPH_GROUP_ID=""
-CEPH_USER_ID=""
-# disabled for now until we have the numbers
-%if 0%{?rhel} || 0%{?centos} || 0%{?fedora}
-CEPH_GROUP_ID="-g 167"
-CEPH_USER_ID="-u 167"
+%if %{defined suse_version}
+# Fedora seems to have some problems with this macro, use it only on SUSE
+%fdupes -s $RPM_BUILD_ROOT/%{python_sitelib}
+%fdupes %buildroot
 %endif
-# %if 0%{?suse_version}
-# CEPH_GROUP_ID="-g "
-# CEPH_USER_ID="-u "
-# %endif
-
-%{_sbindir}/groupadd ceph $CEPH_GROUP_ID -o -r 2>/dev/null || :
-%{_sbindir}/useradd ceph $CEPH_USER_ID -o -r -g ceph -s /sbin/nologin -c "Ceph daemons" -d %{_localstatedir}/lib/ceph 2> /dev/null || :
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -869,6 +859,22 @@ mkdir -p %{_localstatedir}/run/ceph/
 %{_udevrulesdir}/50-rbd.rules
 %attr(2750,ceph,ceph) %dir %{_localstatedir}/log/ceph/
 
+%pre -n ceph-common
+CEPH_GROUP_ID=""
+CEPH_USER_ID=""
+# disabled for now until we have the numbers
+%if 0%{?rhel} || 0%{?centos} || 0%{?fedora}
+CEPH_GROUP_ID="-g 167"
+CEPH_USER_ID="-u 167"
+%endif
+# %if 0%{?suse_version}
+# CEPH_GROUP_ID="-g "
+# CEPH_USER_ID="-u "
+# %endif
+
+%{_sbindir}/groupadd ceph $CEPH_GROUP_ID -o -r 2>/dev/null || :
+%{_sbindir}/useradd ceph $CEPH_USER_ID -o -r -g ceph -s /sbin/nologin -c "Ceph daemons" -d %{_localstatedir}/lib/ceph 2> /dev/null || :
+
 %postun -n ceph-common
 # Package removal cleanup
 if [ "$1" -eq "0" ] ; then