Skip to content

Commit 4cd69bf

Browse files
committed
support for building from upstream branches
1 parent 80a9199 commit 4cd69bf

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

patches/linux_uio/make-pda-kadapter-dkms-rpm.sh

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
66

77

8-
# This is pda GIT tag from https://github.com/cbm-fles/pda
9-
GIT_TAG=11.8.7
8+
# This is pda GIT tag from upstream repository
9+
GIT_REPO=https://github.com/cbm-fles/pda
10+
GIT_TAG=11.9.7
11+
# This is the branch name to take from, if not using the tag. Leave blank to use tag.
12+
GIT_BRANCH=bug_sched_atomic
1013

1114
# This is the base name and version for this dkms package
1215
PKG_NAME=pda-kadapter-dkms
@@ -47,11 +50,14 @@ mkdir -p ${TMPDIR}/SOURCES ${TMPDIR}/SPECS ${TMPDIR}/BUILD ${TMPDIR}/RPMS ${TMPD
4750
# get source code from upstream
4851
echo "Generating source tarball ${TMPDIR}/SOURCES/${PKG_DIR}.src.tar.gz"
4952
cd ${WDIR}
50-
git clone https://github.com/cbm-fles/pda.git -c advice.detachedHead=false
53+
git clone ${GIT_REPO} -c advice.detachedHead=false
5154
cd pda
5255
git fetch
53-
#git checkout -b fix_sysfs_attr origin/fix_sysfs_attr
54-
git checkout tags/${GIT_TAG}
56+
if [ "$GIT_BRANCH" != "" ]; then
57+
git checkout -b ${GIT_BRANCH} origin/${GIT_BRANCH}
58+
else
59+
git checkout tags/${GIT_TAG}
60+
fi
5561
cd patches/linux_uio
5662

5763
# update source code with local files, if present
@@ -90,14 +96,14 @@ rm -f ${TMPDIR}/SPECS/${SPECFILE}
9096

9197
echo "%define version ${VERSION}" >> ${TMPDIR}/SPECS/${SPECFILE}
9298
echo "%define module ${PKG_NAME}" >> ${TMPDIR}/SPECS/${SPECFILE}
99+
echo "URL: ${GIT_REPO}" >> ${TMPDIR}/SPECS/${SPECFILE}
93100

94101
echo '
95102
Summary: PDA kernel adapter DKMS package
96103
Name: %{module}
97104
Version: %{version}
98105
Release: 0
99106
License: BSD
100-
URL: https://github.com/cbm-fles/pda/
101107
Packager: Sylvain Chapeland <[email protected]>
102108
Group: System Environment/Kernel
103109
BuildArch: noarch
@@ -107,8 +113,16 @@ Source0: %{module}-%{version}.src.tar.gz
107113
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root/
108114
109115
%description
110-
This package contains the PDA kernel adapter wrapped for the DKMS framework.
116+
This package contains the PDA kernel adapter wrapped for the DKMS framework.'\
117+
>> ${TMPDIR}/SPECS/${SPECFILE}
118+
119+
if [ "$GIT_BRANCH" != "" ]; then
120+
echo "Built from repository ${GIT_REPO} branch ${GIT_BRANCH}" >> ${TMPDIR}/SPECS/${SPECFILE}
121+
else
122+
echo "Built from repository ${GIT_REPO} tag ${GIT_TAG}" >> ${TMPDIR}/SPECS/${SPECFILE}
123+
fi
111124

125+
echo '
112126
%prep
113127
%setup
114128

0 commit comments

Comments
 (0)