Subversion Repositories HomeAutomation

Rev

Rev 1784 | Rev 2000 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1784 Rev 1965
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
-
 
2
 
-
 
3
if [ $# -lt 1 ]
-
 
4
then
-
 
5
  echo "Error: need to run script with ubuntu releasename as argument"
-
 
6
  exit 1
-
 
7
fi
-
 
8
 
-
 
9
#exit 1
2
 
10
 
3
ATOMDIR=/tmp/atomppa
11
ATOMDIR=/tmp/atomppa
4
SVNURL=http://svn.arune.se/svn/HomeAutomation/trunk/PcSoftware/Atom1.5
12
SVNURL=http://svn.arune.se/svn/HomeAutomation/trunk/PcSoftware/Atom1.5
5
SVNURLCNF=http://svn.arune.se/svn/HomeAutomation/trunk/Configuration
13
SVNURLCNF=http://svn.arune.se/svn/HomeAutomation/trunk/Configuration
6
SVNDIR=AtomSvn
14
SVNDIR=AtomSvn
7
SVNDIRCNF=ConfigSvn
15
SVNDIRCNF=ConfigSvn
8
CNFDIR=Configuration
16
CNFDIR=Configuration
9
PPA=ppa:arune/auml-atom-daily
17
PPA=ppa:arune/auml-atom-daily
10
DEBUILDFLG="-S -sa -k7EA270B4"
18
DEBUILDFLG="-S -sa -k7EA270B4"
11
PKGNAME=atom
19
PKGNAME=atom
12
DIST=oneiric
-
 
13
PKGMAINT="Anders Runeson <runeson@gmail.com>"
20
PKGMAINT="Anders Runeson <runeson@gmail.com>"
14
 
21
 
-
 
22
# Dist name from command line argument
-
 
23
DIST=$1
15
RUNDIR=`dirname $0`
24
RUNDIR=`dirname $0`
16
CHLOGDATE=`date -R`
25
CHLOGDATE=`date -R`
17
REVFILE=$RUNDIR/AtomSvnRev
26
REVFILE=$RUNDIR/AtomSvnRev-$DIST
18
TMPFILE=/tmp/atompparunning
27
TMPFILE=/tmp/atompparunning
19
 
28
 
20
CURRREV=`svn info $SVNURL |grep '^Last Changed Rev:' | sed -e 's/^Last Changed Rev: //'`
29
CURRREV=`svn info $SVNURL |grep '^Last Changed Rev:' | sed -e 's/^Last Changed Rev: //'`
21
VERSION=1.5.$CURRREV
30
VERSION=1.5.${CURRREV}ppa1~${DIST}
-
 
31
# Dir name of atom svn export (no svn folders)
22
NOSVNDIR=atom-$VERSION
32
NOSVNDIR=atom-$VERSION
-
 
33
# File name to use for tarball with original source, NOSVNDIR will be compressed to this file
23
ORIGTAR=atom_$VERSION.orig.tar.gz
34
ORIGTAR=atom_$VERSION.orig.tar.gz
-
 
35
# File with source changes (?)
24
SRCCHFILE=atom_$VERSION\_source.changes
36
SRCCHFILE=atom_$VERSION\_source.changes
-
 
37
# Dput is called with these flags
25
DPUTFLG="auml-atom-daily $SRCCHFILE"
38
DPUTFLG="auml-atom-daily $SRCCHFILE"
-
 
39
 
-
 
40
case $DIST in
-
 
41
  oneiric)
-
 
42
    DEPS="libc6 (>= 2.3.6), libgcc1 (>= 1:4.1), libboost-thread1.46.1, libboost-system1.46.1, libboost-signals1.46.1, libboost-filesystem1.46.1, libboost-date-time1.46.1, libboost-program-options1.46.1, libv8-3.1.8.22"
-
 
43
    BDEPS="debhelper (>= 7.0.50~), cmake, libc6 (>= 2.3.6), libgcc1 (>= 1:4.1), libv8-dev (>= 2.2.18), libboost-date-time1.46-dev, libboost-filesystem1.46-dev, libboost-program-options1.46-dev, libboost-signals1.46-dev, libboost-thread1.46-dev, libreadline-dev, libx11-dev (>= 2:1.3), libmysqlclient-dev"
-
 
44
    ;;
-
 
45
  precise)
-
 
46
    DEPS="libc6 (>= 2.3.6), libgcc1 (>= 1:4.1), libboost-thread1.48.0, libboost-system1.48.0, libboost-signals1.48.0, libboost-filesystem1.48.0, libboost-date-time1.48.0, libboost-program-options1.48.0, libv8-3.7.12.22"
-
 
47
    BDEPS="debhelper (>= 7.0.50~), cmake, libc6 (>= 2.3.6), libgcc1 (>= 1:4.1), libv8-dev (>= 2.2.18), libboost-date-time1.48-dev, libboost-filesystem1.48-dev, libboost-program-options1.48-dev, libboost-signals1.48-dev, libboost-thread1.48-dev, libreadline-dev, libx11-dev (>= 2:1.3), libmysqlclient-dev"
-
 
48
    ;;
-
 
49
esac
26
 
50
 
27
# Run script from cron every hour
51
# Run script from cron every hour
28
# script will check revision of Atom in SVN and if there is a new version the script will
52
# script will check revision of Atom in SVN and if there is a new version the script will
29
# download it and create a complete debian source package and upload to launchpad as a ppa
53
# download it and create a complete debian source package and upload to launchpad as a ppa
30
 
54
 
31
# Newline and date in log
55
# Newline and date in log
32
echo ""
56
echo ""
33
date
57
date
34
 
58
 
35
# Run next line to force, even if no new svn revision
59
# Run next line to force, even if no new svn revision
36
#rm $REVFILE
60
#rm $REVFILE
37
 
61
 
38
# Check if script is already running
62
# Check if script is already running
39
if [ -e $TMPFILE ]; then
63
if [ -e $TMPFILE ]; then
40
  echo "Error: Already running?"
64
  echo "Error: Already running?"
41
  exit 1
65
  exit 1
42
fi
66
fi
43
 
67
 
44
# Check that revision variable is set
68
# Check that revision variable is set
45
if [ -z $CURRREV ]; then
69
if [ -z $CURRREV ]; then
46
  echo "Error: Could not find SVN revision"
70
  echo "Error: Could not find SVN revision"
47
  exit 1
71
  exit 1
48
fi
72
fi
49
 
73
 
50
# Check that revision is sane
74
# Check that revision is sane
51
if [ ! $CURRREV -gt 0 ]; then
75
if [ ! $CURRREV -gt 0 ]; then
52
  echo "Error: SVN revision is not greater than 0"
76
  echo "Error: SVN revision is not greater than 0"
53
  exit 1
77
  exit 1
54
fi
78
fi
55
 
79
 
56
# Set old revision, in case no file is found
80
# Set old revision, in case no file is found
57
OLDREV=$CURRREV
81
OLDREV=$CURRREV
58
if [ -e $REVFILE ]; then
82
if [ -e $REVFILE ]; then
59
  # If revision file exists, check current revision
83
  # If revision file exists, check current revision
60
  OLDREV=`cat $REVFILE`
84
  OLDREV=`cat $REVFILE`
Line 74... Line 98...
74
 
98
 
75
# Export atom to get rid of .svn subfolders
99
# Export atom to get rid of .svn subfolders
76
svn export $SVNURL $ATOMDIR/$NOSVNDIR
100
svn export $SVNURL $ATOMDIR/$NOSVNDIR
77
# Export configuration folder into the exported Atom-folder
101
# Export configuration folder into the exported Atom-folder
78
svn export $SVNURLCNF $ATOMDIR/$NOSVNDIR/$CNFDIR
102
svn export $SVNURLCNF $ATOMDIR/$NOSVNDIR/$CNFDIR
-
 
103
 
-
 
104
mkdir -p $ATOMDIR/$NOSVNDIR/debian
79
 
105
 
80
# Add a svn revision file, atom need the svn revision when building
106
# Add a svn revision file, atom need the svn revision when building
81
echo -n $CURRREV > $ATOMDIR/$NOSVNDIR/AtomSvnRev
107
echo -n $CURRREV > $ATOMDIR/$NOSVNDIR/AtomSvnRev
82
 
108
 
83
# Change install-target for data.xml file in CMakeList.txt, not needed, done in CMakeList.txt
109
# Change install-target for data.xml file in CMakeList.txt, not needed, done in CMakeList.txt
84
#cat $ATOMDIR/$NOSVNDIR/CMakeLists.txt | sed -e 's/\/..\/..\/Configuration\/data.xml/\/Configuration\/data.xml/' > $ATOMDIR/$NOSVNDIR/CMakeLists.txt
110
#cat $ATOMDIR/$NOSVNDIR/CMakeLists.txt | sed -e 's/\/..\/..\/Configuration\/data.xml/\/Configuration\/data.xml/' > $ATOMDIR/$NOSVNDIR/CMakeLists.txt
-
 
111
 
-
 
112
 
-
 
113
cp $RUNDIR/files/atom.conf $ATOMDIR/$NOSVNDIR/debian/
-
 
114
cp $RUNDIR/files/compat $ATOMDIR/$NOSVNDIR/debian/
-
 
115
cp $RUNDIR/files/copyright $ATOMDIR/$NOSVNDIR/debian/
-
 
116
cp $RUNDIR/files/rules $ATOMDIR/$NOSVNDIR/debian/
-
 
117
cp $RUNDIR/files/control $ATOMDIR/$NOSVNDIR/debian/
-
 
118
 
-
 
119
# Set the correct depends and build depends, different for different distributions
-
 
120
sed -i "s/^Build-Depends/Build-Depends: ${BDEPS}/g" $ATOMDIR/$NOSVNDIR/debian/control
-
 
121
sed -i "s/^Depends/Depends: ${DEPS}/g" $ATOMDIR/$NOSVNDIR/debian/control
85
 
122
 
86
# Create the debian changelog file from svn log
123
# Create the debian changelog file from svn log
87
echo "$PKGNAME ($VERSION) $DIST; urgency=low" > $ATOMDIR/$NOSVNDIR/debian/changelog
124
echo "$PKGNAME ($VERSION) $DIST; urgency=low" > $ATOMDIR/$NOSVNDIR/debian/changelog
88
echo "" >> $ATOMDIR/$NOSVNDIR/debian/changelog
125
echo "" >> $ATOMDIR/$NOSVNDIR/debian/changelog
89
OLDIFS="$IFS"
126
OLDIFS="$IFS"
Line 101... Line 138...
101
  let REVCNT=REVCNT-1
138
  let REVCNT=REVCNT-1
102
done
139
done
103
IFS="$OLDIFS"
140
IFS="$OLDIFS"
104
echo "" >> $ATOMDIR/$NOSVNDIR/debian/changelog
141
echo "" >> $ATOMDIR/$NOSVNDIR/debian/changelog
105
echo " -- $PKGMAINT  $CHLOGDATE" >> $ATOMDIR/$NOSVNDIR/debian/changelog
142
echo " -- $PKGMAINT  $CHLOGDATE" >> $ATOMDIR/$NOSVNDIR/debian/changelog
-
 
143
 
106
 
144
 
107
# Create orig tar gz
145
# Create orig tar gz
108
cd $ATOMDIR
146
cd $ATOMDIR
109
tar -zcf $ORIGTAR $NOSVNDIR
147
tar -zcf $ORIGTAR $NOSVNDIR
110
 
148