aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.am
blob: 03fe1ae7336854d123f2891333bd935b22a90987 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# $Id$

TAG := $(shell echo "V$(PACKAGE_VERSION)" | tr -- '-.' '__')

macrosfiles = $(RPMALLARCH:=.macros)

pkg_data = \
		   rpmpopt

pkg_gdata = \
		   rpmrc \
		   macros

pkg_data_in = $(pkg_gdata:=.in)

pkg_scripts = \
		   brp-compress \
	       brp-strip \
	       brp-strip-comment-note \
		   brp-strip-static-archive \
           filter.sh \
	       find-lang.sh \
	       find-debuginfo.sh \
		   http.req \
		   magic.prov \
		   magic.req \
		   perl.prov \
		   perl.req \
		   php.prov \
		   php.req

pkg_gscripts = \
		   find-provides \
		   find-requires \
		   find-provides.perl
pkg_scripts_in = $(pkg_gscripts:=.in)

BUILT_SOURCES = macros-perarch make_macrosfiles.sh

pkglibdir = @RPMVENDORDIR@

pkglib_DATA = \
	$(pkg_data) \
	$(pkg_gdata)

pkglib_SCRIPTS = \
	$(pkg_scripts) \
	$(pkg_gscripts)

EXTRA_DIST = \
	$(pkg_data) \
	$(pkg_data_in) \
	$(pkg_scripts) \
	$(pkg_scripts_in) \
	macros-perarch.in make_macrosfiles.sh.in \
	rpm-spec-mode.el

edit = sed \
	-e 's,@RPMVENDOR\@,$(RPMVENDOR),g' \
	-e 's,@RPMVENDORDIR\@,$(RPMVENDORDIR),g' \
	-e 's,@RPMCANONVENDOR\@,$(RPMCANONVENDOR),g' \
	-e 's,@RPMLIBDIR\@,$(RPMLIBDIR),g' \
	-e 's,@RPMSYSCONFDIR\@,$(RPMSYSCONFDIR),g'\
	-e 's,@RPMOS\@,$(RPMOS),g'

%: %.in Makefile
	$(edit) $< > $@

%.macros: macros-perarch make_macrosfiles.sh
	arch=`echo $@ | sed 's,\\.macros,,'`; \
	sh ./make_macrosfiles.sh macros-perarch $$arch > $@

install-data-local: $(macrosfiles)
	for i in $(RPMALLARCH); do \
	  $(mkinstalldirs) $(DESTDIR)$(RPMVENDORDIR)/$${i}-$(RPMOS); \
	  $(install_sh_DATA) $${i}.macros $(DESTDIR)$(RPMVENDORDIR)/$${i}-$(RPMOS)/macros; \
	done

.PHONY: rpm
rpm: dist dist-bzip2
	gzip -dc $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz | bzip2 > $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2
	rpmbuild -ba --clean --define "_sourcedir `pwd`" rpm-mandriva-setup.spec

.PHONY: ChangeLog
ChangeLog:
	# cvs2cl -W 400 -I ChangeLog --accum -U ../common/username
	rm -f *.bak

cvstag:
	cvs tag $(CVSTAGOPT) $(TAG)

CLEANFILES = $(pkg_gdata) $(pkg_gscripts) $(macrosfiles) \
			 macros-perarch \
			 make_macrosfiles.sh