-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildpkg.sh
More file actions
executable file
·81 lines (62 loc) · 1.79 KB
/
buildpkg.sh
File metadata and controls
executable file
·81 lines (62 loc) · 1.79 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
PROJECT=$1
GITDIR=../..
LOGDIR=$GITDIR/../log
SRC=$GITDIR/../debian/source
DEBIAN=$HOME/debian
REPO=$DEBIAN/repo
STABLE=$REPO/dists/stable/non-free/binary-amd64
TESTING=$REPO/dists/testing/non-free/binary-amd64
UNSTABLE=$REPO/dists/unstable/non-free/binary-amd64
GIT="git -C $GITDIR"
mkdir -p $SRC $LOGDIR $STABLE $TESTING $UNSTABLE
[ ! -x /usr/local/bin/git ] && (echo "Debe instalar Git"; exit 1)
ISGIT=`$GIT rev-parse --is-inside-work-tree`
if [ "x$ISGIT" != "xtrue" ]; then
echo "Debe existir el repositorio"
exit 1
fi
log () {
echo "`date \"+%Y-%m-%d %H:%M:%S \"` $*" >> $LOGDIR/buildpkg.log
}
clean_source () {
rm -rf $SRC/*
}
extract () {
$GIT archive --format=tar --prefix=var/www/$PROJECT/ $1 \
| tar -C $SRC -xf -
}
control () {
mkdir -p $SRC/DEBIAN
VERSION=`$GIT describe | head -1 | awk -F '-' '{print $1}' | sed 's/^v//'`
cat - <<EOF > $SRC/DEBIAN/control
Package: $PROJECT
Version: $VERSION
Architecture: all
Depends: apache2, libapache2-mod-php5, php5-apcu, php5-gd, php5-json, php5-mcrypt, php5-mysql, php5-xsl, php-fpdf, libxml2
Maintainer: Alberto Mijares <amijares@mcs.com.ve>
Description: Inmobilia.com website
El Portal Inmobiliario de America Latina
Desarrollado por: strappinc.com
EOF
}
makedeb () {
dpkg-deb -b $SRC $STABLE
}
update_stable () {
dpkg-scanpackages $REPO | sed 's-/home/amijares/debian/repo/--' | gzip -9c > $STABLE/Packages.gz
}
debian_stable () {
log "Iniciando creacion de Paquete Debian"
clean_source || log "No pude limpiar"
log "Ya esta limpio"
extract "master" || log "No pude extraer"
log "Fuentes extraidas"
control || "No pude crear controles"
log "Control Creado"
makedeb || log "No pude construir"
log "Paquete creado"
update_stable
log "Repo actualizado"
}
debian_stable