#48227 rpm.mk doesn't build srpms for 389-ds and nunc-stans
Closed: Fixed None Opened 4 years ago by vashirov.

The problem is that the rpm.mk is broken in the master branch of 389.
When I attempt to run 'make -f rpm.mk srpms' from a completely clean
checkout, I get:

[sgallagh@sgallagh540:ds (master)]$ make -f rpm.mk srpms
rm -rf /dev/shm/ds/rpmbuild
mkdir -p /dev/shm/ds/rpmbuild/BUILD
mkdir -p /dev/shm/ds/rpmbuild/RPMS
mkdir -p /dev/shm/ds/rpmbuild/SOURCES
mkdir -p /dev/shm/ds/rpmbuild/SPECS
mkdir -p /dev/shm/ds/rpmbuild/SRPMS
mkdir -p dist/srpms
mkdir -p dist/389-ds-base-1.3.5.a1
rsync -a --exclude=dist --exclude=.git --exclude=rpmbuild . dist/389-ds
-base-1.3.5.a1
mkdir -p dist/sources
cd dist; tar cfj sources/389-ds-base-1.3.5.a1.tar.bz2 389-ds-base
-1.3.5.a1
rm -rf dist/389-ds-base-1.3.5.a1
cp dist/sources/389-ds-base-1.3.5.a1.tar.bz2
/dev/shm/ds/rpmbuild/SOURCES/
cp rpm/389-ds-base-* /dev/shm/ds/rpmbuild/SOURCES/
sed -e s/__VERSION__/1.3.5.a1/ -e
s/__RELEASE__/20150720122434.giteb3086d/ \
    rpm/389-ds-base.spec.in > /dev/shm/ds/rpmbuild/SPECS/389-ds
-base.spec
rpmbuild --define "_topdir /dev/shm/ds/rpmbuild" -bs
/dev/shm/ds/rpmbuild/SPECS/389-ds-base.spec
error: File /dev/shm/ds/rpmbuild/SOURCES/nunc-stans-0.1.5.tar.xz: No
such file or directory
rpm.mk:42: recipe for target 'srpms' failed
make: *** [srpms] Error 1

The same goes for nunc-stans srpms:

make -f rpm.mk srpms
rm -rf rpmbuild
mkdir -p rpmbuild/BUILD
mkdir -p rpmbuild/RPMS
mkdir -p rpmbuild/SOURCES
mkdir -p rpmbuild/SPECS
mkdir -p rpmbuild/SRPMS
mkdir -p dist/srpms
mkdir -p dist/nunc-stans-0.1.5
rsync -a --exclude=dist --exclude=.git --exclude=rpmbuild . dist/nunc-stans-0.1.5
mkdir -p dist/sources
cd dist; tar cfJ sources/nunc-stans-0.1.5.tar.xz nunc-stans-0.1.5
rm -rf dist/nunc-stans-0.1.5
cp dist/sources/nunc-stans-0.1.5.tar.xz rpmbuild/SOURCES/
rpmbuild --define "_topdir rpmbuild" --define "dist .0.1.5" -bs nunc-stans.spec
error: File rpmbuild/SOURCES/nunc-stans-0.1.2.tar.xz: No such file or directory
rpm.mk:39: recipe for target 'srpms' failed
make: *** [srpms] Error 1

This is needed for coverity scans.


389-ds-base:
{{{
$ make -f rpm.mk srpms
.....
cd dist; tar cfj sources/389-ds-base-1.3.5.a1.tar.bz2 389-ds-base-1.3.5.a1
rm -rf dist/389-ds-base-1.3.5.a1
cd dist/sources; wget http://git.fedorahosted.org/cgit/nunc-stans.git/snapshot/nunc-stans-egrep "%global nunc_stans_ver" /export/src/ds/ldapserver/ldapserver/rpm/389-ds-base.spec.in | sed -e "s/%global nunc_stans_ver //".tar.xz
--2015-07-20 16:52:11-- http://git.fedorahosted.org/cgit/nunc-stans.git/snapshot/nunc-stans-0.1.5.tar.xz
Resolving git.fedorahosted.org (git.fedorahosted.org)... 140.211.169.199
Connecting to git.fedorahosted.org (git.fedorahosted.org)|140.211.169.199|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://git.fedorahosted.org/cgit/nunc-stans.git/snapshot/nunc-stans-0.1.5.tar.xz [following]
--2015-07-20 16:52:11-- https://git.fedorahosted.org/cgit/nunc-stans.git/snapshot/nunc-stans-0.1.5.tar.xz
Connecting to git.fedorahosted.org (git.fedorahosted.org)|140.211.169.199|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 365280 (357K) [application/x-xz]
Saving to: ‘nunc-stans-0.1.5.tar.xz.1’

nunc-stans-0.1.5.tar.xz.1 100%[=======================================================>] 356.72K 2.00MB/s in 0.2s

2015-07-20 16:52:13 (2.00 MB/s) - ‘nunc-stans-0.1.5.tar.xz.1’ saved [365280/365280]

cp dist/sources/389-ds-base-1.3.5.a1.tar.bz2 /export/src/ds/ldapserver/ldapserver/rpmbuild/SOURCES/
cp dist/sources/nunc-stans-egrep "%global nunc_stans_ver" /export/src/ds/ldapserver/ldapserver/rpm/389-ds-base.spec.in | sed -e "s/%global nunc_stans_ver //".tar.xz /export/src/ds/ldapserver/ldapserver/rpmbuild/SOURCES/
cp rpm/389-ds-base- /export/src/ds/ldapserver/ldapserver/rpmbuild/SOURCES/
sed -e s/VERSION/1.3.5.a1/ -e s/RELEASE/20150720235213.gitd010022/ \
rpm/389-ds-base.spec.in > /export/src/ds/ldapserver/ldapserver/rpmbuild/SPECS/389-ds-base.spec
rpmbuild --define "_topdir /export/src/ds/ldapserver/ldapserver/rpmbuild" -bs /export/src/ds/ldapserver/ldapserver/rpmbuild/SPECS/389-ds-base.spec
Wrote: /export/src/ds/ldapserver/ldapserver/rpmbuild/SRPMS/389-ds-base-1.3.5.a1-20150720235213.gitd010022.fc20.src.rpm
cp /export/src/ds/ldapserver/ldapserver/rpmbuild/SRPMS/389-ds-base-1.3.5.a1-
.src.rpm dist/srpms/
}}}
nunc-stans:
{{{
$ make -f rpm.mk srpms
mkdir -p dist/nunc-stans-0.1.5
rsync -a --exclude=dist --exclude=.git --exclude=rpmbuild . dist/nunc-stans-0.1.5
mkdir -p dist/sources
cd dist; tar cfJ sources/nunc-stans-0.1.5.tar.xz nunc-stans-0.1.5
rm -rf dist/nunc-stans-0.1.5
cp dist/sources/nunc-stans-0.1.5.tar.xz rpmbuild/SOURCES/
rpmbuild --define "_topdir rpmbuild" --define "dist .0.1.5.1.g57fe66a" -bs nunc-stans.spec
Wrote: rpmbuild/SRPMS/nunc-stans-0.1.5-1.0.1.5.1.g57fe66a.src.rpm
cp rpmbuild/SRPMS/nunc-stans-0.1.5-*.src.rpm dist/srpms/
}}}

I would use https instead of http for download link as in spec file.

git patch file (master) -- 389-ds-base -- revised based upon the review by vashirov (Thank you, Viktor!)
0001-Ticket-48227-rpm.mk-doesn-t-build-srpms-for-389-ds-b.patch

Replying to [comment:4 vashirov]:

I would use https instead of http for download link as in spec file.

Thank you, Viktor! Replaced http with https...

It's "stans" not "stance"

Try this:
{{{
NUNC_STANS_URL=rpmspec -P -D 'use_nunc_stans 1' $(PWD)/rpm/389-ds-base.spec.in | awk '/^Source3:/ {print $2}'
NUNC_STANS_TARBALL=basename "$url"
...
cd dist/sources; wget "$NUNC_STANS_URL"
...
cp dist/sources/$(NUNC_STANS_TARBALL) $(RPMBUILD)/SOURCES/
}}}

Replying to [comment:7 rmeggins]:

It's "stans" not "stance"

Try this:
...

Oops. Thanks, Rich.

Unfortunately, make has some limitations.
{{{
1) make thinks $ is for the make variables. $2 in awk does not work for our purpose.
I could not find any way to escape it...
2) If we have these lines,
VAR1 = command1
VAR2 = command2 ${VAR1}
These VAR1 and VAR2 are evaluated every time instead of using the evaluated result.
That is, VAR2 ends up doing this and it fails... :(
VAR2 = command2command1``
}}}

0001-Ticket-48227-rpm.mk-doesn-t-build-srpms-for-389-ds-a.patch
0001-Ticket-48227-rpm.mk-doesn-t-build-srpms-for-389-ds-a.patch

To ssh://git.fedorahosted.org/git/389/ds.git
2a8a8c8..684f8c5 master -> master

Rich, could you please push this patch, too?

0001-Ticket-48227-rpm.mk-doesn-t-build-srpms-for-nunc-sta.patch​ (757 bytes)
git patch file (master) -- nunc-stans

It looks I have no right to push it...

error: insufficient permission for adding an object to repository database ./objects
error: failed to push some refs to 'ssh://git.fedorahosted.org/git/nunc-stans.git'

Thanks!

Replying to [comment:11 nhosoi]:

Rich, could you please push this patch, too?

0001-Ticket-48227-rpm.mk-doesn-t-build-srpms-for-nunc-sta.patch​ (757 bytes)
git patch file (master) -- nunc-stans

It looks I have no right to push it...

error: insufficient permission for adding an object to repository database ./objects
error: failed to push some refs to 'ssh://git.fedorahosted.org/git/nunc-stans.git'

Thanks!

To ssh://git.fedorahosted.org/git/nunc-stans.git
57582de..74387ee master -> master

building srpms also fails on 1.3.4 branch, replacing rpm.mk from master resolved it, could you commit for 1.3.4 as well

To ssh://git.fedorahosted.org/git/389/ds.git
cc7229e..46c4052 389-ds-base-1.3.4 -> 389-ds-base-1.3.4

Metadata Update from @rmeggins:
- Issue assigned to rmeggins
- Issue set to the milestone: 1.3.4.2

3 years ago

Login to comment on this ticket.

Metadata