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 Permalink Normal View History

2014-09-30 16:08:55 +08:00
#!/bin/sh
2019-06-04 15:44:12 +08:00
set -e
2014-09-30 16:08:55 +08:00
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
2016-05-17 09:15:20 +08:00
install -m 755 -d ./debian/usr/bin
install -m 755 ../../bin/zjunet ./debian/usr/bin/zjunet
2014-09-30 16:08:55 +08:00
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
2020-11-12 19:46:10 +08:00
Depends: xl2tpd (>= 1.3.7), curl, dnsutils
Maintainer: Azuk 443 <me@azuk.top>
Description: Command Line Scripts for ZJU Campus Network
2014-09-30 20:34:58 +08:00
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