source: npl/importpackage @ 85c2873

Last change on this file since 85c2873 was ca72aba, checked in by Edwin Eefting <edwin@datux.nl>, 6 years ago

fixes/permissions

  • Property mode set to 100755
File size: 1.9 KB
Line 
1#!/bin/bash
2
3set -e
4
5CAT="$1"
6NAME="$2"
7URL="$3"
8
9if ! [ "$URL" ]; then
10        echo "Usage:"
11        echo " $0 <category> <name> <url>";
12        echo " Imports slackware package from specified slackware source url"
13        echo "Example:"
14        echo " $0 system gmp 'http://mirrors.slackware.com/slackware/slackware-current/source/l/gmp/'"
15        exit 1
16fi
17
18mkdir -p $CAT/$NAME
19pushd $CAT/$NAME >/dev/null
20
21#download and strip
22DIRS=`echo "$URL"|sed 's@.*//[^/]*@@'|sed 's@/@\n@g'|wc -l`
23(( DIRS=DIRS-2 ))
24
25
26wget  --no-host-directories --cut-dirs=$DIRS --no-parent -e robots=off --reject '*md5' --reject 'index.html*' --reject '*sha1' --reject '*sha256' --reject '*meta4' --reject '*mirrorlist' --mirror "$URL"/
27#find -name 'index.html*' -exec rm "{}" \;
28#find -name '*md5' -exec rm "{}" \;
29#find -name '*sha1' -exec rm "{}" \;
30#f#ind -name '*sha256' -exec rm "{}" \;
31#f#ind -name '*meta4' -exec rm "{}" \;
32#find -name '*mirrorlist' -exec rm "{}" \;
33
34#create syn3 slackbuild wrapper
35for SB in *.SlackBuild; do
36
37echo "Adding SYN-3 packaging to $SB ..."
38
39mv $SB $SB.orig
40
41SB_CLEAN=`echo $SB | sed 's/-/_/g'`
42
43#header with metainfo
44cat >> $SB_CLEAN <<-EOF
45        #!/bin/bash
46        #
47        # Automaticly created by importpackage v1.0
48        # Imported from: $URL
49        # Created at `date`
50       
51       
52        ########### source original slackbuild (hopefully we dont need to modify it)
53        CWD=\`pwd\`
54        set -e
55        source ./$SB.orig
56       
57EOF
58
59#actual script stuff (quoted)
60cat >> $SB_CLEAN <<-"EOF"
61       
62        ############ make syn3 packages
63        cd $CWD
64        for PKG in /tmp/package-*; do
65                NAME=`echo $PKG| sed 's/.*package-//'| sed 's/-/_/g'`
66       
67                #seperate dev-package
68                syn3_move_dev $PKG $PKG""_dev
69                syn3_makepkg $PKG""_dev $NAME""_dev $VERSION $ARCH || exit 1
70       
71                #make main package
72                syn3_makepkg $PKG $NAME $VERSION $ARCH || exit 1
73        done
74EOF
75
76chmod +x $SB_CLEAN $SB.orig
77
78done
79
80echo "Building package..."
81popd >/dev/null
82rm -rf .tmp
83./rebuildcheck $NAME '' nopkgcheck
84
85
Note: See TracBrowser for help on using the repository browser.