source: npl/overig/slackpackage/slack-package.conf @ 250d444

gcc484perl-5.22
Last change on this file since 250d444 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 5.8 KB
Line 
1###
2## Slackware Package Build Script
3## 
4## This file is to assist you in setting global
5## package variables that can are used in Slackware
6## build scripts download from Linuxpackages.net
7##
8##       Copyright (C) 2004 LinuxPackages.net
9##
10##   Redistribution and use of this software, with or without modification, is
11##   permitted provided that the following conditions are met:
12##
13## 1. Redistributions of this software must retain the above copyright
14##   notice, this list of conditions and the following disclaimer.
15##
16##  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
19##  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21##  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22##  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23##  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24##  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25##  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
28
29## Version of this conf
30CONFVER=1.9
31
32## We need to set the umask since by default root has 0077 and this will
33## create broken packages.
34umask 0022
35
36## Gota know where we are
37CWD=`pwd`
38
39## See if the TMP variable is set
40if [ "$TMP" = "" ]; then
41          TMP=/tmp
42fi
43## Where to put packages once built
44PKG_DIR=`pwd`
45if [ ! -d $PKG_DIR ]; then
46 mkdir -p $PKG_DIR
47fi
48 
49
50## Your build tag for the build field such as jim replace the XXX.
51MYIN="1DatuX"
52
53## Location of wget this should be fine.
54WGET="/usr/bin/wget -c"
55
56## Set the arch we will build for
57#ARCH="i386"
58ARCH="i486"
59#ARCH="i686"
60#ARCH="x86_64"
61
62## Determin the CFLAGS based on the arch from above
63if [ "$ARCH" = "i386" ]; then
64  SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
65elif [ "$ARCH" = "i486" ]; then
66  SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
67elif [ "$ARCH" = "i686" ]; then
68  SLKCFLAGS="-O2 -march=i686 -mcpu=i686"
69elif [ "$ARCH" = "x86_64" ]; then
70  SLKCFLAGS="-O2 -march=x86_64"
71fi
72
73## CFLAGS we get these from the above settings
74CFLAGS="$SLKCFLAGS"
75
76CXX=gcc
77
78## CXXFLAGS same as the CFLAGS
79CXXFLAGS="$SLKCFLAGS"
80
81## MaKe some generic funtions for cleaning stipping and permissions
82
83## Call this in the script to remove debug and junk
84strip_bin() {
85find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
86}
87
88## Call this in the script to strip libs
89strip_lib() {
90find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
91}
92
93## Call this in the script to strip static libs
94strip_static() {
95find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip --strip-debug 2> /dev/null
96}
97
98## Call this to zip up the man directories
99gzip_man() {
100gzip -9q $1/usr/man/*/*
101}
102
103## Call this to zip up the info documents
104gzip_info() {
105gzip -9q $1/usr/info/*
106}
107
108## Call this to make sure bin and sbin are the correct groups
109bin_perms() {
110for DIRECTORY in bin usr/bin usr/local/bin usr/X11R6/bin; do
111if [ -d $1/$DIRECTORY ]; then
112chown -R root.bin $1/$DIRECTORY
113chmod -R 755 $1/$DIRECTORY
114fi;done
115}
116
117sbin_perms() {
118for DIRECTORY2 in sbin usr/sbin usr/local/sbin; do
119if [ -d $1/$DIRECTORY2 ]; then
120chown -R root.bin $1/$DIRECTORY2
121chmod -R 755 $1/$DIRECTORY2
122fi;done
123}
124
125
126## Call this to fix various permissions on the source before the compile
127## The last two entries are for suid bins uncomment if you wish to remove them.
128
129fix_source() {
130chown -R root.root .
131find . -perm 664 -exec chmod 644 {} \;
132find . -perm 600 -exec chmod 644 {} \;
133find . -perm 444 -exec chmod 644 {} \;
134find . -perm 400 -exec chmod 644 {} \;
135find . -perm 440 -exec chmod 644 {} \;
136find . -perm 777 -exec chmod 755 {} \;
137find . -perm 775 -exec chmod 755 {} \;
138find . -perm 511 -exec chmod 755 {} \;
139find . -perm 711 -exec chmod 755 {} \;
140find . -perm 555 -exec chmod 755 {} \;
141find . -perm 666 -exec chmod 644 {} \;
142#find . -perm 2775 -exec chmod 755 {} \;
143#find . -perm 2755 -exec chmod 755 {} \;
144}
145
146
147## This will handle documents care of Piotr Simon taken from checkinstall
148DOCFILES="ABOUT ABOUT-NLS ANNOUNCE AUTHORS CONFIGURATION CHANGES COPYING COPYRIGHT CREDITS ChangeLog \
149Changelog CHANGELOG CONTRIBUTORS *FAQ* FEATURES FILES HACKING History HISTORY INSTALL* LICENSE LSM \
150MANIFEST NEWS *README* *Readme* SITES *RELEASE* RELNOTES THANKS TIPS TODO VERSION CONFIGURATION* \
151GPL License Doc doc Docs* docs* Roadmap ROADMAP *BUGS* index.ht* *INDEX*"
152
153## Pass the pkg variable program name and version to this function to setup all the documents.
154## Example create_docs $PKG apache-2.0.49  I use this method due to some scripts build mulitple
155## packages.
156
157create_docs () {
158DOCS=$1/usr/doc/$2
159mkdir -p ${DOCS}
160for i in ${DOCFILES}; do
161  if [ -e ${i} ]; then
162   if ! [ -L ${i} ]; then
163 cp -a ${i} ${DOCS}
164 else
165cp -LRp ${i} ${DOCS}
166 fi
167fi;done
168chmod 644 $1/usr/doc/$2/*
169chown -R root.root $1/usr/doc/$2/*
170}
171
172
173## A small function to uprade the slackbuilds package if needed
174
175upgrade_self() {
176# rm -rf
177mkdir -p $TMP/slackbuilds-install
178cd $TMP/slackbuilds-install
179VER_LOC="http://www1.linuxpackages.net/packages/SlackBuilds/LATESTVER"
180$WGET -q $VER_LOC || true
181NEWVER=`cat LATESTVER`
182if [[ "`cat LATESTVER`" > "$CONFVER" ]]; then
183   echo " Upgraded needed $CONFVER $NEWVER "
184   UPG_LOC="http://www1.linuxpackages.net/packages/SlackBuilds/slackbuilds-$NEWVER-noarch-1jim.tgz"
185   $WGET $UPG_LOC || true
186   upgradepkg slackbuilds-$NEWVER-noarch-1jim.tgz
187   cd ..
188   rm -rf slackbuilds-install
189   exit
190else
191   echo "Your version is current no upgrade needed your Version $CONFVER Latest Version $NEWVER"
192   cd ..
193   rm -rf slackbuilds-install
194   exit
195fi
196}
197
198
Note: See TracBrowser for help on using the repository browser.