LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-09-2009, 07:45 AM   #1
kjhambrick
Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware-64 -current
Posts: 58

Rep: Reputation: 27
SlackBuild an rpm ?


All --

I was wondering what's the proper way to include the (pre and post) (install and uninstall) scripts from a .rpm into a SlackBuild script.

I can see how to include the install scriptlets (preinstall and postinstall).

What about the preuninstall and postuninstall scripts ?

See attached get-rpm-scriptlets.txt (added .txt extension to allow attachment) which can extract the scriptlets from a .rpm file.

Save as get-rpm-scriptlets and set permissions to executable:

Code:
mv get-rpm-scriptlets.txt get-rpm-scriptlets 
chmod 755 get-rpm-scriptlets
I was able to install the IBM symphony rpm and run the postinstall scriptlet on my Slackware 12.1-ish box and I would like to package it up as a SlackBuild and also include the uninstall and update code from the .rpm file in the SlackBuild Package.

Thanks !

-- kjh

attached: get-rpm-scriptlets.txt ( save as get-rpm-scriptlets )
Attached Files
File Type: txt get-rpm-scriptlets.txt (3.1 KB, 12 views)

Last edited by kjhambrick; 02-09-2009 at 07:56 AM. Reason: Fix unresolved reference in attached script
 
Old 02-09-2009, 08:08 AM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
I would suggest just using the "rpm2tgz" program if you want to create a TGZ from an RPM. I am pretty sure it handles the pre- and post-scripts that run.

Last edited by indienick; 02-09-2009 at 08:29 AM.
 
Old 02-09-2009, 08:19 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,270

Rep: Reputation: Disabled
Quote:
Originally Posted by indienick View Post
I would suggest just using the "rpm2tgz" program. I am pretty sure it handles the pre- and post-scripts that run.
No it does not.

And the Slackware package format does not support uninstall-scripts anyway. The rpm post-install scriptlets can be added to Slackware's doinst.sh script and pre-install scripts are not supported at all.

Eric
 
Old 02-09-2009, 08:23 AM   #4
kjhambrick
Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware-64 -current
Posts: 58

Original Poster
Rep: Reputation: 27
re: SlackBuild an rpm ?

indienick --

Does rpm2tgz extract the (pre and post) (install and uninstall) scriptlets from a .rpm and create the appropriate install.sh and (??? uninstall.sh ???) scripts ?

Looking at /usr/bin/rpm2targz, I don't see that functionality ... but then again <G> ...

See attached symphony-1.2-postinstall.txt script that I extracted from IBM's symphony-1.2.i586.rpm with get-rpm-scriptlets and ran after installing the package I extracted with rpm2tgz.

It created the proper symlinks and added symphony as an Item to my KDE 'Office' SubMenu.

What I would like to do is build a SlackBuild and include the uninstall scripts in the SlackBuild.

Thanks !

-- kjh
Attached Files
File Type: txt symphony-1.2-postinstall.txt (20.8 KB, 9 views)
 
Old 02-09-2009, 08:23 AM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,758

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
"rpm2tgz" does not handle any scripts -it simply converts the archive to a tar.gz.

While a postinstall can be converted to a doinst.sh, installpkjg does not have any facility to run preinstall scripts. If there is something essential in there, you'd need to figure out how to run those commands on the package tree. Also, removepkg does not handl any sort of preuninstall or postuninstall scripts.

My src2pkg program might be helpful to convert the package to a proper slack-type package. It does a basic conversion or binary rpm's to tgz. And if you extract the postinstall and convert it to a doinst.sh, just place it alongside the rpm and src2pkg will automatically pick it up.

If you need to do anything else to the package content you can add custom commands to a src2pkg script to do that.
Just an idea....
 
Old 02-09-2009, 08:39 AM   #6
kjhambrick
Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware-64 -current
Posts: 58

Original Poster
Rep: Reputation: 27
re: SlackBuild an rpm ?

gnashley --

Thanks for the pointer to src2pkg. Definitely worth checking out.

Alien Bob --

Thanks for the reply (! and many thanks for all the SlackBuild Packages you've shared with us the rest of us !) !

I suppose sharing an IBM symphony SlackBuild is a little iffy for now because the pre-install scriptlet does a bit of dependency checking and it also checks for install mode vs update mode ... I need to think about it for a while before releasing anything dangerous on the world ...

-- kjh
 
Old 02-09-2009, 07:13 PM   #7
dockpunk
Member
 
Registered: Dec 2004
Distribution: slackware 12
Posts: 67

Rep: Reputation: 15
theoretically couldnt you just create a package within a package?
the initial slackware package would contain your preinstall script as a doinst.sh along with the binary package being placed in /tmp. at the end of doinst.sh have it execute an installpkg /tmp/<pkg>.tgz. the doinst.sh of that package would then contain all your postinstall stuff.

that's somewhat like how the open office autobuild slackware packages are set up isnt it?

Last edited by dockpunk; 02-09-2009 at 07:14 PM.
 
  


Reply

Tags
spam


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OO 3.01 slackbuild ? brodo Slackware 4 02-01-2009 04:06 PM
slackbuild question stormtracknole Slackware 2 11-13-2006 02:24 PM
Using slackbuild scripts Steve50 Slackware 3 10-11-2006 02:42 AM
Slackbuild and Patches stormtracknole Slackware 4 03-30-2006 08:12 PM
SlackBuild CrEsPo Slackware 2 03-19-2006 01:58 PM


All times are GMT -5. The time now is 09:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration