summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: d8eb90ac138e582f890e2504889bbee131c3635b (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
PACKAGE_NAME = sssd
PACKAGE_VERSION = 0.1.0
TARGET ?= master
SUBDIRS = server replace sss_client
TARBALL_PREFIX = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
TARBALL = $(TARBALL_PREFIX).tar.gz
LIBDIR ?= /usr/lib
RPMBUILD ?= $(PWD)/rpmbuild
DOC = BUILD.txt COPYING

all:

clean:
	rm -Rf dist
	rm -Rf $(RPMBUILD)

realdistclean: clean
	-make -C server realdistclean

archive:
	-mkdir -p dist/$(TARBALL_PREFIX)
	git archive --format=tar --prefix=sssd/ $(TARGET) | (cd dist && tar xf -)
	@for subdir in $(SUBDIRS); do \
	    cp -pr dist/sssd/$$subdir dist/$(TARBALL_PREFIX)/.; \
	done

local-archive: realdistclean
	-mkdir -p dist/$(TARBALL_PREFIX)
	@for subdir in $(SUBDIRS); do \
	    cp -pr $$subdir dist/$(TARBALL_PREFIX)/.; \
	done
	cp -p $(DOC) dist/$(TARBALL_PREFIX)/.

tarballs: local-archive
	-mkdir -p dist/sources
	rm -f dist/sources/$(TARBALL)
	cd dist/$(TARBALL_PREFIX)/server; ./autogen.sh
	cd dist; tar cfz sources/$(TARBALL) $(TARBALL_PREFIX)


rpmroot:
	mkdir -p $(RPMBUILD)/BUILD
	mkdir -p $(RPMBUILD)/RPMS
	mkdir -p $(RPMBUILD)/SOURCES
	mkdir -p $(RPMBUILD)/SPECS
	mkdir -p $(RPMBUILD)/SRPMS

rpmdistdir:
	mkdir -p dist/rpms
	mkdir -p dist/srpms

rpms: tarballs rpmroot rpmdistdir
	cp sssd.spec $(RPMBUILD)/SPECS
	cp dist/sources/$(TARBALL) $(RPMBUILD)/SOURCES
	cd $(RPMBUILD); rpmbuild --define "_topdir $(RPMBUILD)" -ba SPECS/sssd.spec