-
-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathcreate_orig
executable file
·35 lines (33 loc) · 1001 Bytes
/
create_orig
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
#!/bin/bash
dirname=${PWD##*/}
if ! [[ "$dirname" =~ ^lazpaint-[0-9]+(\.[0-9]+)*$ ]]; then
echo "Parent folder name must be \"lazpaint-#[.#][.#]\" but is \"$dirname\" instead"
echo "where #[.#][.#] is the app version number"
exit 1
fi
if ! [ -d bgrabitmap ] || ! [ -d bgracontrols ]; then
echo "Cannot find bgrabitmap or bgracontrols subdirectories."
exit 1
fi
if [ -d bgrabitmap/test ] || [ -d lazpaint/release/windows ]; then
echo "Lazarus custom packages have not been pruned. Call ./prune_lpk first"
exit 1
fi
archive=${dirname/-/_}.orig.tar.gz
read -p "Create \"../${archive}\" file (y/n)?" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
make distclean
cd ..
tar --exclude=./${dirname}/debian --exclude-vcs -zcvf ${archive} ./${dirname}
cd "$dirname"
echo "Done creating ../${archive}"
echo
read -p "Launch \"debuild -us -uc\" on the package now (y/n)?" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
debuild -us -uc
fi
fi