LinuxQuestions.org
Review your favorite Linux distribution.
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 07-15-2012, 10:13 PM   #1
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
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.
 
Old 07-15-2012, 10:17 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
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?

Last edited by astrogeek; 07-15-2012 at 10:19 PM.
 
Old 07-15-2012, 10:25 PM   #3
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
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]

Last edited by T3slider; 07-15-2012 at 10:29 PM.
 
1 members found this post helpful.
Old 07-15-2012, 10:27 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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
 
1 members found this post helpful.
Old 07-15-2012, 10:30 PM   #5
D1ver
Member
 
Registered: Jan 2010
Distribution: Slackware 13.37
Posts: 598
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
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.
 
1 members found this post helpful.
Old 07-15-2012, 10:54 PM   #6
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949

Original Poster
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
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!

Last edited by damgar; 07-15-2012 at 11:22 PM.
 
Old 07-15-2012, 11:30 PM   #7
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by damgar View Post
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.
 
Old 07-15-2012, 11:37 PM   #8
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949

Original Poster
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
Quote:
Originally Posted by kikinovak View Post
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!
 
Old 07-16-2012, 01:48 AM   #9
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

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


Reply


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
What are the steps to build and install a Slackware package from a RPM package? sudeepkulkarni Slackware 6 04-25-2011 12:51 PM
Creating a php package for Slackware 13.1 Ramurd Slackware 4 10-13-2010 06:51 PM
creating rpm package javimd786 Linux - Newbie 1 01-05-2010 01:02 PM
LXer: Pretending a Package is Installed by Creating an Empty Package with Checkinstal LXer Syndicated Linux News 0 05-03-2009 03:10 PM
Creating a package repository Thakowbbery SUSE / openSUSE 0 10-13-2005 08:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:57 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration