My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/bin/bash

MAINTAINER="Jan Dolinar"
EMAIL="dolik.rce@seznam.cz"
SRC_PATH=$1
DEST_PATH=$2
PKG=$3

#determine architecture (i386 or amd64 or lpia)
arch="`dpkg-architecture -qDEB_HOST_ARCH`"

#check if the destination exists
if [ ! -d $DEST_PATH ]
then
echo "ERROR - Invalid destination path '$DEST_PATH'"
echo "Please modify current script to fit your destination path"
exit 1
fi

#create a temporary folder to ease the cleaning after building
outtmp="`mktemp -t -d builddeb.XXXXXXX`"

#preparing the deb
echo "Building package '$PKG' from folder '$SRC_PATH'"
echo "Destination path of package is '$DEST_PATH'"

#create directories
tmp=$outtmp/deb
mkdir -p $tmp/usr/share/doc/$PKG

if [ $PKG = "upp" ]
then
# create necessary directories
mkdir -p $tmp/usr/share/$PKG

# copy source files to tmp folder
# (copying is done by rsync, because it allows to exclude svn and also
# to change permissions on the files)
subfolders=( uppsrc examples tutorial reference bazaar )
echo "copying sources:"
for folder in ${subfolders[@]}
do
echo " $folder"
cp -r $SRC_PATH/$folder $tmp/usr/share/$PKG
done
elif [ $PKG = "umk" ]
then
#create necessary directories
mkdir -p $tmp/usr/bin

# move umk executable into the package directory structure
mv $SRC_PATH/debian/umk $tmp/usr/bin/umk

# check if we really have the executable there, just in case
if [ ! -e $tmp/usr/bin/umk ]
then
echo "Something went wrong: the executable is not in its place!"
exit 1
fi

# generate dependencies
cd $SRC_PATH
dpkg-shlibdeps $tmp/usr/bin/umk

# strip symbols from executable
strip --strip-all --remove-section=.comment --remove-section=.note $tmp/usr/bin/umk
else
#create necessary directories
mkdir -p $tmp/usr/bin
mkdir -p $tmp/usr/share/{pixmaps,applications}
mkdir -p $tmp/usr/share/man/man1

if [ $PKG = "theide" ]
then
# move theide executable into the package directory structure
mv $SRC_PATH/debian/ide $tmp/usr/bin/theide
elif [ $PKG = "theide-nogtk" ]
then
# move theide-nogtk executable into the package directory structure
mv $SRC_PATH/debian/ide-nogtk $tmp/usr/bin/theide
fi

# check if we really have the executable there, just in case
if [ ! -e $tmp/usr/bin/theide ]
then
echo "Something went wrong: the executable is not in its place!"
exit 1
fi

# copy icon file
cp $SRC_PATH/uppsrc/ide/theide-48.png $tmp/usr/share/pixmaps/theide.png

# copy launcher
cp $SRC_PATH/debian/theide.desktop $tmp/usr/share/applications

# install manual page
cat $SRC_PATH/debian/theide.1 |gzip -9 > $tmp/usr/share/man/man1/theide.1.gz

# generate dependencies
cd $SRC_PATH
dpkg-shlibdeps $tmp/usr/bin/theide

# strip symbols from executable
strip --strip-all --remove-section=.comment --remove-section=.note $tmp/usr/bin/theide
fi

#install changelogs
cat $SRC_PATH/changelog |gzip -9 > $tmp/usr/share/doc/$PKG/changelog.gz
cat $SRC_PATH/debian/changelog |gzip -9 > $tmp/usr/share/doc/$PKG/changelog.Debian.gz

# copy copyright file
cp $SRC_PATH/debian/copyright $tmp/usr/share/doc/$PKG

#create md5sums file
cd $tmp
mkdir $tmp/DEBIAN
find ./ -type f -exec md5sum {} \; | sed s/.[/]// >> $outtmp/md5sums
mv $outtmp/md5sums $tmp/DEBIAN/md5sums

# create control file
cd $SRC_PATH
dpkg-gencontrol -P$tmp -p$PKG

# set permissions and owners
cd $tmp
find ./ -type d -exec chmod 755 {} \; , -type f -exec chmod 644 {} \;
chown -R root:root ./

if [ $PKG = "umk" ]
then
# set permissions for executable files
chmod 0755 $tmp/usr/bin/umk
elif [ $PKG = "upp" ]
then
# copy maintainer scripts
cp $SRC_PATH/debian/{postinst,prerm} $tmp/DEBIAN
# set permissions for executable files
chmod 0755 $tmp/DEBIAN/{postinst,prerm}
else
# copy maintainer scripts
cp $SRC_PATH/debian/{postinst,prerm} $tmp/DEBIAN
# set permissions for executable files
chmod 0755 $tmp/DEBIAN/{postinst,prerm} $tmp/usr/bin/theide
fi

# create .deb package
dpkg-deb -b $tmp $DEST_PATH

# delete tmp directory
rm -r $outtmp

echo "FINISHED!"

Change log

r4363 by dolik on Jan 5, 2012   Diff
lpbuild: added umk package
Go to: 
Project members, sign in to write a code review

Older revisions

r2391 by dolik on May 13, 2010   Diff
.lpbuild: fixed unclean removal of upp
package
r2346 by dolik on Apr 29, 2010   Diff
lpbuild: Packages splitted to upp,
theide and theide-nogtk
r2311 by dolik on Apr 7, 2010   Diff
*lpbuild: Non-native dsc, gcc4.2
forbidden in dependencies
All revisions of this file

File info

Size: 3955 bytes, 152 lines
Powered by Google Project Hosting