-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-spec-files.sh
executable file
·42 lines (36 loc) · 1 KB
/
generate-spec-files.sh
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
#!/usr/bin/env bash
copy_spec_file ()
{
ofname="spec-files/${1}/pick.spec"
mkdir -p "$(dirname "$ofname")"
cp pick.spec.tmpl "$ofname"
sed -i -e "s/PICK_VERSION_TARBALL/v${1}.tar.gz/g" "$ofname"
sed -i -e "s/PICK_VERSION/$1/g" "$ofname"
chmod 644 "$ofname" # rpmlint likes spec files to be 644
}
#copy_spec_file_per_distro ()
#{
# # $1 distro - $2 distro ver - $3 pick ver
# fname="${1}-${2}-pick-v${3}.spec"
# ofname="spec-files/${fname}"
# cp pick.spec.tmpl "$ofname"
# sed -i -e "s/PICK_VERSION_TARBALL/v${3}.tar.gz/g" "$ofname"
# sed -i -e "s/PICK_VERSION/$3/g" "$ofname"
#}
main ()
{
for pick_version in 4.0.0 3.0.1; do
copy_spec_file $pick_version
done
#for pick_version in 4.0.0 3.0.1; do
# # Fedora RPMs
# for distro_version in 30 31 32; do
# copy_spec_file_per_distro fedora "$distro_version" "$pick_version"
# done
# # CentOS RPMs
# for distro_version in 8; do
# copy_spec_file_per_distro centos "$distro_version" "$pick_version"
# done
#done
}
main