1
0
mirror of https://github.com/QSCTech/zjunet.git synced 2026-01-22 19:54:48 +08:00
zjunet/build/debian/build.sh

54 lines
1.0 KiB
Bash
Raw Normal View History

2014-09-30 16:08:55 +08:00
#!/bin/sh
2014-09-30 20:34:58 +08:00
rm -rf *.deb
VERSION=$1
2015-02-08 20:03:37 +08:00
# share
mkdir -p ./debian/usr/share/zjunet
cp ../../miscellaneous/* ./debian/usr/share/zjunet
cp ../../VERSION ./debian/usr/share/zjunet
2015-02-08 20:03:37 +08:00
2014-09-30 16:56:52 +08:00
# lib
mkdir -p ./debian/usr/lib/zjunet
cp ../../lib/*.sh ./debian/usr/lib/zjunet
2014-09-30 16:56:52 +08:00
2014-09-30 16:08:55 +08:00
# bin
mkdir -p ./debian/usr/bin
echo '/usr/lib/zjunet/zjunet.sh "$@"' >> ./debian/usr/bin/zjunet
chmod +x ./debian/usr/bin/zjunet
2015-02-08 20:03:37 +08:00
# postinst
mkdir -p debian/DEBIAN
cat > debian/DEBIAN/postinst <<EOF
#!/bin/sh
2015-02-08 22:35:28 +08:00
/usr/share/zjunet/zjunet-postinst
2015-02-08 20:03:37 +08:00
EOF
chmod 755 debian/DEBIAN/postinst
2014-09-30 16:08:55 +08:00
# contorl file
mkdir -p debian/DEBIAN
2014-09-30 20:34:58 +08:00
cat > debian/DEBIAN/control <<EOF
Package: zjunet
Version: $VERSION
Section: net
Priority: optional
Architecture: all
2014-10-13 21:21:43 +08:00
Depends: xl2tpd (>= 1.3.1), curl
2014-09-30 20:34:58 +08:00
Maintainer: Zeno Zeng <zenoofzeng@gmail.com>
Description: Command Line Scripts for ZJU
This script provides a VPN / WLAN / NEXTHOP for ZJUer.
EOF
2014-09-30 16:08:55 +08:00
# dpkg-deb
2014-09-30 20:34:58 +08:00
find ./debian -type d | xargs chmod 755
fakeroot dpkg-deb --build debian
2014-09-30 20:34:58 +08:00
mv debian.deb zjunet_${VERSION}_all.deb
2014-09-30 16:08:55 +08:00
# remove debian/
rm -rf ./debian
2015-02-08 23:01:01 +08:00
rm -rf control