All pastes #937968 Raw Edit

Etwas

public text v1 · immutable
·published 2008-03-11 10:03 UTC
rendered paste body
# norootforbuild

Name:         partimage
Version:      0.6.7
Release:      1.1
License:      GPL
Group:        Productivity/Archiving/Backup
Url:          http://www.partimage.org/
Requires:     newt openssl
Source:       partimage-%version.tar.bz2
BuildRoot:    %_tmppath/%name-%version-build
BuildRequires: libstdc++-devel zlib-devel lzo-devel newt-devel openssl-devel libmcrypt-devel gcc-c++ slang-devel
Summary:      Save and restore partition images

%description
Partition Image is a Linux utility which saves partitions in the
ext2fs, reiserfs, hpfs, jpf, xfs, fat16, and fat32 formats an image
file. Only used blocks are copied to save the space and to increase the
speed. The image file can be compressed, in gzip, or bzip2 formats, and
can be splitted into small files to be copied on floppies (1,44 MB,
ZIP, ...) or CDRs.

Partition Image will only copy data from the used portions of the
partition. For speed and efficiency, free blocks are not written to the
image file. This is unlike the 'dd' command, which also copies empty
blocks.

Then, the partition can be restored if there is a problem on the
partition (file system error,virus, error in data, ...), from the image
file. It can also be used to install many identical PCs with the same
hardware. You just have to install an only PC, and you can copy the
linux partitions to all others.

Be careful, this is an alpha version. Then, there can be bugs, and
changes in the data format between differents versions. Don't backup
important data with it, and use the same version to save and to restore
the same image file. Please, report all bugs to the author.


Authors:
--------
 - Francois Dupoux <fdupoux@partimage.org>
 - Franck Ladurelle <ladurelf@partimage.org>


%package daemon
Group:        Productivity/Archiving/Backup
Summary:      Network daemon for serving partition images created with partimage
PreReq:       coreutils diffutils fillup grep pwdutils sed


%description daemon
A network daemon partimage can connect to to get partition images from
or to save partition images to.

For more information about partimage see description of partimage.


Authors:
--------
 - Francois Dupoux <fdupoux@partimage.org>
 - Franck Ladurelle <ladurelf@partimage.org>


%define partimage_home /var/lib/partimage
%debug_package


%prep
%setup -q


%build
%configure
%__make %{?jobs:-j%jobs}


%install
%makeinstall
%__install -dm 755 %buildroot%partimage_home
%__install -dm 755 %buildroot%_sysconfdir/partimaged
%__install -Dm 755 %_sourcedir/partimaged %buildroot%_sysconfdir/init.d/partimaged
ln -s %_sysconfdir/init.d/partimaged %buildroot%_sbindir/rcpartimaged
touch %buildroot/%_sysconfdir/partimaged/partimagedusers

# fedora noobs
%__mkdir_p %buildroot/%_docdir
%__mv %buildroot/%_datadir/doc/partimage %buildroot/%_docdir
%__mkdir_p %buildroot/%_docdir/partimage-daemon
%__cp -r %buildroot/%_docdir/partimage/* %buildroot/%_docdir/partimage-daemon

%find_lang %name


%clean
test "%buildroot" != "/" && %__rm -rf %buildroot


%pre daemon
/usr/sbin/useradd -r -d "%partimage_home" -s /bin/false -c "PartImage Daemon User" -g root partimag 2>/dev/null || :;


%post daemon
%fillup_and_insserv partimaged
if [[ ! -e %_sysconfdir/partimaged/partimaged.key || ! -e %_sysconfdir/partimaged/partimaged.cert  ]]
then
	openssl req -newkey rsa:4096 -x509 -nodes -sha1 -days 3560 -subj '/C=/ST=/L=/CN=PartImage Daemon' -keyout %_sysconfdir/partimaged/partimaged.key -out %_sysconfdir/partimaged/partimaged.cert;
	%__chown partimag %_sysconfdir/partimaged/partimaged.*
	%__chmod 400 %_sysconfdir/partimaged/partimaged.key
	%__chmod 444 %_sysconfdir/partimaged/partimaged.cert
fi


%preun daemon
%stop_on_removal partimaged


%postun daemon
%restart_on_update partimaged
%insserv_cleanup
if [[ $1 = 0 ]]
then
	%__rm -r %_sysconfdir/partimaged
	userdel partimag
fi


%files -f %name.lang
%defattr(-,root,root)
%_sbindir/partimage
%doc %_docdir/partimage


%files daemon
%defattr(-,root,root)
%_sbindir/*partimaged
#%_sbindir/rcpartimaged
%attr(0755,root,root) %config %_sysconfdir/init.d/partimaged
%attr(600,partimag,root) %config(noreplace) %_sysconfdir/partimaged/partimagedusers
%doc %_docdir/partimage-daemon
%attr(755,partimag,root) %dir %partimage_home

%changelog