From f244067aab474f256c7552bab2e1bb486a250399 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 30 Apr 2010 13:39:49 -0700 Subject: [PATCH] ceph.spec.in: from Josef --- ceph-init-fix.patch | 62 +++++++++++++++ ceph.spec.in | 188 ++++++++++++++++++++++++++++++++------------ 2 files changed, 200 insertions(+), 50 deletions(-) create mode 100644 ceph-init-fix.patch diff --git a/ceph-init-fix.patch b/ceph-init-fix.patch new file mode 100644 index 0000000000000..2f8859104ae60 --- /dev/null +++ b/ceph-init-fix.patch @@ -0,0 +1,62 @@ +diff -up ceph-0.19.1/src/init-ceph.in.orig ceph-0.19.1/src/init-ceph.in +--- ceph-0.19.1/src/init-ceph.in.orig 2010-02-28 23:46:29.000000000 -0500 ++++ ceph-0.19.1/src/init-ceph.in 2010-04-20 10:25:37.793135436 -0400 +@@ -1,10 +1,11 @@ + #!/bin/sh + # Start/stop ceph daemons ++# chkconfig: - 60 80 + + ### BEGIN INIT INFO + # Provides: ceph +-# Default-Start: 2 3 4 5 +-# Default-Stop: 0 1 6 ++# Default-Start: ++# Default-Stop: + # Required-Start: $remote_fs $named $network $time + # Required-Stop: $remote_fs $named $network $time + # Short-Description: Start Ceph distributed file system daemons at boot time +@@ -28,6 +29,8 @@ else + fi + fi + ++lockfile=/var/lock/subsys/ceph ++ + usage_exit() { + echo "usage: $0 [options] {start|stop|restart} [mon|osd|mds]..." + printf "\t-c ceph.conf\n" +@@ -240,6 +243,7 @@ for name in $what; do + [ -n "$pre_start" ] && do_cmd "$pre_start" + do_cmd "$cmd" $runarg + [ -n "$post_start" ] && do_cmd "$post_start" ++ [ "$?" = 0 ] && touch $lockfile + fi + ;; + +@@ -249,19 +253,27 @@ for name in $what; do + [ -n "$pre_stop" ] && do_cmd "$pre_stop" + stop_daemon $name c$type $pid_file + [ -n "$post_stop" ] && do_cmd "$post_stop" ++ [ "$?" = 0 ] && rm -f $lockfile + ;; + ++ status) ++ pid=`cat $pid_file` ++ ps $pid &> /dev/null ++ exit $? ++ ;; + forcestop) + get_conf pre_forcestop "" "pre forcestop command" + get_conf post_forcestop "" "post forcestop command" + [ -n "$pre_forcestop" ] && do_cmd "$pre_forcestop" + stop_daemon $name c$type $pid_file -9 + [ -n "$post_forcestop" ] && do_cmd "$post_forcestop" ++ [ "$?" = 0 ] && rm -f $lockfile + ;; + + killall) + echo "killall c$type on $host" + do_cmd "pkill ^c$type || true" ++ [ "$?" = 0 ] && rm -f $lockfile + ;; + + force-reload | reload) diff --git a/ceph.spec.in b/ceph.spec.in index b73a1f2ccba27..7082e6262b30f 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -1,83 +1,171 @@ -%define pkg_version @VERSION@ -# Build against the running kernel - this can be changed to whatever kernel version you want to build against. -%define kernel %(uname -r) -# Get the kernel version that is running, but chop off the architecture part (e.g. 2.6.25.10-86.fc9.x86_64 goes to 2.6.25.10-86.fc9) -%define mybuildroot %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -%define optflags "-O2" - Name: ceph -Version: %{pkg_version} -Release: 1%{?dist} -Packager: Brock Erwin -Summary: ceph mon, mds, osd, fuse-client, and kernel-client -License: LGPL -Group: Utilities/System +Version: @VERSION@ +Release: 4%{?dist} +Summary: User space components of the CEPH file system +License: LGPLv2 +Group: System Environment/Base URL: http://ceph.newdream.net/ -Source: %{name}-%{pkg_version}.tar.gz -BuildRequires: fuse-devel, gcc-c++, libtool, libtool-ltdl-devel, boost-devel, libedit-devel, fuse-devel, git, perl, perl-devel, gdbm -BuildRoot: %{mybuildroot} + +Source: http://ceph.newdream.net/download/%{name}-%{version}.tar.gz +Patch0: ceph-init-fix.patch +BuildRequires: fuse-devel, libtool, libtool-ltdl-devel, boost-devel, +BuildRequires: libedit-devel, fuse-devel, git, perl, perl-devel, gdbm, +BuildRequires: openssl-devel, java-devel +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Requires(post): chkconfig +Requires(preun): chkconfig +Requires(preun): initscripts %description -Ceph is a distributed network file system designed to provide excellent +CEPH is a distributed network file system designed to provide excellent performance, reliability, and scalability. -%package fuse -Summary: ceph fuse-based client -Group: Utilities/System -Requires: libstdc++, glibc-devel, glibc, libgcc, fuse-devel -%description fuse-client -fuse-based client +%package fuse +Summary: CEPH fuse-based client +Group: System Environment/Base +Requires: %{name} = %{version}-%{release} +BuildRequires: fuse-devel +%description fuse +FUSE based client for CEPH distributed network file system + +%package devel +Summary: CEPH headers +Group: Development/Libraries +License: LGPLv2 +Requires: %{name} = %{version}-%{release} +%description devel +This package contains the headers needed to develop programs that use CEPH. %prep -%setup -q -n %{name}-%{pkg_version} +%setup -q +%patch0 -p1 +chmod 0644 src/common/Mutex.h %build ./autogen.sh -%{configure} -make %{_smp_mflags} +for i in -I/usr/lib/jvm/java/include{,/linux}; do + java_inc="$java_inc $i" +done +%configure CPPFLAGS="$java_inc" +make CFLAGS="$RPM_OPT_FLAGS" %install -%{makeinstall} - -mkdir -p $RPM_BUILD_ROOT/usr/share/ceph -mkdir -p $RPM_BUILD_ROOT/etc/ceph -mkdir -l $RPM_BUILD_ROOT%{_libdir}/ceph -install README $RPM_BUILD_ROOT/usr/share/ceph +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +find $RPM_BUILD_ROOT -type f -name "*.la" -exec rm -f {} ';' +find $RPM_BUILD_ROOT -type f -name "*.a" -exec rm -f {} ';' +install -D src/init-ceph $RPM_BUILD_ROOT%{_initddir}/ceph +chmod 0644 $RPM_BUILD_ROOT%{_sysconfdir}/ceph/sample.ceph.conf %clean rm -rf $RPM_BUILD_ROOT +%post +/sbin/ldconfig +/sbin/chkconfig --add ceph + +%preun +if [ $1 = 0 ] ; then + /sbin/service ceph stop >/dev/null 2>&1 + /sbin/chkconfig --del ceph +fi + +%postun +/sbin/ldconfig +if [ "$1" -ge "1" ] ; then + /sbin/service ceph condrestart >/dev/null 2>&1 || : +fi + %files -/usr/share/ceph/README +%defattr(-,root,root,-) +%doc README COPYING %{_bindir}/ceph %{_bindir}/cconf %{_bindir}/crushtool %{_bindir}/monmaptool %{_bindir}/osdmaptool +%{_bindir}/cauthtool %{_bindir}/csyn %{_bindir}/crun %{_bindir}/cmon %{_bindir}/cmds %{_bindir}/cosd %{_bindir}/mkmonfs -%{_sbindir}/mount.ceph +%{_bindir}/dumpjournal +%{_bindir}/dupstore +%{_bindir}/rados +%{_bindir}/radosacl +%{_bindir}/streamtest +%{_bindir}/test_ioctls +%{_bindir}/test_trans +%{_bindir}/testceph +%{_bindir}/testcrypto +%{_bindir}/testkeys +%{_bindir}/testmsgr +%{_bindir}/testrados +%{_bindir}/testradospp +%{_initddir}/ceph +%{_libdir}/libceph.so.* +%{_libdir}/libcrush.so.* +%{_libdir}/librados.so.* +%{_libdir}/libhadoopcephfs.so.* %{_sbindir}/mkcephfs -%{_libdir}/ceph/ceph_common.sh -/etc/ceph/sample.ceph.conf -%{_mandir}/man8/cmon.8 -%{_mandir}/man8/cmds.8 -%{_mandir}/man8/cosd.8 -%{_mandir}/man8/mkcephfs.8 -%{_mandir}/man8/mkmonfs.8 -%{_mandir}/man8/crun.8 -%{_mandir}/man8/csyn.8 -%{_mandir}/man8/crushtool.8 -%{_mandir}/man8/osdmaptool.8 -%{_mandir}/man8/monmaptool.8 -%{_mandir}/man8/cconf.8 -%{_mandir}/man8/ceph.8 -%{_mandir}/man8/mount.ceph.8 +/sbin/mount.ceph +%{_libdir}/ceph +%config(noreplace) %{_sysconfdir}/ceph/sample.ceph.conf +%{_mandir}/man8/cmon.8* +%{_mandir}/man8/cmds.8* +%{_mandir}/man8/cosd.8* +%{_mandir}/man8/mkcephfs.8* +%{_mandir}/man8/mkmonfs.8* +%{_mandir}/man8/crun.8* +%{_mandir}/man8/csyn.8* +%{_mandir}/man8/crushtool.8* +%{_mandir}/man8/osdmaptool.8* +%{_mandir}/man8/monmaptool.8* +%{_mandir}/man8/cconf.8* +%{_mandir}/man8/ceph.8* +%{_mandir}/man8/mount.ceph.8* +%{_mandir}/man8/radosgw.8* +%{_mandir}/man8/radosgw_admin.8* +%{_mandir}/man8/rados.8* +%{_mandir}/man8/cauthtool.8* %files fuse +%defattr(-,root,root,-) +%doc COPYING %{_bindir}/cfuse -%{_mandir}/man8/cfuse.8 +%{_mandir}/man8/cfuse.8* + +%files devel +%defattr(-,root,root,-) +%doc COPYING +%{_includedir}/ceph/libceph.h +%{_includedir}/crush/crush.h +%{_includedir}/crush/hash.h +%{_includedir}/crush/mapper.h +%{_includedir}/crush/types.h +%{_includedir}/rados/librados.h +%{_libdir}/libceph.so +%{_libdir}/libcrush.so +%{_libdir}/librados.so +%{_libdir}/libhadoopcephfs.so + +%changelog +* Thu Apr 30 2010 Josef Bacik 0.19.1-4 +- Add java-devel and java tricks to get hadoop to build + +* Mon Apr 26 2010 Josef Bacik 0.19.1-3 +- Move the rados and cauthtool man pages into the base package + +* Sun Apr 25 2010 Jonathan Dieter 0.19.1-2 +- Add missing libhadoopcephfs.so* to file list +- Add COPYING to all subpackages +- Fix ownership of /usr/lib[64]/ceph +- Enhance description of fuse client + +* Tue Apr 20 2010 Josef Bacik 0.19.1-1 +- Update to 0.19.1 + +* Mon Feb 8 2010 Josef Bacik 0.18-1 +- Initial spec file creation, based on the template provided in the ceph src -- 2.39.5