forked from Eugeny/ajenti-v
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deb.sh
executable file
·38 lines (30 loc) · 817 Bytes
/
deb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
PLUGIN=$1
. $PLUGIN/package.desc
BUILDDIR=build
DISTDIR=dist
PLUGINDIR=/var/lib/ajenti/plugins
DEBIANDIR=$BUILDDIR/DEBIAN
echo Building package $PACKAGE
rm -rf $BUILDDIR > /dev/null
mkdir $DISTDIR $BUILDDIR $DEBIANDIR 2> /dev/null
cat > $DEBIANDIR/control <<END
Source: $PACKAGE
Section: admin
Priority: optional
Maintainer: Eugene Pankov <e@ajenti.org>
Package: $PACKAGE
Version: $VERSION
Architecture: all
Homepage: http://ajenti.org/
Depends: $DEB_DEPENDS
Provides: $PROVIDES
Description: $DESCRIPTION
END
echo "#!/bin/bash" > $DEBIANDIR/postinst
echo "$POSTINST" >> $DEBIANDIR/postinst
chmod 755 $DEBIANDIR/postinst
mkdir -p $BUILDDIR/$PLUGINDIR/$PLUGIN
cp -r $PLUGIN/* $BUILDDIR/$PLUGINDIR/$PLUGIN
find $BUILDDIR -name '*.pyc' -delete
dpkg-deb -b $BUILDDIR $DISTDIR/"$PACKAGE"_"$VERSION".deb