LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Creating a Slackware package. (http://www.linuxquestions.org/questions/slackware-14/creating-a-slackware-package-4175416898/)

damgar 07-15-2012 10:13 PM

Creating a Slackware package.
 
As I understand them, the basic point of packages is so that they can be easily upgraded or removed. I have a directory that has precompiled files in the subdirectories /etc and /usr. Copying the corresponding files into /usr and /etc on my machine yield a working program. Is there an easy way to create a package so that rather than manually copying them I can just use installpkg and then later either upgrade them or remove them with removepkg or upgradepkg? I know there are programs and scripts to help create packages, but I've never used any of them.

astrogeek 07-15-2012 10:17 PM

When I need to do things like that, and there is no SBo script for it, I create an SBo type script based on the template or a package with a similar build environment (i.e., GNU automake, etc.).

What program is it?

T3slider 07-15-2012 10:25 PM

If you have a proper directory tree just add an install directory with slack-desc and (if required) doinst.sh files, cd to the directory tree and run
Code:

makepkg -l y -c n ../packagename.txz
as root. You should make sure the permissions on the directory tree are correct (since they will overwrite the permissions on the real /) -- root:root and usually 755 for directories and 644 for files. Technically you can pass '-c y' to makepkg instead of '-c n' which will reset all permissions of the package, but this is really done best beforehand so you can verify that all permissions are correct (especially if some directories/files have weird permissions intentionally). See `man makepkg`. I think you can technically get away with not having a slack-desc file but it makes the log messy so I would advise against it.

[edit] By proper directory tree, I mean in /path/to/tree there are for example etc/ and usr/ directories with the desired files. [/edit]
[edit2] Heh, I forgot the package name -- the most important part. Added. ;) [/edit2]

TobiSGD 07-15-2012 10:27 PM

If you have the files already in the right tree-structure (which seems to be the case for you), just cd into that directory and launch the command
Code:

makepkg ../programname-version.txz

D1ver 07-15-2012 10:30 PM

I believe makepkg is the command you're looking for. I've had success making some homebrew slack packages in the past.

Something along the lines of
Code:

make
mkdir pkg
make DESTDIR=pkg install
cd pkg
makepkg packagename.tgz
installpkg packagename.tgz

edit: darn, third.

damgar 07-15-2012 10:54 PM

Wow yall were fast on that! I used makepkg and it seemed to work. The program is minidlna and it has a slackbuild, but it refuses to build with the newest ffmpeg package from Eric. What I found is they have a static tarball that is ready to go that works without building or regard to the other packages. It seems to have worked. It's running and the .conf file wound up in /etc just the way I should have! Thanks!

Edit: Worked great! I'm super happy with the way that worked! Thanks again!

kikinovak 07-15-2012 11:30 PM

Quote:

Originally Posted by damgar (Post 4729145)
What I found is they have a static tarball that is ready to go that works without building or regard to the other packages.

You can even write a proper SlackBuild script for your static tarball. If you don't know exactly how to go about that, you can take a peek at the various SlackBuild scripts for icon themes, for example, where content is just uncompressed and repacked.

damgar 07-15-2012 11:37 PM

Quote:

Originally Posted by kikinovak (Post 4729162)
You can even write a proper SlackBuild script for your static tarball. If you don't know exactly how to go about that, you can take a peek at the various SlackBuild scripts for icon themes, for example, where content is just uncompressed and repacked.

That sounds like something worth checking into!

kikinovak 07-16-2012 01:48 AM

Just send me the link to your application tarball, and I'll write the SlackBuild script for you, if it helps.


All times are GMT -5. The time now is 05:11 AM.