LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   SlackBuild guildline (https://www.linuxquestions.org/questions/slackware-14/slackbuild-guildline-395627/)

kaon 12-22-2005 09:33 AM

SlackBuild guildline
 
Hi all,

Have been searching for a while on this topic. Did look at some scripts in slackware source folder, and still cannot come up with a full image. Therefore anyone could provide us a guideline for making a slackbuild script that complies with Pat's rule?

So far I have discovered:
1) Create tmp folder named 'package-{software name}' under /tmp
2) extract the source to that folder
3) configure with options (what options other than --prefix=/usr?)
4) make
5) make install (?!)
6) change permission to 755/644/600 (another uncertainy)
7) makepkg


Thanks.

MMYoung 12-22-2005 10:15 AM

Quote:

Originally Posted by kaon
3) configure with options (what options other than --prefix=/usr?)

I use my own build scripts for individual packages just cause it's easier for me to keep my "stuff" seperated. Having said that I always add --sysconfdir=/etc --localstatedir=/var/lib along with --prefix=/usr.
Quote:

Originally Posted by kaon
5) make install (?!)

Be sure and use the make install DESTDIR=/directory directive so that the souce isn't actually "installed" on your system, but rather "installed" to a directory of your choice for package building. For example I use /work/builds.
Quote:

Originally Posted by kaon
6) change permission to 755/644/600 (another uncertainy)

After I run make in my script I added the following to make sure my permissions are set correctly:
chown -R root.root .
find . -perm 777 -exec chmod 755 {} \;
find . -perm 555 -exec chmod 755 {} \;
find . -perm 444 -exec chmod 644 {} \;
find . -perm 666 -exec chmod 644 {} \;
find . -perm 664 -exec chmod 644 {} \;
This is run from the just compiled source directory, VERY IMPORTANT!

Then after make install DESTDIR=/directoryname, I cd over to the install directory and exectue the following to make sure any bin files have the proper ownership:
chown root.bin ${BUILD}usr/bin/*
chown root.bin ${BUILD}usr/sbin/*
chown root.bin ${BUILD}bin/*
chown root.bin ${BUILD}sbin/*
chown root.bin ${BUILD}usr/X11R6/bin/*

I also strip the binaries and zip the manpages:
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null
bzip2 -9q ${BUILD}usr/man/*/*
bzip2 -9q ${BUILD}usr/info/*
Quote:

Originally Posted by kaon
7) makepkg

makepkg -l y -p -c n ${FILE}-${VER}-${ARCH}-${REV}.tgz
md5sum ${FILE}-${VER}-${ARCH}-${REV}.tgz > ${FILE}-${VER}-${ARCH}-${REV}.tgz.md5

All variables, ${BUILD}, ${FILE}, etc, are assigned by the script.

HTH, MMYoung

Vampirite 12-22-2005 10:18 AM

I've read somewhere that you need to use "make install DESTDIR=whereeveryouwant" which puts the files in a directory where you can run "makepkg" in to create the package. I basically use this.

--Kourosh

dunric 12-22-2005 11:52 AM

Quote:

Therefore anyone could provide us a guideline for making a slackbuild script that complies with Pat's rule?
What prevents you to look into Pat's slackbuild scipts in Slackware's source repository ?
Some introduction to the issue can be found in FOSDEM presentation document in PDF or plaintext format.

It's very easy to create some template of generic SlackBuild scipt and tweak it to the concrete software whenever required.
Good security practice is to build all packages in fakerooted environment.
Tracking newer versions and/or security patches is the only annoyance.


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