summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 92a03ce048ca2b6d1431233337e1ed401689d9dd (plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

SUBDIRS = @SUBDIR_S@
PKGDIR = @PKG_DIR@
SOURCEDIR = $(PKGDIR)/SOURCES
BUILDDIR = $(PKGDIR)/BUILD
RSPEC = doc/$(PACKAGE).spec
PNAME  = $(PACKAGE)-$(VERSION)
TARDIR = /tmp/iu
TMPDIR = $(TARDIR)/$(PNAME)
BDIR = $(TMPDIR)-1-root
RPMB = rpmbuild
# $(RPMB) -bb --buildroot $(BDIR) $(RSPEC)

# Note: put files here, until lib/Makefile.am supports
# pkg-config support rules
# if WITH_PKG_CONFIG
 # pkgconfig_DATA = lib/libipmiutil.pc
# endif

rpm:	$(RSPEC)
	make tarball
	mkdir -p $(SOURCEDIR)
	cp -f $(TARDIR)/$(PNAME).tar.gz $(SOURCEDIR)
	$(RPMB) -bb  $(RSPEC)
	$(RPMB) -bs  $(RSPEC)

tarball:
	rm -f $(TMPDIR)/../$(PNAME).tar.gz 
	rm -rf $(TMPDIR)
	mkdir -p $(TMPDIR)
	find . -print | cpio -pdumv $(TMPDIR)
	rm -f $(TMPDIR)/lib/libipmiapi*.a* 
	cd $(TMPDIR)/test; make clean; cd ..
	cd $(TMPDIR)/hpiutil; make clean; cd ..
	cd $(TMPDIR); make distclean
	cd $(TMPDIR); rm -rf autom4te.cache
	cd $(TMPDIR); rm -f  util/events
	cd $(TMPDIR); sed -i 's/\r//' ChangeLog AUTHORS COPYING NEWS README TODO doc/UserGuide
	cd $(TMPDIR); chmod 644 doc/UserGuide
	cd $(TMPDIR); find . -name '*.orig' -delete
	cd $(TMPDIR); find . -name '*.rej' -delete
	cd $(TMPDIR); cd ..; tar -czvf $(TARDIR)/$(PNAME).tar.gz $(PNAME)
	ls $(TARDIR)/*.gz
	rm -rf $(TMPDIR)
# chown -R root:root $(TMPDIR)

tarsol:        util/ipmiutil
	rm -f /tmp/$(PNAME)-solaris.tar
	rm -rf $(TMPDIR)
	mkdir -p $(TMPDIR)
	cd util; cp ipmiutil idiscover ievents ipmi_port $(TMPDIR)
	cd doc; cp UserGuide *.8 *.mib  $(TMPDIR)
	cd scripts; cp checksel ipmiutil_??? *.sh $(TMPDIR)
	cd $(TMPDIR); mv install-solaris.sh install.sh
	cd $(TMPDIR); tar cvf /tmp/$(PNAME)-solaris.tar .
	rm -rf $(TMPDIR)

tarbsd:        util/ipmiutil
	rm -f /tmp/$(PNAME)-bsd.tar
	rm -rf $(TMPDIR)
	mkdir -p $(TMPDIR)
	cd util; cp ipmiutil idiscover ievents ipmi_port $(TMPDIR)
	cd doc; cp UserGuide *.8 *.mib  $(TMPDIR)
	cd scripts; cp checksel ipmiutil_??? *.sh $(TMPDIR)
	cd $(TMPDIR); mv install-solaris.sh install.sh
	cd $(TMPDIR); tar -cvf /tmp/$(PNAME)-bsd.tar .
	rm -rf $(TMPDIR)

clean-generic:
	rm -f *.log *.tmp debug*.list