3 ## Creates a Slackware package
4 ## Copyright (c) 2005-2007 by Michal Nazarewicz (mina86/AT/mina86.com)
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 3 of the License, or
9 ## (at your option) any later version.
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ## GNU General Public License for more details.
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, see <http://www.gnu.org/licenses/>.
19 ## This is part of Tiny Applications Collection
20 ## -> http://tinyapps.sourceforge.net/
30 echo Stripping executables
31 find .
-type f
-exec file -- {} + | \
32 sed -ne '/ELF.*executable/ s/:.*//p
33 /ELF.*shared object/ s/:.*//p' |
34 xargs --no-run-if-empty strip
--strip-unneeded 2>/dev
/null
38 ## Search for *.new files and add them do doinst.sh
40 echo Searching
for \
*.new files
41 find .
-type f
-name '*.new' |
sed -e "s/'/'\\''/g" \
42 -e "s/^\\(.*\\)\\.new$/cfg '\\1'/" >mkpkg-new
44 if [ -s mkpkg-new
]; then
45 echo Adding \
*.new files to doinst.sh
47 cat - mkpkg-new
<<EOF >>install/doinst.sh
51 if ! [ -r "\$1" ]; then
54 elif ! cmp "\$1" "\$1.new" >/dev/null 2>&1; then
62 echo '[ -z "\$NEW_CONFIG" ] || echo "New configuration file(s) present"' \
64 chmod 755 install
/doinst.sh
72 echo Gzipping man pages
73 find .
-path '*/man?/*' \
( -name '*.?' -o -name '*.??' \
) \
74 \
! -name '*.Z' \
! -name '*.gz' \
! -name '*.bz2' \
81 if ! [ -s install
/slack-desc
]; then
82 echo 'Enter package name (single line):'
85 echo 'Enter description (^D to finish; max 9 lines)'
86 echo '----------------------------------------------------------------------|'
87 { echo "$TITLE"; echo; cat; } |
cat -s >mkpkg-desc
89 LINES
=$
(wc -l <mkpkg-desc
)
90 while [ $LINES -lt 11 ]; do
94 if [ $LINES -gt 11 ]; then
95 echo warning
: Description has
more then 11 lines
98 PKG
="${PWD##*/}"; PKG
="${PKG%-*-*-*}"
100 while IFS
= read LINE
; do
101 printf '%s: %s\n' "$PKG" "$LINE"
102 done <mkpkg-desc
>install
/slack-desc
110 makepkg
"$@" "$PWD.txz"