LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Register
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 11-16-2006, 04:19 PM   #1
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Rep: Reputation: 63
Making Slackware Packages 202


Hi all,

I guess the best way to pose my question is for a program that I'd like to make a package for.

I want to make a slackware package for (amongst other's) logwatch.

Now logwatch has a very quick installer and such, and not a complex ( I hope ) application to use for my example here.

Logwatch has a simple install.sh script that runs and just tosses out it's files on the pc.

Now if I run "installwatch install_logwatch.sh" the installwatch does monitor the entire installation, and makes a database file and an install.log file in my /var/tmp directory.

My first question is: How do I transpose the install.log file into a doinst.sh and a Slackware 'tgz' package?

I have made every effort I can think of to try and find a man page for installwatch, or a guide. However if I understand it correctly; the author of installwatch has moved the project into checkinstall. I'm using the checkinstall from Slackware's 11.0 extra cd; and their is simply no documentation that I can find on this.

My second question on topic is: If I have a bunch of config files (such as clamd.conf, freshclam.conf, aide.conf) how do I put them into a tgz package too? My reasoning is like many, there are times you decide to reload and keeping your various latest greatest config's in one package makes it easy.

Thank you in advance.
 
Old 11-17-2006, 01:18 AM   #2
tw001_tw
Member
 
Registered: Mar 2003
Location: St. Louis, MO
Distribution: kubuntu-current
Posts: 551
Blog Entries: 4

Rep: Reputation: 31
Old_Fogie,
I can't help you with the first part of your task, but can
point you in the right direction regarding making a slack
install file for your conf files.

Hope you can verbalize this.

make a work directory. lets call it /home/oldfogie/work
then make /home/oldfogie/work/install & /home/oldfogie/work/etc
(we are pretanding that the only conf files you want are in the
/etc dir.)

Then copy the .conf files from the /etc dir. to the
/home/oldfogie/work/etc dir.

make a file called "slack-desc" in the /home/oldfogie/work/install dir.
use a "slack-desc" file from a preexisting .tgz as a template if you want.

then:
cd /home/oldfogie/work && makepkg 2006-11-15.etc_backup.tgz (enter)
there you go.

NOW... this is a brief completely non-automated way to do it.
I'm sure someone can come along and give you a much better worded and
inevitably a fancier way of doing it.
Here is a link for reference. Also, examples are always nice to compare.
http://www.linuxpackages.net/howto.p...=Package+Howto
good luck!
-tw
 
Old 11-17-2006, 01:34 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8124Reputation: 8124Reputation: 8124Reputation: 8124Reputation: 8124Reputation: 8124Reputation: 8124Reputation: 8124Reputation: 8124Reputation: 8124Reputation: 8124
Quote:
How do I transpose the install.log file into a doinst.sh and a Slackware 'tgz' package?
The easy way would be to let checkinstall monitor the install, and let it create the Slackware package for you. But this is perhaps not wat you want. If you want to have total control over the package creation, I suggest you read that install.sh file and copy what that is doing into a SlackBuild script of your own writing.

I have an old SlackBuild script for logwatch lying around that I never published (I run logwatch 5.2.2 on my server), but to show you the gist of that script:
Code:
PRGNAM=logwatch
VERSION=5.2.2

tar -xzvf $CWD/${PRGNAM}-${VERSION}.tar.gz
cd ${PRGNAM}-${VERSION}
chown -R root.root *

# We use the more appropriate name '/etc/logwatch.d' instead of the default
# '/etc/log.d' as directory name
mkdir -p $PKG/etc/logwatch.d
mv scripts conf lib $PKG/etc/logwatch.d/

# Create a link in root's PATH so that the program can be run from the
# commandline as well as called in a cron job.
mkdir -p $PKG/usr/sbin
(cd $PKG/usr/sbin;
 ln -s ../../etc/logwatch.d/scripts/logwatch.pl logwatch)

# Fix pathnames in the package
find $PKG -type f |
while read i
do
  sed -i 's|/log.d|/logwatch.d|g' "$i"
done
sed -i 's|/bin/mktemp|/usr/bin/mktemp|' $PKG/etc/logwatch.d/conf/logwatch.conf
sed -i 's|/bin/mail|/usr/bin/mail|' $PKG/etc/logwatch.d/conf/logwatch.conf

# Man page
mkdir -p $PKG/usr/man/man8
gzip -9c logwatch.8 > $PKG/usr/man/man8/logwatch.8.gz

# Install a cron job
mkdir -p $PKG/etc/cron.daily
( cd $PKG/etc/cron.daily && ln -sf /usr/sbin/logwatch )
Since it is for an old version of logwatch, I don't know if it even applies to a current version, but it shows what you can do in a SlackBuild script if you don't want to run the program's own install.sh.

If you have more questions about this, let me know (or contact me off-list).
Eric
 
Old 11-17-2006, 02:02 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614
Here's the way I do it with PkgBuild:

http://distro.ibiblio.org/pub/linux/...ogwatch-7.3.1/

#!/bin/bash
## PkgBuild script for: logwatch
## Auto-generated by 'src2pkg'
BUILD='1'
NAME='logwatch'
VERSION='7.3.1'
SRC_SUFFIX='.tar.bz2'

STD_FLAGS='-O2 -march=i486 -mtune=i686'
PRE_FIX='/usr'
EXTRA_CONFIGS=''

FORCE_ZERO_LENGTH=YES

# Get the functions and configs
source /usr/libexec/pkgbuild/FUNCTIONS ;

# do_all_processes can substitute these 16 steps:

pre_process
find_source
make_dirs
unpack_source

# apply this debian patch from the original developer
cd $SRC_DIR && patch -p1 < $CWD/logwatch-7.3.1-3.diff 1> /dev/null

fix_source_perms

# configure_source
# compile_source
# fake_install

cd $SRC_DIR

mkdir -p $PKG_DIR/etc/logwatch
mkdir -p $PKG_DIR/etc/logwatch/scripts
mkdir -p $PKG_DIR/etc/logwatch/conf
mkdir -p $PKG_DIR/etc/logwatch/conf/logfiles
mkdir -p $PKG_DIR/etc/logwatch/conf/services
touch $PKG_DIR/etc/logwatch/conf/logwatch.conf
touch $PKG_DIR/etc/logwatch/conf/ignore.conf
touch $PKG_DIR/etc/logwatch/conf/override.conf

mkdir -p $PKG_DIR/usr/share/logwatch
mkdir -p $PKG_DIR/usr/share/logwatch/dist.conf
mkdir -p $PKG_DIR/usr/share/logwatch/dist.conf/logfiles
mkdir -p $PKG_DIR/usr/share/logwatch/dist.conf/services

cp -a conf/ $PKG_DIR/usr/share/logwatch/default.conf
cp -a scripts/ $PKG_DIR/usr/share/logwatch/scripts
cp -a lib $PKG_DIR/usr/share/logwatch/lib

mkdir -p $PKG_DIR/var/cache/logwatch
mkdir -p $PKG_DIR/etc/cron.daily

fix_pkg_perms
strip_bins
create_docs
compress_man_pages
make_description
make_doinst
make_package
post_process

# Amigo PkgBuild and src2pkg - Copyright 2005-2006 Gilbert Ashley <amigo@ibiblio.org>
## See the documentation for more help and examples. Below are some of
# the most common Extras and Options for easy cut-and-paste use.
# EXTRA_CONFIGS='' PRE_FIX='' DOCLIST='' INSTALL_RULE='' CONFIG_SUBDIR=''

# end PkgBuild script

doinst.sh:

( ln -sf /usr/share/logwatch/scripts/logwatch.pl /etc/cron.daily/0logwatch )
( ln -sf /usr/share/logwatch/scripts/logwatch.pl /usr/sbin/logwatch )

Last edited by gnashley; 11-17-2006 at 03:15 AM.
 
  


Reply



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
Making slackware packages - What Magic To Use? Old_Fogie Slackware 34 06-03-2006 09:07 PM
making 2.6 kernel packages xushi Slackware 6 04-14-2005 06:18 PM
making .tgz packages from sources r_jensen11 Slackware 3 02-03-2004 05:57 PM
Making Slackware Packages tjm Slackware 5 07-31-2003 11:46 AM
Having trouble with making Slack packages lostboy Slackware 4 05-18-2003 10:15 PM

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

All times are GMT -5. The time now is 05:06 PM.

Contact Us - Advertising Info - Rules - Privacy - Donations - Contributing Member - LQ Sitemap - "Weather apps tell you it'll rain. Wyndo tells you when to go."
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