umaparvathy
15th August 2010, 05:49 PM
Hi All,
I'm trying to create own rpm. with system V init script .. but i'm getting stuck in %files section...
Please help me out...
Here my spec file
# This is the spec file for daemonsas
%define _topdir /usr/local/up/rpm
%define name daemonsas
%define release 1
%define version 1.2
%define buildroot %{_topdir}/%{name}-%{version}-root
BuildRoot:%{_topdir}
Summary:GNU daemonsas
License:GPL
Name:%{name}
Version:%{version}
Release:%{release}
Source:%{name}-%{version}.tgz
Group:Development tools
%description
Listen the tcp port and prints the received messages from the port to syslog
%prep
%setup -q
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/sbin/daemonsas-1.2
mkdir -p $RPM_BUILD_ROOT/etc/daemonsas-1.2
mkdir -p $RPM_BUILD_ROOT/etc/init.d/daemonsas-1.2
# install -m 755 -d %{buildroot}/usr/sbin/daemonsas-1.2
# install -m 755 -d %{buildroot}/etc/daemonsas-1.2
install -m 755 daemonsas $RPM_BUILD_ROOT/usr/sbin/daemonsas-1.2
install -m 644 daemonsas.conf $RPM_BUILD_ROOT/etc/daemonsas-1.2
install -m 755 daemond $RPM_BUILD_ROOT/etc/init.d/daemonsas-1.2
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%post
# cp daemond /etc/init.d
# chmod +x /etc/init.d/daemond
if [ -x /sbin/chkconfig ]; then
/sbin/chkconfig -add daemond
else
for i in 2 3 5 ; do
ln -sf /etc/init.d/daemond /etc/rc.d/rc${i}.d/S91daemond
done
for i 1 4 6 ; do
ln -sf /etc/init.d/daemond /etc/rc.d/rc${i}.d/K30daemond
done
fi
%preun
if [ $1 = 0 ] ; then
/sbin/chkconfig --del daemond
/sbin/service daemond stop &>/dev/null
fi
exit 0
%files
%defattr(-, root, root)
/usr/sbin/daemonsas-1.2/daemonsas
/etc/daemonsas-1.2/daemonsas.conf
/etc/init.d/daemond
-------------------
The error is
+ install -m 755 daemonsas $'/usr/local/up/rpm/daemonsas-1.2-root/usr/sbin/daemonsas-1.2\r'
+ install -m 644 daemonsas.conf $'/usr/local/up/rpm/daemonsas-1.2-root/etc/daemonsas-1.2\r'
+ install -m 755 daemond $'/usr/local/up/rpm/daemonsas-1.2-root/etc/init.d/daemonsas-1.2\r'
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: daemonsas-1.2-1
error: File must begin with "/":
error: File not found: /usr/local/up/rpm/daemonsas-1.2-root/usr/sbin/daemonsas-1.2/daemonsas
error: File not found: /usr/local/up/rpm/daemonsas-1.2-root/etc/daemonsas-1.2/daemonsas.conf
error: File not found: /usr/local/up/rpm/daemonsas-1.2-root/etc/init.d/daemond
RPM build errors:
File must begin with "/":
File not found: /usr/local/up/rpm/daemonsas-1.2-root/usr/sbin/daemonsas-1.2/daemonsas
File not found: /usr/local/up/rpm/daemonsas-1.2-root/etc/daemonsas-1.2/daemonsas.conf
File not found: /usr/local/up/rpm/daemonsas-1.2-root/etc/init.d/daemond
--------------------------
if i look in daemonsas-1.2-root dir i've etc,sbin dir
but in etc, sbin directories has a sub dir as daemonsas-1.2?
why such character is added with the dir?
if i add the '?' character in the files section such as
%files
%defattr(-,root,root)
/usr/sbin/daemonsas-1.2?/daemonsas
/etc/daemonsas-1.2?/daemonsas
/etc/init.d/daemonsas-1.2?/daemond
the error as "RPM build errors: file must begin with /"
Please help me out how to resolve it..
Thanks in advance,
regards,
umaparvathy
I'm trying to create own rpm. with system V init script .. but i'm getting stuck in %files section...
Please help me out...
Here my spec file
# This is the spec file for daemonsas
%define _topdir /usr/local/up/rpm
%define name daemonsas
%define release 1
%define version 1.2
%define buildroot %{_topdir}/%{name}-%{version}-root
BuildRoot:%{_topdir}
Summary:GNU daemonsas
License:GPL
Name:%{name}
Version:%{version}
Release:%{release}
Source:%{name}-%{version}.tgz
Group:Development tools
%description
Listen the tcp port and prints the received messages from the port to syslog
%prep
%setup -q
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/sbin/daemonsas-1.2
mkdir -p $RPM_BUILD_ROOT/etc/daemonsas-1.2
mkdir -p $RPM_BUILD_ROOT/etc/init.d/daemonsas-1.2
# install -m 755 -d %{buildroot}/usr/sbin/daemonsas-1.2
# install -m 755 -d %{buildroot}/etc/daemonsas-1.2
install -m 755 daemonsas $RPM_BUILD_ROOT/usr/sbin/daemonsas-1.2
install -m 644 daemonsas.conf $RPM_BUILD_ROOT/etc/daemonsas-1.2
install -m 755 daemond $RPM_BUILD_ROOT/etc/init.d/daemonsas-1.2
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%post
# cp daemond /etc/init.d
# chmod +x /etc/init.d/daemond
if [ -x /sbin/chkconfig ]; then
/sbin/chkconfig -add daemond
else
for i in 2 3 5 ; do
ln -sf /etc/init.d/daemond /etc/rc.d/rc${i}.d/S91daemond
done
for i 1 4 6 ; do
ln -sf /etc/init.d/daemond /etc/rc.d/rc${i}.d/K30daemond
done
fi
%preun
if [ $1 = 0 ] ; then
/sbin/chkconfig --del daemond
/sbin/service daemond stop &>/dev/null
fi
exit 0
%files
%defattr(-, root, root)
/usr/sbin/daemonsas-1.2/daemonsas
/etc/daemonsas-1.2/daemonsas.conf
/etc/init.d/daemond
-------------------
The error is
+ install -m 755 daemonsas $'/usr/local/up/rpm/daemonsas-1.2-root/usr/sbin/daemonsas-1.2\r'
+ install -m 644 daemonsas.conf $'/usr/local/up/rpm/daemonsas-1.2-root/etc/daemonsas-1.2\r'
+ install -m 755 daemond $'/usr/local/up/rpm/daemonsas-1.2-root/etc/init.d/daemonsas-1.2\r'
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip
+ /usr/lib/rpm/brp-strip-static-archive
+ /usr/lib/rpm/brp-strip-comment-note
Processing files: daemonsas-1.2-1
error: File must begin with "/":
error: File not found: /usr/local/up/rpm/daemonsas-1.2-root/usr/sbin/daemonsas-1.2/daemonsas
error: File not found: /usr/local/up/rpm/daemonsas-1.2-root/etc/daemonsas-1.2/daemonsas.conf
error: File not found: /usr/local/up/rpm/daemonsas-1.2-root/etc/init.d/daemond
RPM build errors:
File must begin with "/":
File not found: /usr/local/up/rpm/daemonsas-1.2-root/usr/sbin/daemonsas-1.2/daemonsas
File not found: /usr/local/up/rpm/daemonsas-1.2-root/etc/daemonsas-1.2/daemonsas.conf
File not found: /usr/local/up/rpm/daemonsas-1.2-root/etc/init.d/daemond
--------------------------
if i look in daemonsas-1.2-root dir i've etc,sbin dir
but in etc, sbin directories has a sub dir as daemonsas-1.2?
why such character is added with the dir?
if i add the '?' character in the files section such as
%files
%defattr(-,root,root)
/usr/sbin/daemonsas-1.2?/daemonsas
/etc/daemonsas-1.2?/daemonsas
/etc/init.d/daemonsas-1.2?/daemond
the error as "RPM build errors: file must begin with /"
Please help me out how to resolve it..
Thanks in advance,
regards,
umaparvathy