Update and clean Tomato RAF files
[tomato.git] / release / src / router / pptpd / makepackage
blob7430ada91a985145335db7eeaaf6a55f0d9d8236
1 #!/bin/bash
2 # given source tree build .tar.gz and package for distribution on this host
4 os=$(uname)
5 if [ -f /etc/redhat-release ]; then
6 DISTRO="RedHat"
7 DVER=$(cat /etc/redhat-release | cut -d " " -f5-)
8 elif [ -f /etc/SuSE-release ]; then
9 DISTRO="SuSE"
10 DVER=$(cat /etc/SuSE-release | head -n1 | cut -d " " -f3)
11 elif [ -f /etc/debian_version ]; then
12 DISTRO="Debian"
13 DVER=$(cat /etc/debian_version)
14 else
15 DISTRO=$os
18 version=$(./version)
20 if [ "$DISTRO" == "RedHat" ]; then
21 mkdir -p /tmp/pptpd-$version
22 cp -ar * /tmp/pptpd-$version/
23 cd /tmp
24 tar -czf /usr/src/redhat/SOURCES/pptpd-$version.tar.gz pptpd-$version
25 cd -
26 rpmbuild -ba pptpd.spec
27 elif [ "$DISTRO" == "Debian" ]; then
28 DPKG_BP=`which dpkg-buildpackage 2>/dev/null`
29 if [ -z "$DPKG_BP" ]; then
30 echo "dpkg-buildpackage not installed. Do: apt-get install dpkg-dev"
31 exit 1
33 $DPKG_BP -rfakeroot
34 else
35 echo "No packagebuilder implemented yet."