1 # Top level Makefile for rpm
3 include $(top_srcdir)/rpm.am
6 EXTRA_DIST = CHANGES ChangeLog CREDITS Doxyheader GROUPS INSTALL \
8 db db3/configure installplatform platform*
10 SUBDIRS = po misc @WITH_DB_SUBDIR@ lua rpmio rpmdb lib build python scripts doc . tests
12 pkgconfigdir = $(libdir)/pkgconfig
13 pkgconfig_DATA = rpm.pc
16 -I$(top_srcdir)/build \
18 -I$(top_srcdir)/rpmdb \
19 -I$(top_srcdir)/rpmio \
20 @WITH_BEECRYPT_INCLUDE@ \
22 -I$(top_srcdir)/misc \
24 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
25 AM_CPPFLAGS += -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\""
26 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
28 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
30 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
33 bin_PROGRAMS = rpm2cpio
35 rpmlibexec_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
36 rpmconfig_DATA = rpmrc rpmpopt-$(VERSION) macros
37 rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \
38 config.guess config.sub
40 rpm_SOURCES = rpmqv.c debug.h system.h
41 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
42 rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
43 rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
45 rpmb_SOURCES = build.c rpmqv.c build.h debug.h system.h
46 rpmb_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMBT
47 rpmb_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
48 rpmb_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
50 rpmd_SOURCES = rpmqv.c debug.h system.h
51 rpmd_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB
52 rpmd_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
53 rpmd_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
55 rpmi_SOURCES = rpmqv.c debug.h system.h
56 rpmi_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMEIU
57 rpmi_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
58 rpmi_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
60 rpmk_SOURCES = rpmqv.c debug.h system.h
61 rpmk_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMK
62 rpmk_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
63 rpmk_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
65 rpmq_SOURCES = rpmqv.c debug.h system.h
66 rpmq_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMQV
67 rpmq_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
68 rpmq_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
70 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
71 rpm2cpio_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
72 rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
77 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
79 rpmlibexec_PROGRAMS += debugedit
80 debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
81 debugedit_LDADD = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@
85 rpmlibexec_PROGRAMS += javadeps
86 javadeps_SOURCES = tools/javadeps.c
89 rpmlibexec_PROGRAMS += rpmcache
90 rpmcache_SOURCES = tools/rpmcache.c
91 rpmcache_LDADD = lib/librpm.la
93 rpmlibexec_PROGRAMS += rpmdeps
94 rpmdeps_SOURCES = tools/rpmdeps.c
95 rpmdeps_LDADD = build/librpmbuild.la
97 bin_PROGRAMS += rpmgraph
98 rpmgraph_SOURCES = tools/rpmgraph.c
99 rpmgraph_LDADD = lib/librpm.la
101 dist_bin_SCRIPTS = scripts/gendiff
103 check_PROGRAMS = dumpdb
104 dumpdb_SOURCES = tools/dumpdb.c
105 dumpdb_LDADD = lib/librpm.la
107 check_PROGRAMS += convertdb1
108 convertdb1_SOURCES = tools/convertdb1.c
109 convertdb1_LDADD = lib/librpm.la
111 check_PROGRAMS += rpminject
112 rpminject_SOURCES = tools/rpminject.c
113 rpminject_LDADD = build/librpmbuild.la
115 check_PROGRAMS += rpmsort
116 rpmsort_SOURCES = tools/rpmsort.c
117 rpmsort_LDADD = lib/librpm.la
119 rpmrc: $(top_srcdir)/rpmrc.in
121 -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
122 < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
123 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
124 CLEANFILES += rpmrc.tmp rpmrc
125 EXTRA_DIST += rpmrc.in
127 macros: $(top_srcdir)/macros.in
129 -e "s,[@]varprefix[@],$(localstatedir),g" \
130 < $(top_srcdir)/macros.in > macros.tmp \
131 && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
132 CLEANFILES += macros.tmp macros
133 EXTRA_DIST += macros.in
135 platform: $(top_srcdir)/platform.in
137 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
138 < $(top_srcdir)/platform.in > platform.tmp \
139 && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
140 CLEANFILES += platform.tmp platform
141 EXTRA_DIST += platform.in
143 rpm.pc: $(top_srcdir)/rpm.pc.in
145 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
146 < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
147 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
148 CLEANFILES += rpm.pc.tmp rpm.pc
149 EXTRA_DIST += rpm.pc.in
151 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
153 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
154 < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
155 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
156 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
157 EXTRA_DIST += rpmpopt.in
159 pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
160 pkgsrc_RPMSdir = $(pkgsrcdir)/RPMS
162 pkgsrc_SRPMSdir = $(pkgsrcdir)/SRPMS
164 pkgsrc_SPECSdir = $(pkgsrcdir)/SPECS
166 pkgsrc_SOURCESdir = $(pkgsrcdir)/SOURCES
167 pkgsrc_SOURCES_DATA =
168 pkgsrc_BUILDdir = $(pkgsrcdir)/BUILD
171 rpmvardir = $(localstatedir)/lib/rpm
175 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
176 @@LN_S@ rpmb $(DESTDIR)$(rpmlibexecdir)/rpmt
177 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
178 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpme
179 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
180 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpmu
181 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
182 @@LN_S@ rpmq $(DESTDIR)$(rpmlibexecdir)/rpmv
183 rm -f $(DESTDIR)$(bindir)/rpmbuild
184 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
185 rm -f $(DESTDIR)$(bindir)/rpmquery
186 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
187 rm -f $(DESTDIR)$(bindir)/rpmverify
188 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
189 rm -f $(DESTDIR)$(bindir)/rpmsign
190 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
191 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
192 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
193 for bf in e i u ; do \
194 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
195 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
199 @case "@host_cpu@" in \
200 *86) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
201 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
202 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
203 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
204 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
205 alpha*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
206 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
207 arm*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\
208 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\
209 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4tl ;\
210 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;\
211 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tejl ;\
212 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv6l ;;\
213 sparc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
214 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\
215 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
216 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9v ;\
217 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;\
218 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64v ;;\
219 ia64*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
220 s390*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
221 mipsel*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
222 mips*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
223 powerpc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\
224 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppciseries ;\
225 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppcpseries ;\
226 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;\
227 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64iseries ;\
228 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64pseries ;;\
229 *) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
231 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
232 @case "@host_os@" in \
233 mint) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
234 solaris*|linux*|darwin*) \
235 DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
237 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
239 # XXX to appease distcheck we need to remove "stuff" here...
241 @rm -rf $(DESTDIR)/$(rpmconfigdir)/*-*
242 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
243 rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
244 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
245 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
246 rm -f $(DESTDIR)$(bindir)/rpmquery
247 rm -f $(DESTDIR)$(bindir)/rpmbuild
248 rm -f $(DESTDIR)$(bindir)/rpmu
249 rm -f $(DESTDIR)$(bindir)/rpmsign
250 rm -f $(DESTDIR)$(bindir)/rpme
251 rm -f $(DESTDIR)$(bindir)/rpmverify
252 rm -f $(DESTDIR)$(bindir)/rpmdb
253 rm -f $(DESTDIR)$(bindir)/rpmi
256 @rm -rf Doxytags apidocs
257 @rm -f stamp-h.in db3/*.orig db3/db3lobjs
259 MAINTAINERCLEANFILES = ChangeLog
263 @for f in $(rpmbin_PROGRAMS) ; do\
264 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmbindir)/$$f ;\
265 $(__CHMOD) g+s $(DESTDIR)$(rpmbindir)/$$f ;\
267 @for f in $(bin_PROGRAMS) ; do\
268 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(bindir)/$$f ;\
270 @for f in $(rpmlibexec_PROGRAMS) ; do\
271 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmlibexecdir)/$$f ;\
272 $(__CHMOD) g+s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
274 @for f in $(pkglib_SCRIPTS) ; do\
275 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
277 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
278 @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmvardir)
279 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/[A-Z]*
280 -@$(__CHMOD) 0775 $(DESTDIR)$(rpmvardir)
281 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/__db.*
285 @for f in $(rpmbin_PROGRAMS) ; do\
286 $(__CHMOD) g-s $(DESTDIR)$(rpmbindir)/$$f ;\
288 @for f in $(rpmlibexec_PROGRAMS) ; do\
289 $(__CHMOD) g-s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
293 doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@
296 - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
299 hg log --no-merge -v > ChangeLog
301 ACLOCAL_AMFLAGS = -I m4