Skip to content

Commit 27792e1

Browse files
committed
ndctl: rpm spec file fixes for koji
1/ Update genspec to place the commit id directly in the spec file rather than running git live to retrieve the current HEAD. 2/ Update BuildRequires With these updates koji can successfully build ndctl. http://koji.fedoraproject.org/koji/taskinfo?taskID=10479814 Signed-off-by: Dan Williams <[email protected]>
1 parent 791e213 commit 27792e1

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

contrib/Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ OBJS=$(SRCS:.c=.o)
66
PROG=genspec
77
SPEC_IN=ndctl.spec.in
88
SPEC=$(SPEC_IN:.in=)
9+
COMMIT_ID=git log --pretty=format:"%h" -n 1
910

1011
all: $(SPEC)
1112

1213
$(SPEC) : $(SPEC_IN) $(PROG)
13-
cat $(SPEC_IN) | $(dir $(PROG))$(PROG) > $@
14+
cat $(SPEC_IN) | $(dir $(PROG))$(PROG) `$(COMMIT_ID)` > $@
1415

1516
$(PROG) : $(OBJS)
1617
$(CC) $(LDFLAGS) $(OBJS) -o $@

contrib/genspec.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
#include <string.h>
33
#include "../config.h"
44

5-
int main(void)
5+
int main(int argc, char **argv)
66
{
77
char buf[1024];
88

9+
if (argc != 2) {
10+
fprintf(stderr, "commit id must be specified\n");
11+
return 1;
12+
}
13+
914
while (fgets(buf, sizeof(buf), stdin))
1015
if (strncmp("Version:", buf, 8) == 0)
1116
fprintf(stdout, "Version: %s\n", VERSION);
17+
else if (strncmp("%global gitcommit", buf, 17) == 0)
18+
fprintf(stdout, "%%global gitcommit %s\n", argv[1]);
1219
else
1320
fprintf(stdout, "%s", buf);
1421

contrib/ndctl.spec.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%global gitcommit %(git log --pretty=format:"%h" -n 1)
1+
%global gitcommit
22

33
# (hack stolen from systemd.spec)
44
# We ship a .pc file but don't want to have a dep on pkg-config. We
@@ -23,6 +23,9 @@ Source0: https://github.com/pmem/ndctl/archive/%{name}-%{version}.tar.gz
2323
BuildRequires: libtool
2424
BuildRequires: autoconf
2525
BuildRequires: automake
26+
BuildRequires: systemd-devel
27+
BuildRequires: libuuid-devel
28+
BuildRequires: kmod-devel
2629

2730
%description
2831
Utility library for managing the "libnvdimm" subsystem. The "libnvdimm"

0 commit comments

Comments
 (0)