diff --git a/glusterfs.spec b/glusterfs.spec index d8f0920..d93ddac 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -21,12 +21,15 @@ # rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without georeplication %{?_without_georeplication:%global _without_georeplication --disable-geo-replication} +%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 6 ) %global SWIFTVER 1.4.8 +%global _with_swift true +%endif Summary: Cluster File System Name: glusterfs Version: 3.3.0 -Release: 4%{?dist} +Release: 5%{?dist} License: GPLv3+ and (GPLv2 or LGPLv3+) Group: System Environment/Base Vendor: Red Hat @@ -197,9 +200,11 @@ is in user space and easily manageable. This package provides the development libraries. +%if 0%{?_with_swift:1} %package swift Summary: GlusterFS OpenStack Object Storage +Group: Applications/System License: ASL 2.0 BuildArch: noarch @@ -347,10 +352,11 @@ technology. This provides a system for data storage that enables users to access the same data as an object and as a file, simplifying management and controlling storage costs. - +%endif %prep %setup -q -n %{name}-%{version} +%if 0%{?_with_swift:1} %setup -q -T -D -n %{name}-%{version} -a 10 %setup -q -T -D -n %{name}-%{version} -a 20 %patch0 -p0 @@ -362,6 +368,7 @@ cd swift-%{SWIFTVER} %patch5 -p1 %patch6 -p1 dos2unix LICENSE +%endif %build ./autogen.sh @@ -373,6 +380,7 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool %{__make} %{?_smp_mflags} +%if 0%{?_with_swift:1} cd swift-%{SWIFTVER} %{__python} setup.py build %{__mkdir_p} doc/build @@ -380,6 +388,7 @@ cd swift-%{SWIFTVER} %{__python} setup.py build_sphinx %endif cd .. +%endif %install %{__rm} -rf %{buildroot} @@ -478,6 +487,7 @@ touch %{buildroot}%{_sharedstatedir}/glusterd/glusterd.info %{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/nfs %{__mkdir_p} %{buildroot}%{_sharedstatedir}/glusterd/peers +%if 0%{?_with_swift:1} cd swift-%{SWIFTVER} %{__python} setup.py install -O1 --skip-build --root %{buildroot} # Init helper functions @@ -514,6 +524,7 @@ cd plugins %{__install} -p -D -m 755 utils.py %{buildroot}%{python_sitelib}/swift/plugins cp -r conf/* %{buildroot}%{_sysconfdir}/swift cd .. +%endif %clean @@ -635,6 +646,7 @@ cd .. %exclude %{_includedir}/glusterfs/y.tab.h %{_libdir}/*.so +%if 0%{?_with_swift:1} %files swift %defattr(-,root,root,-) %doc swift-%{SWIFTVER}/AUTHORS @@ -723,6 +735,7 @@ cd .. %defattr(-,root,root,-) %{python_sitelib}/swift/plugins %{_sysconfdir}/swift +%endif %post server @@ -769,6 +782,21 @@ else glusterd --xlator-option *.upgrade=on -N fi + +%preun server +if [ $1 -eq 0 ]; then + %_init_stop glusterfsd + %_init_stop glusterd + %_init_disable glusterfsd + %_init_disable glusterd +fi +if [ $1 -ge 1 ]; then + %_init_restart glusterd + %_init_restart glusterfsd +fi + + +%if 0%{?_with_swift:1} %pre swift getent group swift >/dev/null || groupadd -r swift -g 160 getent passwd swift >/dev/null || \ @@ -831,22 +859,13 @@ fi if [ "$1" -ge "1" ] ; then /sbin/service gluster-swift-proxy condrestart >/dev/null 2>&1 || : fi - - -%preun server -if [ $1 -eq 0 ]; then - %_init_stop glusterfsd - %_init_stop glusterd - %_init_disable glusterfsd - %_init_disable glusterd -fi -if [ $1 -ge 1 ]; then - %_init_restart glusterd - %_init_restart glusterfsd -fi +%endif %changelog +* Wed Aug 12 2012 Kaleb S. KEITHLEY - 3.3.0-5 +- now with UFO (openstack-swift) except on el5 + * Fri Aug 10 2012 Kaleb S. KEITHLEY - 3.3.0-4 - now with UFO (openstack-swift)