On Tue, 27 Oct 2009 12:59:18 +0100, Philipp Thomas
* doiggl@velocitynet.com.au (doiggl@velocitynet.com.au) [20091027 01:04]:
You don't. I'd install into a directory under /opt and make that
Philipp wrote: direcory and all files below it belong to the user cricket in the spec file.
I changed the line in the spec file to
/usr/sbin/useradd -r -o -c "Cricket SNMP Monitor" -s /bin/false -d %{_libdir}/%{name} %{name} 2> /dev/null || :
Question: What syntax do I use for the following commands in the specfile ? , and in which section should these commands be in ?
# cd /opt # gunzip -c cricket-1.0.5.tar.gz| tar xopf - # /bin/ln -s cricket-1.0.5 cricket # cd cricket # /bin/cp -v cricket-conf.pl.sample cricket-conf.pl
No, do it differently. Simply name the cricket tarball As source and let rpm unpack it. I'd recommend repacking it as bz2 with bznew as that would save space. And then do in %install:
mkdir -p %{buildroot}/opt cd .. cp -a %{name}-%{version} %{buildroot}/opt/%{name} pushd %{buildroot}/opt/%{name} cp cricket-conf.pl.sample cricket-conf.pl
Remember to mark cricket-conf.pl as a configuration file in the %files section by doing either
%config /opt/%{name}/cricket-conf.pl
or
%config(noreplace) /opt/%{name}/cricket-conf.pl
Also how do you change the ownership of the files /opt/cricket Have you got an example please.
By simply packaging them with said owner, eg. by changing
%defattr(-,root,root)
to
%defattr(-,cricket,root)
or
%defattr(-,cricket,cricket)
In the latter case you'd have to create the group cricket in the spec file. See mysql.spec for an example.
Philipp -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Thanks for the info Philipp Question what should i set name to ? (e.g just cricket-1.0.5) - So far I've done the following items:- # bznew -K cricket-1.0.5.tar.gz -> output cricket-1.0.5.tar.bz2 and attached it the project. Set Source: cricket-1.0.5.tar.bz2 #next install cricket-1.0.5.into /opt #still need to make symbolic link from to %install mkdir -p %{buildroot}/opt cd .. cp -a %{name}-%{version} %{buildroot}/opt/%{name} pushd %{buildroot}/opt/%{name} #need to make symbolic link from cricket to cricket-1.0.5 cd %{buildroot}/opt /bin/ln -s cricket-1.0.5 cricket cp cricket-conf.pl.sample cricket-conf.pl %pre id cricket >/dev/null 2>&1 if [ $? -ne 0 ]; then /usr/sbin/groupadd cricket /usr/sbin/useradd -r -o -c "Cricket SNMP Monitor" -s /bin/false -d %{_libdir}/%{name} %{name} 2> /dev/null || : fi %postun if [ $1 -eq 0 ]; then /usr/sbin/userdel cricket /usr/sbin/groupdel cricket fi %files %defattr(-,cricket,cricket) specfile ->https://build.opensuse.org/package/edit_file?file=cricket-1-0-5.spec&package=cricket-1-0-5&project=home%3Adoiggl project -> https://build.opensuse.org/package/show?package=cricket-1-0-5&project=home%3Adoiggl Question:- Does the specfile look ok to you ? Thanks for the help Glenn -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org