-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added build_deb.sh which till build Debian packages.
- Loading branch information
1 parent
3b5b1b4
commit fc1ac4b
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# | ||
# This script is used to build Debian packages for Cligen. | ||
# | ||
|
||
VERSION=$(./version.sh) | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to determine the version of Cligen." | ||
exit 1 | ||
fi | ||
|
||
# Create the build/ directory | ||
if [ ! -d build ]; then | ||
mkdir build | ||
fi | ||
|
||
# Copy the debian/ directory to the build/ directory | ||
if [ ! -d build/debian ]; then | ||
cp -r debian build/ | ||
fi | ||
|
||
# Update the change log | ||
echo -n "cligen (${VERSION}) " > build/debian/changelog | ||
|
||
git --no-pager log --no-walk --encoding=utf-8 --expand-tabs=4 --pretty=format:"${VERSION} stable; urgency=medium%n%n * %w(,,2)%B%w()%n -- %an <%ae> %aD%n" >> build/debian/changelog | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to update the change log." | ||
exit 1 | ||
fi | ||
|
||
# Build Cligen and install it to the build/ directory | ||
./configure && make clean && make && make install DESTDIR=build/ | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to build Cligen." | ||
exit 1 | ||
fi | ||
|
||
# Build the package | ||
(cd build && dpkg-buildpackage -us -uc) | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Failed to build the package." | ||
exit 1 | ||
fi |