%define name evms %define version 2.5.1 %define release 6mdk %define with_cli 1 %define with_gui 1 %define with_ncurses 1 %define with_ha 0 %define with_csm 1 %define kernelsrcdir /usr/src/linux %define mdkversion %(perl -pe '/(\\d+)\\.(\\d)\\.?(\\d)?/; $_="$1$2".($3||0)' /etc/mandrake-release) # new macros %define libmajor 0 %if %mdkversion <= 900 %define libname lib%name%libmajor %else %define libname %mklibname %name %libmajor %endif %{?_without_cli: %{expand: %%global with_cli 0}} %{?_without_gui: %{expand: %%global with_gui 0}} %{?_without_ncurses: %{expand: %%global with_ncurses 0}} %{?_without_ha: %{expand: %%global with_ha 0}} %{?_without_csm: %{expand: %%global with_csm 0}} %{?_with_cli: %{expand: %%global with_cli 1}} %{?_with_gui: %{expand: %%global with_gui 1}} %{?_with_ncurses: %{expand: %%global with_ncurses 1}} %{?_with_ha: %{expand: %%global with_ha 1}} %{?_with_csm: %{expand: %%global with_csm 1}} Summary: Enterprise Volume Management System utilities Name: %{name} Version: %{version} Release: %{release} License: GPL Group: System/Configuration/Hardware Source0: http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 Patch2: %{name}-2.3.4.replace_top_objects.patch.bz2 Patch3: evms_query.c.patch Patch4: evms-2.5.1-packed-attr.patch.bz2 Patch5: evms_metadata_restore.c.patch Patch7: discover.c.patch Patch8: snapshot.c.patch Patch9: md.patch URL: http://evms.sourceforge.net/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildRequires: autoconf BuildRequires: glibc-static-devel BuildRequires: libext2fs-devel BuildRequires: libdevmapper-devel %if %{with_ha} BuildRequires: libheartbeat-devel %endif %if %with_gui BuildRequires: glib-devel >= 1.2.0 BuildRequires: gtk+-devel >= 1.2.0 %endif %if %with_ncurses BuildRequires: ncurses-devel %endif %define _sbindir /sbin %define _libdir /%{_lib} Requires: %libname = %version-%release Requires: %name-interface = %version-%release %description This package contains the user-space tools needed to manage EVMS (Enterprise Volume Management System) volumes. In order to use these user-space tools, you must also have your kernel patched with the most recent EVMS code. %package plugin-heartbeat Group: System/Libraries Summary: EVMS plugin adding Heartbeat support Provides: %name = %version-%release %description plugin-heartbeat EVMS plugin adding Heartbeat support %package -n %libname Group: System/Libraries Summary: Libraries for %name Provides: %{libname} = %version-%release %description -n %libname The libraries from %name package %package -n %libname-devel Group: Development/Other Summary: Libraries for %name Requires: %libname = %version-%release Provides: lib%name-devel = %version-%release Provides: %{name}-devel = %{version}-%{release} Obsoletes: %{name}-devel %description -n %libname-devel Development libraries from %name %package -n %libname-static-devel Group: Development/Other Summary: Static libraries for %name Requires: %libname-devel = %version-%release #Provides: lib%name-devel = %version-%release #Provides: %{name}-devel = %{version}-%{release} #Obsoletes: %{name}-devel %description -n %libname-static-devel Static libraries from %name %package ncurses Summary: Ncurses interface for EVMS Group: System/Configuration/Hardware Requires: %{name} = %{version} Requires: usermode-consoleonly Provides: %name-interface = %version-%release %description ncurses Ncurses interface for EVMS. %package gui Summary: GUI interface for EVMS Group: System/Configuration/Hardware Requires: %{name} = %{version} Requires: usermode-consoleonly Provides: %name-interface = %version-%release %description gui GUI interface for EVMS. %package cli Summary: Command line interface for EVMS Group: System/Configuration/Hardware Requires: %{name} = %{version} Provides: %name-interface = %version-%release %description cli Command line interface for EVMS. %prep %setup -q %patch2 -p1 -b .replace_top_objects %patch3 -p1 -b .evms_query %patch4 -p1 -b .packed-attr %patch5 -p1 -b .evms_metadata_restore %patch7 -p1 -b .discover %patch8 -p1 -b .snapshot %patch9 -p1 -b .md %build #{__autoconf} %configure2_5x \ --with-plugins=all \ --with-interfaces=all \ %if !%with_ncurses --disable-text-mode \ %endif %if !%with_gui --disable-gui \ %endif %if !%with_cli --disable-cli \ %endif %if !%{with_ha} --disable-ha \ %endif %if !%{with_csm} --disable-csm \ %endif --with-kernel=%{kernelsrcdir} %make make -C tests evms_deactivate %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT/etc make install \ DESTDIR=$RPM_BUILD_ROOT install doc/evms.conf $RPM_BUILD_ROOT/etc install doc/evms.conf evms.conf.sample install -m 755 tests/evms_deactivate $RPM_BUILD_ROOT%_sbindir rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/evms.conf.sample %if %with_gui mkdir -p $RPM_BUILD_ROOT%{_menudir} cat > $RPM_BUILD_ROOT%{_menudir}/evmsgui <<EOF ?package(evmsgui): \ command="%{_bindir}/evmsgui" \ title="EVMS GUI" \ longtitle="EVMS GUI" \ needs="x11" \ icon="boot_init_section.png" \ section="Configuration/Hardware" \ startup_notify="false" EOF ### consolehelper entry mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps cat > $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/evmsgui <<EOF USER=root PROGRAM=%{_sbindir}/evmsgui SESSION=true FALLBACK=false EOF ### pam entry mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d cat > $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/evmsgui <<EOF auth sufficient pam_rootok.so auth required pam_pwdb.so session optional pam_xauth.so account required pam_permit.so EOF mkdir -p $RPM_BUILD_ROOT%{_bindir}/ ln -sf consolehelper $RPM_BUILD_ROOT%{_bindir}/evmsgui %endif %if %with_ncurses mkdir -p $RPM_BUILD_ROOT%{_menudir} cat > $RPM_BUILD_ROOT%{_menudir}/evmsn <<EOF ?package(evmsn): \ command="%{_bindir}/evmsn" \ title="EVMS textmode" \ longtitle="EVMS textmode" \ needs="text" \ icon="boot_init_section.png" \ section="Configuration/Hardware" \ startup_notify="false" EOF ### consolehelper entry mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps cat > $RPM_BUILD_ROOT%{_sysconfdir}/security/console.apps/evmsn <<EOF USER=root PROGRAM=%{_sbindir}/evmsn SESSION=true FALLBACK=false EOF ### pam entry mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d cat > $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/evmsn <<EOF auth sufficient pam_rootok.so auth required pam_pwdb.so session optional pam_xauth.so account required pam_permit.so EOF mkdir -p $RPM_BUILD_ROOT%{_bindir}/ ln -sf consolehelper $RPM_BUILD_ROOT%{_bindir}/evmsn %endif %find_lang %name %clean rm -rf $RPM_BUILD_ROOT %post -n %{libname} /sbin/ldconfig %postun -n %{libname} /sbin/ldconfig %if %with_gui %post gui %{update_menus} %postun gui %{clean_menus} %endif %if %with_ncurses %post ncurses %{update_menus} %postun ncurses %{clean_menus} %endif %files -f %name.lang %defattr(644,root,root,755) %doc ChangeLog INSTALL* PLUGIN* TERMINOLOGY evms.conf.sample %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/evms.conf %attr(755,root,root) %{_sbindir}/evms* %exclude %{_sbindir}/evms_gather_info %if %with_cli %exclude %{_sbindir}/evms %endif %if %with_ncurses %exclude %{_sbindir}/evmsn %endif %if %with_gui %exclude %{_sbindir}/evmsgui %endif %{_mandir}/man8/* %exclude %{_mandir}/man8/evms.* %exclude %{_mandir}/man8/evms_gather_info.* %if %{with_ha} %files plugin-heartbeat %attr(755,root,root) %{_libdir}/evms/%{version}/ha-* %{_sysconfdir}/ha.d/resource.d/evms_failover %endif %files -n %libname %defattr(644,root,root,755) %dir %{_libdir}/evms/ %dir %{_libdir}/evms/%{version}/ %attr(755,root,root) %{_libdir}/evms/%{version}/* %if %{with_ha} %exclude %{_libdir}/evms/%{version}/ha-* %endif #attr(755,root,root) %{_libdir}/libdlist-*.so.* %attr(755,root,root) %{_libdir}/libevms-*.so.* %files -n %libname-devel %defattr(644,root,root,755) %{_includedir}/evms %attr(755,root,root) %{_libdir}/libevms.so %files -n %libname-static-devel %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/lib*.a %if %with_ncurses %files ncurses %defattr(644,root,root,755) %doc ChangeLog INSTALL* TERMINOLOGY %{_menudir}/evmsn %attr(755,root,root) %{_bindir}/evmsn %attr(755,root,root) %{_sbindir}/evmsn %{_sysconfdir}/pam.d/evmsn %{_sysconfdir}/security/console.apps/evmsn %endif %if %with_gui %files gui %defattr(644,root,root,755) %doc ChangeLog INSTALL* TERMINOLOGY %{_menudir}/evmsgui %attr(755,root,root) %{_bindir}/evmsgui %attr(755,root,root) %{_sbindir}/evmsgui %{_sysconfdir}/pam.d/evmsgui %{_sysconfdir}/security/console.apps/evmsgui %endif %if %with_cli %files cli %defattr(644,root,root,755) %doc ChangeLog INSTALL* TERMINOLOGY %attr(755,root,root) %{_sbindir}/evms %attr(755,root,root) %{_sbindir}/evms_gather_info %{_mandir}/man8/evms.* %{_mandir}/man8/evms_gather_info.* %endif %changelog * Sat Mar 05 2005 Luca Berra <bluca@vodka.it> 2.5.1-6mdk - rebuild for new libdevmapper * Wed Feb 23 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.5.1-5mdk - fix buildrequires - fix pam conf files for lib64 - really pack structs when requested * Tue Feb 15 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.5.1-4mdk - Michel Bouissou <michel@bouissou.net>: - Added new snapshot.c and md patches - Removed all previous md* patches as new md patch includes them - Added new discover.c patch - Added new md_main.c, evms_metadata_restore and md_info.c patches - Added new md_super.c and evms_query.c patches - Added new md_info.h.patch - Added new md_discover.c.patch * Fri Feb 11 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.5.1-3mdk - fix directory ownership (#13548) * Mon Jan 24 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.5.1-2mdk - add evms_deactivate * Mon Jan 24 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.5.1-1mdk - new release * Tue Jul 27 2004 svetljo<svetljo@gmx.de> 2.3.4-4mdk - fix slow descovery of lvm1 regions over soft raid (upstream fix : lvm_compare_targets) * Tue Jul 27 2004 svetljo<svetljo@gmx.de> 2.3.4-3mdk - fix groups - move evms.conf.sample to doc - add doc for evmsgui & evmsn * Tue Jul 27 2004 svetljo<svetljo@gmx.de> 2.3.4-2mdk - fix menu entries * Tue Jul 27 2004 svetljo<svetljo@gmx.de> 2.3.4-1mdk - disable heartbeat plugin (have to figure out dependacies first) - initial contrib