Author Topic: %post + %postun  (Read 1241 times)

Offline trustytrev

  • Sr. Member
  • ****
  • Posts: 472
%post + %postun
« on: May 08, 2010, 06:51:55 PM »
Hello,
       I am looking for guidance with my spec file please.
Do I just replace what already exists in %post with /sbin/ldconfig
Also there is no %postun section after the %post section.
Do I just insert?
                        %postun
                        /sbin/ldconfig
I am making progress I think.
Thanks very much.
trustytrev. :)
If there's a harder way to do something I'll probably find it.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: %post + %postun
« Reply #1 on: May 08, 2010, 07:07:54 PM »
More information is required. What are you building? Are you updating it? You mention replacing a current %post. Why do you think it needs to be replaced?

Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12518
Re: %post + %postun
« Reply #2 on: May 08, 2010, 07:45:19 PM »
Hello,
       I am looking for guidance with my spec file please.
Do I just replace what already exists in %post with /sbin/ldconfig
Also there is no %postun section after the %post section.
Do I just insert?
                        %postun
                        /sbin/ldconfig
I am making progress I think.
Thanks very much.
trustytrev. :)

%post and %postun is only needed if your package is installing library files say in /usr/lib and you need them to be registered or unregistered with your install.


Thanks to everyone who donates. You keep the servers running.

Offline trustytrev

  • Sr. Member
  • ****
  • Posts: 472
Re: %post + %postun
« Reply #3 on: May 08, 2010, 07:53:52 PM »
Hello,
      I am following the packagers guide RPM_Build_Manual_Rev2.pdf
This is what I am "building"? and where I have reached.


%post
if [ -f %{_sysconfdir}/kismet.conf ] ;
then
   if ! egrep -q "^piddir="  %{_sysconfdir}/kismet.conf
   then
      echo "piddir=/var/run/" >> %{_sysconfdir}/kismet.conf
   fi
fi


What I was unsure about is /sbin/ldconfig  and what should be in the %post & %postun sections
Perhaps a better question would be where/how to find spec files and packages already done for PCLinuxOS that I could examine for guidance.
Thanks.
trustytrev.
If there's a harder way to do something I'll probably find it.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!