LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   vsftpd build script (https://www.linuxquestions.org/questions/slackware-14/vsftpd-build-script-330878/)

0.o 06-06-2005 11:01 AM

vsftpd build script
 
Hola mi amigos,

I am trying to create a Slackware package from vsftpd 2.0.3 source and would like a little help on modifying the build script in the current tree of Slackware. I have been using Slackware for a while now, but have just recently started to learn scripting and how to correctly use build scripts to create my own packages.


The current build script for vsftpd 2.0.1:

Code:

#!/bin/sh
CWD=`pwd`
TMP=${TMP:-/tmp}
PKG=$TMP/package-vsftpd

VERSION=2.0.1
ARCH=${ARCH:-i486}
BUILD=1

if [ ! -d $TMP ]; then
  mkdir -p $TMP
fi
rm -rf $PKG
mkdir -p $PKG
cd $TMP
rm -rf vsftpd-$VERSION
tar xzvf $CWD/vsftpd-$VERSION.tar.gz
cd vsftpd-$VERSION
find . -perm 777 -exec chmod 755 {} \;
find . -perm 664 -exec chmod 644 {} \;
chown -R root.root .
zcat $CWD/vsftpd.builddefs.diff.gz | patch -p1 --verbose
zcat $CWD/vsftpd.conf.diff.gz | patch -p1 --verbose
make -j3
mkdir -p $PKG/usr/sbin
cp vsftpd $PKG/usr/sbin
chmod 755 $PKG/usr/sbin/vsftpd
chown -R root:bin $PKG/usr/sbin
strip --strip-unneeded $PKG/usr/sbin/vsftpd
mkdir -p $PKG/usr/man/man{5,8}
cat vsftpd.conf.5 | gzip -9c > $PKG/usr/man/man5/vsftpd.conf.5.gz
cat vsftpd.8 | gzip -9c > $PKG/usr/man/man8/vsftpd.8.gz
mkdir -p $PKG/etc
cat vsftpd.conf > $PKG/etc/vsftpd.conf.new
mkdir -p $PKG/etc/logrotate.d
zcat $CWD/vsftpd.log.gz > $PKG/etc/logrotate.d/vsftpd.new
mkdir -p $PKG/usr/share/empty
mkdir -p $PKG/home/ftp
mkdir -p $PKG/usr/doc/vsftpd-$VERSION
cp -a \
  AUDIT BENCHMARKS BUGS COPYING COPYRIGHT Changelog EXAMPLE FAQ \
  INSTALL LICENSE README* REFS REWARD SECURITY SIZE SPEED TODO TUNING \
  $PKG/usr/doc/vsftpd-$VERSION
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh

cd $PKG
makepkg -l y -c n $TMP/vsftpd-$VERSION-$ARCH-$BUILD.tgz


Do I only need to change the version/build, or what? And maybe a good explanation of what is going on in that code. :D

keefaz 06-06-2005 11:15 AM

You need the vsftpd.builddefs.diff.gz, vsftpd.conf.diff.gz, slack-desc
and doinst.sh.gz files, then change the version number and all should
go well.

For the explanation, as the script does a bunch of stuff,
could you ask for a particular part ?

win32sux 06-06-2005 11:15 AM

first thing you'd wanna do is just replace the source tarball in the directory and then change the "VERSION=2.0.1" to "VERSION=2.0.3"... then run it like that and take note of any errors you get... i see there's a couple patches in the build directory so you'd probably have to make a couple adjustments, although that's not always the case... if the new version is just a bugfix release you might be just fine, but i haven't looked at the vsftpd changelog and also i haven't looked at those slackware patches so i'm not sure...

0.o 06-06-2005 11:31 AM

It seems as though the patches are nothing more than a way to enable different features of vsftpd. The links to the files are:

http://slackware.mirrors.pair.com/sl...lddefs.diff.gz

http://slackware.mirrors.pair.com/sl...d.conf.diff.gz

So i should be able to download them and modify it to my specifications and all will be well.


The part of the script i wasn't sure of was:

Code:

zcat $CWD/vsftpd.builddefs.diff.gz | patch -p1 --verbose
zcat $CWD/vsftpd.conf.diff.gz | patch -p1 --verbose

Although, i have looked up what the program is, i still don't understand why i shouldn't just use patch command to complete this task.

win32sux 06-06-2005 11:58 AM

zcat is like cat except it gunzips the file before cating it...

it's the same as doing a "gunzip -c"...



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