1 # Top level Makefile for rpm
3 ACLOCAL_AMFLAGS = -I m4
5 include $(top_srcdir)/rpm.am
8 EXTRA_DIST = CHANGES ChangeLog CREDITS GROUPS INSTALL \
10 db db3/configure installplatform platform*
17 SUBDIRS += lua rpmio rpmdb lib build python scripts doc . tests
19 DIST_SUBDIRS = po misc db3 lua rpmio rpmdb lib build python scripts doc tests
21 pkgconfigdir = $(libdir)/pkgconfig
23 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/rpm
24 AM_CPPFLAGS += -I$(top_srcdir)/build
25 AM_CPPFLAGS += -I$(top_srcdir)/lib
26 AM_CPPFLAGS += -I$(top_builddir)/rpmdb -I$(top_srcdir)/rpmdb
27 AM_CPPFLAGS += -I$(top_srcdir)/rpmio
28 AM_CPPFLAGS += @WITH_NSS_INCLUDE@
29 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
30 AM_CPPFLAGS += -I$(top_srcdir)/misc
31 AM_CPPFLAGS += @WITH_LIBELF_INCLUDE@
32 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
33 AM_CPPFLAGS += -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\""
34 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
36 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
39 nodist_pkginclude_HEADERS =
41 pkginclude_HEADERS += rpmio/argv.h
42 pkginclude_HEADERS += rpmio/rpmio.h
43 pkginclude_HEADERS += rpmio/rpmurl.h
44 pkginclude_HEADERS += rpmio/rpmmacro.h
45 pkginclude_HEADERS += rpmio/rpmlog.h
46 pkginclude_HEADERS += rpmio/rpmmessages.h
47 pkginclude_HEADERS += rpmio/rpmpgp.h
48 pkginclude_HEADERS += rpmio/rpmsq.h
49 pkginclude_HEADERS += rpmio/rpmsw.h
51 pkginclude_HEADERS += rpmdb/header.h
52 pkginclude_HEADERS += rpmdb/rpmdb.h
53 nodist_pkginclude_HEADERS += rpmdb/rpmints.h
55 pkginclude_HEADERS += lib/idtx.h
56 pkginclude_HEADERS += lib/rpmcli.h
57 pkginclude_HEADERS += lib/rpmlib.h
58 pkginclude_HEADERS += lib/rpmal.h
59 pkginclude_HEADERS += lib/rpmds.h
60 pkginclude_HEADERS += lib/rpmfi.h
61 pkginclude_HEADERS += lib/rpmgi.h
62 pkginclude_HEADERS += lib/rpmps.h
63 pkginclude_HEADERS += lib/rpmte.h
64 pkginclude_HEADERS += lib/rpmts.h
65 pkginclude_HEADERS += lib/stringbuf.h
67 pkginclude_HEADERS += build/rpmbuild.h
68 pkginclude_HEADERS += build/rpmfc.h
69 pkginclude_HEADERS += build/rpmspec.h
72 rpmbindir = `echo $(bindir) | $(SED) -e s,usr/bin,bin,`
75 bin_PROGRAMS = rpm2cpio
77 rpmlibexec_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
78 rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \
79 config.guess config.sub
80 DISTCLEANFILES = find-provides
81 DISTCLEANFILES += find-requires
83 rpm_SOURCES = rpmqv.c debug.h system.h
84 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
85 rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
86 rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
88 rpmb_SOURCES = build.c rpmqv.c build.h debug.h system.h
89 rpmb_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMBT
90 rpmb_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
91 rpmb_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
93 rpmd_SOURCES = rpmqv.c debug.h system.h
94 rpmd_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB
95 rpmd_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
96 rpmd_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
98 rpmi_SOURCES = rpmqv.c debug.h system.h
99 rpmi_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMEIU
100 rpmi_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
101 rpmi_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
103 rpmk_SOURCES = rpmqv.c debug.h system.h
104 rpmk_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMK
105 rpmk_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
106 rpmk_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
108 rpmq_SOURCES = rpmqv.c debug.h system.h
109 rpmq_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMQV
110 rpmq_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
111 rpmq_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
113 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
114 rpm2cpio_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
115 rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
120 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
122 rpmlibexec_PROGRAMS += debugedit
123 debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
124 debugedit_LDADD = rpmio/librpmio.la
125 debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
129 rpmlibexec_PROGRAMS += javadeps
130 javadeps_SOURCES = tools/javadeps.c
133 rpmlibexec_PROGRAMS += rpmcache
134 rpmcache_SOURCES = tools/rpmcache.c
135 rpmcache_LDADD = lib/librpm.la
137 rpmlibexec_PROGRAMS += rpmdeps
138 rpmdeps_SOURCES = tools/rpmdeps.c
139 rpmdeps_LDADD = build/librpmbuild.la
141 bin_PROGRAMS += rpmgraph
142 rpmgraph_SOURCES = tools/rpmgraph.c
143 rpmgraph_LDADD = lib/librpm.la
145 dist_bin_SCRIPTS = scripts/gendiff
147 check_PROGRAMS = dumpdb
148 dumpdb_SOURCES = tools/dumpdb.c
149 dumpdb_LDADD = lib/librpm.la
151 check_PROGRAMS += convertdb1
152 convertdb1_SOURCES = tools/convertdb1.c
153 convertdb1_LDADD = lib/librpm.la
155 check_PROGRAMS += rpminject
156 rpminject_SOURCES = tools/rpminject.c
157 rpminject_LDADD = build/librpmbuild.la
159 check_PROGRAMS += rpmsort
160 rpmsort_SOURCES = tools/rpmsort.c
161 rpmsort_LDADD = lib/librpm.la
163 rpmconfig_DATA = rpmrc
164 rpmrc: $(top_srcdir)/rpmrc.in
166 -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
167 < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
168 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
169 CLEANFILES += rpmrc.tmp rpmrc
170 EXTRA_DIST += rpmrc.in
172 rpmconfig_DATA += macros
173 macros: $(top_srcdir)/macros.in
175 -e "s,[@]varprefix[@],$(localstatedir),g" \
176 < $(top_srcdir)/macros.in > macros.tmp \
177 && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
178 CLEANFILES += macros.tmp macros
179 EXTRA_DIST += macros.in
181 noinst_DATA = platform
182 platform: $(top_srcdir)/platform.in
184 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
185 < $(top_srcdir)/platform.in > platform.tmp \
186 && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
187 CLEANFILES += platform.tmp platform
188 EXTRA_DIST += platform.in
190 pkgconfig_DATA = rpm.pc
191 rpm.pc: $(top_srcdir)/rpm.pc.in
193 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
194 < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
195 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
196 CLEANFILES += rpm.pc.tmp rpm.pc
197 EXTRA_DIST += rpm.pc.in
199 rpmconfig_DATA += rpmpopt-$(VERSION)
200 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
202 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
203 < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
204 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
205 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
206 EXTRA_DIST += rpmpopt.in
208 usrsrcdir = $(prefix)/src
210 pkgsrcdir = $(usrsrcdir)/packages
211 pkgsrc_RPMSdir = $(pkgsrcdir)/RPMS
213 pkgsrc_SRPMSdir = $(pkgsrcdir)/SRPMS
215 pkgsrc_SPECSdir = $(pkgsrcdir)/SPECS
217 pkgsrc_SOURCESdir = $(pkgsrcdir)/SOURCES
218 pkgsrc_SOURCES_DATA =
219 pkgsrc_BUILDdir = $(pkgsrcdir)/BUILD
222 rpmvardir = $(localstatedir)/lib/rpm
226 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
227 @@LN_S@ rpmb $(DESTDIR)$(rpmlibexecdir)/rpmt
228 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
229 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpme
230 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
231 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpmu
232 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
233 @@LN_S@ rpmq $(DESTDIR)$(rpmlibexecdir)/rpmv
234 rm -f $(DESTDIR)$(bindir)/rpmbuild
235 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
236 rm -f $(DESTDIR)$(bindir)/rpmquery
237 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
238 rm -f $(DESTDIR)$(bindir)/rpmverify
239 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
240 rm -f $(DESTDIR)$(bindir)/rpmsign
241 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
242 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
243 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
244 for bf in e i u ; do \
245 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
246 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
250 @case "@host_cpu@" in \
251 *86) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
252 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
253 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
254 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
255 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
256 alpha*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
257 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
258 arm*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\
259 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\
260 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4tl ;\
261 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;\
262 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tejl ;\
263 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv6l ;;\
264 sparc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
265 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\
266 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
267 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9v ;\
268 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;\
269 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64v ;;\
270 ia64*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
271 s390*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
272 mipsel*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
273 mips*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
274 powerpc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\
275 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppciseries ;\
276 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppcpseries ;\
277 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;\
278 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64iseries ;\
279 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64pseries ;;\
280 *) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
282 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
283 @case "@host_os@" in \
284 mint) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
285 solaris*|linux*|darwin*) \
286 DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
288 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
290 # XXX to appease distcheck we need to remove "stuff" here...
292 @rm -rf $(DESTDIR)/$(rpmconfigdir)/*-*
293 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
294 rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
295 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
296 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
297 rm -f $(DESTDIR)$(bindir)/rpmquery
298 rm -f $(DESTDIR)$(bindir)/rpmbuild
299 rm -f $(DESTDIR)$(bindir)/rpmu
300 rm -f $(DESTDIR)$(bindir)/rpmsign
301 rm -f $(DESTDIR)$(bindir)/rpme
302 rm -f $(DESTDIR)$(bindir)/rpmverify
303 rm -f $(DESTDIR)$(bindir)/rpmdb
304 rm -f $(DESTDIR)$(bindir)/rpmi
306 MAINTAINERCLEANFILES = ChangeLog
310 @for f in $(rpmbin_PROGRAMS) ; do\
311 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmbindir)/$$f ;\
312 $(__CHMOD) g+s $(DESTDIR)$(rpmbindir)/$$f ;\
314 @for f in $(bin_PROGRAMS) ; do\
315 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(bindir)/$$f ;\
317 @for f in $(rpmlibexec_PROGRAMS) ; do\
318 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmlibexecdir)/$$f ;\
319 $(__CHMOD) g+s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
321 @for f in $(pkglib_SCRIPTS) ; do\
322 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
324 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
325 @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmvardir)
326 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/[A-Z]*
327 -@$(__CHMOD) 0775 $(DESTDIR)$(rpmvardir)
328 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/__db.*
332 @for f in $(rpmbin_PROGRAMS) ; do\
333 $(__CHMOD) g-s $(DESTDIR)$(rpmbindir)/$$f ;\
335 @for f in $(rpmlibexec_PROGRAMS) ; do\
336 $(__CHMOD) g-s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
339 # Build hacking only on request
342 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
344 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
345 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
346 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
347 -e "s,[@]VERSION[@],$(VERSION)," \
348 < $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
350 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
351 @DOXYGEN@ doc/hacking.doxy
352 noinst_DATA += doc/hacking/html/index.html
355 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
357 # Always build librpm docs
359 doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
360 files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
361 $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
362 -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
363 -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
364 -e "s,[@]PACKAGE[@],$(PACKAGE)," \
365 -e "s,[@]VERSION[@],$(VERSION)," \
366 < $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
368 doc/librpm/html/index.html: doc/librpm.doxy
369 @DOXYGEN@ doc/librpm.doxy
370 noinst_DATA += doc/librpm/html/index.html
372 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
373 EXTRA_DIST += doc/librpm/html
376 db.h: $(top_builddir)/db3/db.h
377 $(LN_S) $(top_builddir)/db3/db.h $@
378 BUILT_SOURCES += db.h
380 DISTCLEANFILES += db.h
383 rm -rf doc/hacking/html
388 rm -f stamp-h.in db3/*.orig db3/db3lobjs
390 maintainer-clean-local:
391 rm -rf doc/librpm/html
393 $(top_srcdir)/preinstall.am: Makefile.am
394 rm -f $(top_srcdir)/preinstall.am
395 @for f in $(HEADERS); do \
397 echo 'include/rpm/'$$b': '$$f include/rpm/$(dirstamp) >> $(top_srcdir)/preinstall.am;\
398 echo ' $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
399 echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
400 echo 'CLEANFILES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
403 include/rpm/$(dirstamp):
404 @$(MKDIR_P) include/rpm
405 @: > include/rpm/$(dirstamp)
407 include $(top_srcdir)/preinstall.am