aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.am
blob: a09629212a81572a80f5e1eef6e2daa552b2bc27 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# $Id: Makefile.am 271263 2010-11-01 23:20:42Z peroyvind $

arch_macrosfiles = $(RPMALLARCH:=.macros)

pkg_data = \
		   rpmpopt

pkg_gdata = \
		   macros \
		   rpmrc

pkg_sysconf_macros_tmp = \
		   build.macros

pkg_data_in = $(pkg_gdata:=.in)

pkg_sysconf_macros_in = $(pkg_sysconf_macros_tmp:=.in)

pkg_sysconf_macros = $(pkg_sysconf_macros_tmp)

pkg_gconfig = \
		   platform \
		   $(if $(CANONTARGETCPU32), platform32, )

pkg_scripts = \
		   brp-compress \
		   brp-strip \
		   brp-strip-comment-note \
		   brp-strip-static-archive \
		   brp-java-repack-jars \
		   drop-ld-no-undefined-for-shared-lib-modules-in-libtool \
		   filter.sh \
		   find-lang.pl \
		   find-debuginfo.sh \
		   fix-dlsearch-path-in-libtool-for-multilib \
		   fix-libtool-from-moving-options-after-libs \
		   fix-libtool-ltmain-from-overlinking \
		   force-as-needed-for-shared-lib-in-libtool \
		   gem_helper.rb \
	           git-repository--after-tarball \
	           git-repository--apply-patch \
		   http.req \
		   magic.prov \
		   magic.req \
		   kmod.prov \
		   perl.prov \
		   perl.req \
		   perl.req-from-meta \
		   php.prov \
		   php.req \
		   pkgconfigdeps.sh \
		   pythoneggs.py \
		   rubygems.rb \
		   fontconfig.prov

pkg_gscripts = \
		   find-provides \
		   find-requires \
		   find-provides.perl \
		   gi-find-deps.sh

pkg_scripts_in = $(pkg_gscripts:=.in)

BUILT_SOURCES = macros-perarch make_arch_macrosfiles.sh rpmgenplatform

pkglibdir = @RPMVENDORDIR@
pkglibexecdir = @RPMVENDORDIR@

noinst_PROGRAMS = rpmeval

rpmeval_SOURCES = rpmeval.c

rpmeval_LDFLAGS = -lrpm

pkglibexec_PROGRAMS = g-ir-extract-deps

g_ir_extract_deps_SOURCES = g-ir-extract-deps.c

noinst_DATA = $(pkg_gconfig)

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

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

EXTRA_DIST = \
	$(pkg_data) \
	$(pkg_data_in) \
	$(pkg_sysconf_macros_in) \
	$(pkg_scripts) \
	$(pkg_scripts_in) \
	macros-perarch.in make_arch_macrosfiles.sh.in \
	rpmgenplatform.in rpmrc.in \
	rpm-spec-mode.el \
	rpmb_deprecated \
	tests.sh tests/macros.sh \
	tests/findlang.pl tests/findlang.sh

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' \
	-e 's,@CANONTARGETCPU\@,$(CANONTARGETCPU),g' \
	-e 's,@CANONTARGETGNU\@,$(CANONTARGETGNU),g' \
	-e 's,@RPMALLARCH\@,$(RPMALLARCH),g' \
	-e 's,@DISTSUFFIX\@,$(DISTSUFFIX),g'

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

$(arch_macrosfiles): rpmrc macros-perarch make_arch_macrosfiles.sh
	arch=`echo $@ | sed 's,\\.macros,,'`; \
	sh ./make_arch_macrosfiles.sh macros-perarch $$arch > $@

platform: rpmgenplatform Makefile
	perl rpmgenplatform $(CANONTARGETCPU) > $@

platform32: rpmgenplatform Makefile
	perl rpmgenplatform $(CANONTARGETCPU32) > $@

install-data-local: $(arch_macrosfiles) $(pkg_gconfig) $(pkg_sysconf_macros_tmp)
if ONLY_RPMRC
	echo "not installing per-arch macros which are already in rpmrc and standard rpm per-arch macros"
else
	for i in $(RPMALLARCH); do \
	  $(mkinstalldirs) $(DESTDIR)$(RPMVENDORDIR)/platform/$${i}-$(RPMOS); \
	  $(install_sh_DATA) $${i}.macros $(DESTDIR)$(RPMVENDORDIR)/platform/$${i}-$(RPMOS)/macros; \
	done
endif
	[ -d $(DESTDIR)$(RPMSYSCONFDIR)/macros.d ] || $(mkinstalldirs) $(DESTDIR)$(RPMSYSCONFDIR)/macros.d
	$(install_sh_SCRIPT) rpmb_deprecated $(DESTDIR)$(RPMLIBDIR)
	for i in $(pkg_sysconf_macros); do \
		$(install_sh_DATA) $${i} $(DESTDIR)$(RPMSYSCONFDIR)/macros.d/$${i}; \
	done
if RPMPLATFORM
	for i in $(pkg_gconfig); do \
		$(install_sh_DATA) $${i} $(DESTDIR)$(RPMSYSCONFDIR)/$${i}; \
	done
	$(install_sh_SCRIPT) rpmgenplatform $(DESTDIR)$(bindir)/rpmgenplatform
endif

.PHONY: ChangeLog test

ChangeLog:
	@if [ -e ".svn" ]; then \
	    $(MAKE) ChangeLog-svn; \
	elif [ -e ".git" ]; then \
	    $(MAKE) ChangeLog-git; \
	else \
	    echo "Unknown SCM (not SVN nor GIT)";\
	    exit 1; \
	fi;

ChangeLog-svn:
	LC_ALL=C svn2cl
	rm -f *.bak

ChangeLog-git:
	@git2cl >ChangeLog

test: $(pkg_gdata) $(pkg_gscripts) $(arch_macrosfiles) $(pkg_gconfig)
	sh tests.sh

CLEANFILES = $(pkg_gdata) $(pkg_gscripts) $(arch_macrosfiles) $(pkg_gconfig)\
			 macros-perarch $(pkg_sysconf_macros_tmp) \
			 make_arch_macrosfiles.sh