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*
14 SUBDIRS += lua rpmio rpmdb lib build python scripts doc . tests
16 DIST_SUBDIRS = po misc db3 lua rpmio rpmdb lib build python scripts doc tests
18 pkgconfigdir = $(libdir)/pkgconfig
21 -I$(top_srcdir)/build \
23 -I$(top_srcdir)/rpmdb \
24 -I$(top_srcdir)/rpmio \
25 @WITH_BEECRYPT_INCLUDE@ \
27 -I$(top_srcdir)/misc \
29 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
30 AM_CPPFLAGS += -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\""
31 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
33 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
37 pkginclude_HEADERS += rpmio/argv.h
38 pkginclude_HEADERS += rpmio/rpmio.h
39 pkginclude_HEADERS += rpmio/rpmurl.h
40 pkginclude_HEADERS += rpmio/rpmmacro.h
41 pkginclude_HEADERS += rpmio/rpmlog.h
42 pkginclude_HEADERS += rpmio/rpmmessages.h
43 pkginclude_HEADERS += rpmio/rpmpgp.h
44 pkginclude_HEADERS += rpmio/rpmsq.h
45 pkginclude_HEADERS += rpmio/rpmsw.h
47 pkginclude_HEADERS += rpmdb/header.h
48 pkginclude_HEADERS += rpmdb/hdrinline.h
49 pkginclude_HEADERS += rpmdb/rpmdb.h
51 pkginclude_HEADERS += lib/idtx.h
52 pkginclude_HEADERS += lib/rpmcli.h
53 pkginclude_HEADERS += lib/rpmlib.h
54 pkginclude_HEADERS += lib/rpmal.h
55 pkginclude_HEADERS += lib/rpmds.h
56 pkginclude_HEADERS += lib/rpmfi.h
57 pkginclude_HEADERS += lib/rpmgi.h
58 pkginclude_HEADERS += lib/rpmps.h
59 pkginclude_HEADERS += lib/rpmte.h
60 pkginclude_HEADERS += lib/rpmts.h
61 pkginclude_HEADERS += lib/stringbuf.h
63 pkginclude_HEADERS += build/rpmbuild.h
64 pkginclude_HEADERS += build/rpmfc.h
65 pkginclude_HEADERS += build/rpmspec.h
68 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
71 bin_PROGRAMS = rpm2cpio
73 rpmlibexec_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
74 rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \
75 config.guess config.sub
77 rpm_SOURCES = rpmqv.c debug.h system.h
78 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
79 rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
80 rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
82 rpmb_SOURCES = build.c rpmqv.c build.h debug.h system.h
83 rpmb_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMBT
84 rpmb_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
85 rpmb_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
87 rpmd_SOURCES = rpmqv.c debug.h system.h
88 rpmd_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB
89 rpmd_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
90 rpmd_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
92 rpmi_SOURCES = rpmqv.c debug.h system.h
93 rpmi_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMEIU
94 rpmi_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
95 rpmi_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
97 rpmk_SOURCES = rpmqv.c debug.h system.h
98 rpmk_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMK
99 rpmk_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
100 rpmk_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
102 rpmq_SOURCES = rpmqv.c debug.h system.h
103 rpmq_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMQV
104 rpmq_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
105 rpmq_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
107 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
108 rpm2cpio_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
109 rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
114 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
116 rpmlibexec_PROGRAMS += debugedit
117 debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
118 debugedit_LDADD = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@
122 rpmlibexec_PROGRAMS += javadeps
123 javadeps_SOURCES = tools/javadeps.c
126 rpmlibexec_PROGRAMS += rpmcache
127 rpmcache_SOURCES = tools/rpmcache.c
128 rpmcache_LDADD = lib/librpm.la
130 rpmlibexec_PROGRAMS += rpmdeps
131 rpmdeps_SOURCES = tools/rpmdeps.c
132 rpmdeps_LDADD = build/librpmbuild.la
134 bin_PROGRAMS += rpmgraph
135 rpmgraph_SOURCES = tools/rpmgraph.c
136 rpmgraph_LDADD = lib/librpm.la
138 dist_bin_SCRIPTS = scripts/gendiff
140 check_PROGRAMS = dumpdb
141 dumpdb_SOURCES = tools/dumpdb.c
142 dumpdb_LDADD = lib/librpm.la
144 check_PROGRAMS += convertdb1
145 convertdb1_SOURCES = tools/convertdb1.c
146 convertdb1_LDADD = lib/librpm.la
148 check_PROGRAMS += rpminject
149 rpminject_SOURCES = tools/rpminject.c
150 rpminject_LDADD = build/librpmbuild.la
152 check_PROGRAMS += rpmsort
153 rpmsort_SOURCES = tools/rpmsort.c
154 rpmsort_LDADD = lib/librpm.la
156 rpmconfig_DATA = rpmrc
157 rpmrc: $(top_srcdir)/rpmrc.in
159 -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
160 < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
161 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
162 CLEANFILES += rpmrc.tmp rpmrc
163 EXTRA_DIST += rpmrc.in
165 rpmconfig_DATA += macros
166 macros: $(top_srcdir)/macros.in
168 -e "s,[@]varprefix[@],$(localstatedir),g" \
169 < $(top_srcdir)/macros.in > macros.tmp \
170 && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
171 CLEANFILES += macros.tmp macros
172 EXTRA_DIST += macros.in
174 noinst_DATA = platform
175 platform: $(top_srcdir)/platform.in
177 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
178 < $(top_srcdir)/platform.in > platform.tmp \
179 && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
180 CLEANFILES += platform.tmp platform
181 EXTRA_DIST += platform.in
183 pkgconfig_DATA = rpm.pc
184 rpm.pc: $(top_srcdir)/rpm.pc.in
186 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
187 < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
188 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
189 CLEANFILES += rpm.pc.tmp rpm.pc
190 EXTRA_DIST += rpm.pc.in
192 rpmconfig_DATA += rpmpopt-$(VERSION)
193 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
195 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
196 < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
197 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
198 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
199 EXTRA_DIST += rpmpopt.in
201 pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
202 pkgsrc_RPMSdir = $(pkgsrcdir)/RPMS
204 pkgsrc_SRPMSdir = $(pkgsrcdir)/SRPMS
206 pkgsrc_SPECSdir = $(pkgsrcdir)/SPECS
208 pkgsrc_SOURCESdir = $(pkgsrcdir)/SOURCES
209 pkgsrc_SOURCES_DATA =
210 pkgsrc_BUILDdir = $(pkgsrcdir)/BUILD
213 rpmvardir = $(localstatedir)/lib/rpm
217 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
218 @@LN_S@ rpmb $(DESTDIR)$(rpmlibexecdir)/rpmt
219 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
220 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpme
221 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
222 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpmu
223 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
224 @@LN_S@ rpmq $(DESTDIR)$(rpmlibexecdir)/rpmv
225 rm -f $(DESTDIR)$(bindir)/rpmbuild
226 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
227 rm -f $(DESTDIR)$(bindir)/rpmquery
228 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
229 rm -f $(DESTDIR)$(bindir)/rpmverify
230 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
231 rm -f $(DESTDIR)$(bindir)/rpmsign
232 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
233 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
234 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
235 for bf in e i u ; do \
236 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
237 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
241 @case "@host_cpu@" in \
242 *86) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
243 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
244 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
245 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
246 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
247 alpha*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
248 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
249 arm*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\
250 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\
251 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4tl ;\
252 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;\
253 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tejl ;\
254 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv6l ;;\
255 sparc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
256 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\
257 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
258 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9v ;\
259 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;\
260 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64v ;;\
261 ia64*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
262 s390*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
263 mipsel*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
264 mips*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
265 powerpc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\
266 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppciseries ;\
267 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppcpseries ;\
268 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;\
269 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64iseries ;\
270 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64pseries ;;\
271 *) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
273 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
274 @case "@host_os@" in \
275 mint) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
276 solaris*|linux*|darwin*) \
277 DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
279 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
281 # XXX to appease distcheck we need to remove "stuff" here...
283 @rm -rf $(DESTDIR)/$(rpmconfigdir)/*-*
284 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
285 rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
286 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
287 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
288 rm -f $(DESTDIR)$(bindir)/rpmquery
289 rm -f $(DESTDIR)$(bindir)/rpmbuild
290 rm -f $(DESTDIR)$(bindir)/rpmu
291 rm -f $(DESTDIR)$(bindir)/rpmsign
292 rm -f $(DESTDIR)$(bindir)/rpme
293 rm -f $(DESTDIR)$(bindir)/rpmverify
294 rm -f $(DESTDIR)$(bindir)/rpmdb
295 rm -f $(DESTDIR)$(bindir)/rpmi
298 @rm -rf Doxytags apidocs
299 @rm -f stamp-h.in db3/*.orig db3/db3lobjs
301 MAINTAINERCLEANFILES = ChangeLog
305 @for f in $(rpmbin_PROGRAMS) ; do\
306 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmbindir)/$$f ;\
307 $(__CHMOD) g+s $(DESTDIR)$(rpmbindir)/$$f ;\
309 @for f in $(bin_PROGRAMS) ; do\
310 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(bindir)/$$f ;\
312 @for f in $(rpmlibexec_PROGRAMS) ; do\
313 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmlibexecdir)/$$f ;\
314 $(__CHMOD) g+s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
316 @for f in $(pkglib_SCRIPTS) ; do\
317 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
319 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
320 @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmvardir)
321 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/[A-Z]*
322 -@$(__CHMOD) 0775 $(DESTDIR)$(rpmvardir)
323 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/__db.*
327 @for f in $(rpmbin_PROGRAMS) ; do\
328 $(__CHMOD) g-s $(DESTDIR)$(rpmbindir)/$$f ;\
330 @for f in $(rpmlibexec_PROGRAMS) ; do\
331 $(__CHMOD) g-s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
335 doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@
338 - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
340 ACLOCAL_AMFLAGS = -I m4