Linux.com

Create rpm

Link to this post 21 May 10

hello!
sorry for my english that's very bad xD
well, i'm create a rpm. The spec file is:

Name: foo
Version: 1.0
Release: 1
Summary: Paquete de programa
Group: Applications/System
License: GPL
URL: http://www.escoladeltreball.org
Source0: file:///tmp/projecte/foo-1.0.tar.gz
#Provides: caca
#Requires: krb5

%description
Paquete que nos ofrece un archivo python el cual nos listara las primeras cinco linias de un archivo el qual lo introducideros como argumento cuando llamemos al programa python. Tambien tendra un binario, ls. Ademas contendra un archivo pdf, texto y el makefile que nos permitira instalar el paquete en el directorio virtual. Descripcion general de la aplicacion(todos los paquetes)

%package server
Summary: Paquete servidor
Group: Applications/System
%description server
Paquete servidor del programa foo


%pre
echo '¬°Vas a instalar el paquete principal del prografa foo!'

%pre server
echo '!Vas a instalar el paquete foo-server¬°'


%prep
rm -rf %{_builddir}/*
%setup -q


#build

%install
rm -rf $RPM_BUILD_ROOT
install -D prova.bin $RPM_BUILD_ROOT%{_bindir}/prova
install -D servei.bin $RPM_BUILD_ROOT%{_sbindir}/servei
#install -D readme.txt $RPM_BUILD_ROOT%{_defaultdocdir}/readme.txt
install -D prova.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/prova.1.gz
install -D prova.conf $RPM_BUILD_ROOT%{_sysconfdir}/prova.conf

%clean
#rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc readme.txt
/usr/bin/prova
/usr/share/man/man1/prova.1.gz

%files server
%defattr(-,root,root,-)
%config /etc/prova.conf
/usr/sbin/servei

%changelog

the binary rpm and the source rpm are well create. The binary rpms are foo-1.0-1.i686.rpm and foo-server-1.0-1.i686.rpm but when i make rpm -ivh foo-1.0-1.i686.rpm or foo-server-1.0-1.i686.rpm as root. the shell say me:

[root@pc45 ~]# rpm -ivh /tmp/makerpm/rpmbuild/RPMS/i686/foo-server-1.0-1.i686.rpm 
Preparando... ########################################### [100%]
!Vas a instalar el paquete foo-server¬°
1:foo-server ########################################### [100%]
error: falló el desempaquetado de archivos en archivo/usr/sbin/servei;4bf653bb: cpio: Digest mismatch

the error in english would be something like:
error: failure in unpacked files in file/usr/bin/servei;4bf653bb: cpio: Digest mismatch

thanks!

Link to this post 21 May 10

I don't remember to say that I read very much about rpms and I have try solve my problem but I don't can solve it.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board